Upinder Malhi | e3cf00d | 2013-09-10 03:38:16 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (c) 2013, Cisco Systems, Inc. All rights reserved. |
| 3 | * |
| 4 | * This program is free software; you may redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License as published by |
| 6 | * the Free Software Foundation; version 2 of the License. |
| 7 | * |
| 8 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 9 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 10 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 11 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS |
| 12 | * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
| 13 | * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
| 14 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 15 | * SOFTWARE. |
| 16 | * |
| 17 | */ |
| 18 | |
| 19 | #ifndef USNIC_FWD_H_ |
| 20 | #define USNIC_FWD_H_ |
| 21 | |
| 22 | #include <linux/if.h> |
| 23 | #include <linux/pci.h> |
| 24 | #include <linux/spinlock.h> |
| 25 | |
| 26 | #include "usnic_abi.h" |
| 27 | #include "vnic_devcmd.h" |
| 28 | |
| 29 | struct usnic_fwd_dev { |
| 30 | struct pci_dev *pdev; |
| 31 | struct net_device *netdev; |
| 32 | spinlock_t lock; |
| 33 | }; |
| 34 | |
| 35 | struct usnic_fwd_filter { |
| 36 | enum usnic_transport_type transport; |
| 37 | u16 port_num; |
| 38 | }; |
| 39 | |
| 40 | struct usnic_fwd_filter_hndl { |
| 41 | enum filter_type type; |
| 42 | u32 id; |
| 43 | u32 vnic_idx; |
| 44 | struct usnic_fwd_dev *ufdev; |
| 45 | struct list_head link; |
| 46 | struct usnic_fwd_filter *filter; |
| 47 | }; |
| 48 | |
| 49 | struct usnic_fwd_dev *usnic_fwd_dev_alloc(struct pci_dev *pdev); |
| 50 | void usnic_fwd_dev_free(struct usnic_fwd_dev *ufdev); |
| 51 | int usnic_fwd_add_usnic_filter(struct usnic_fwd_dev *ufdev, int vnic_idx, |
| 52 | int rq_idx, struct usnic_fwd_filter *filter, |
| 53 | struct usnic_fwd_filter_hndl **filter_hndl); |
| 54 | int usnic_fwd_del_filter(struct usnic_fwd_filter_hndl *filter_hndl); |
| 55 | int usnic_fwd_enable_rq(struct usnic_fwd_dev *ufdev, int vnic_idx, int rq_idx); |
| 56 | int usnic_fwd_disable_rq(struct usnic_fwd_dev *ufdev, int vnic_idx, int rq_idx); |
| 57 | |
| 58 | #endif /* !USNIC_FWD_H_ */ |