Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

cnic: Add the interfaces to get FC-NPIV table.

Signed-off-by: Adheer Chandravanshi <adheer.chandravanshi@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Adheer Chandravanshi and committed by
David S. Miller
9b8d5044 eddb7554

+32 -2
+18
drivers/net/ethernet/broadcom/cnic.c
··· 5445 5445 kfree(dev); 5446 5446 } 5447 5447 5448 + static int cnic_get_fc_npiv_tbl(struct cnic_dev *dev, 5449 + struct cnic_fc_npiv_tbl *npiv_tbl) 5450 + { 5451 + struct cnic_local *cp = dev->cnic_priv; 5452 + struct bnx2x *bp = netdev_priv(dev->netdev); 5453 + int ret; 5454 + 5455 + if (!test_bit(CNIC_F_CNIC_UP, &dev->flags)) 5456 + return -EAGAIN; /* bnx2x is down */ 5457 + 5458 + if (!BNX2X_CHIP_IS_E2_PLUS(bp)) 5459 + return -EINVAL; 5460 + 5461 + ret = cp->ethdev->drv_get_fc_npiv_tbl(dev->netdev, npiv_tbl); 5462 + return ret; 5463 + } 5464 + 5448 5465 static struct cnic_dev *cnic_alloc_dev(struct net_device *dev, 5449 5466 struct pci_dev *pdev) 5450 5467 { ··· 5480 5463 cdev->register_device = cnic_register_device; 5481 5464 cdev->unregister_device = cnic_unregister_device; 5482 5465 cdev->iscsi_nl_msg_recv = cnic_iscsi_nl_msg_recv; 5466 + cdev->get_fc_npiv_tbl = cnic_get_fc_npiv_tbl; 5483 5467 5484 5468 cp = cdev->cnic_priv; 5485 5469 cp->dev = cdev;
+14 -2
drivers/net/ethernet/broadcom/cnic_if.h
··· 15 15 16 16 #include "bnx2x/bnx2x_mfw_req.h" 17 17 18 - #define CNIC_MODULE_VERSION "2.5.21" 19 - #define CNIC_MODULE_RELDATE "January 29, 2015" 18 + #define CNIC_MODULE_VERSION "2.5.22" 19 + #define CNIC_MODULE_RELDATE "July 20, 2015" 20 20 21 21 #define CNIC_ULP_RDMA 0 22 22 #define CNIC_ULP_ISCSI 1 ··· 166 166 } data; 167 167 }; 168 168 169 + #define MAX_NPIV_ENTRIES 64 170 + #define FC_NPIV_WWN_SIZE 8 171 + 172 + struct cnic_fc_npiv_tbl { 173 + u8 wwpn[MAX_NPIV_ENTRIES][FC_NPIV_WWN_SIZE]; 174 + u8 wwnn[MAX_NPIV_ENTRIES][FC_NPIV_WWN_SIZE]; 175 + u32 count; 176 + }; 177 + 169 178 struct cnic_ops { 170 179 struct module *cnic_owner; 171 180 /* Calls to these functions are protected by RCU. When ··· 240 231 int (*drv_submit_kwqes_16)(struct net_device *, 241 232 struct kwqe_16 *[], u32); 242 233 int (*drv_ctl)(struct net_device *, struct drv_ctl_info *); 234 + int (*drv_get_fc_npiv_tbl)(struct net_device *, 235 + struct cnic_fc_npiv_tbl *); 243 236 unsigned long reserved1[2]; 244 237 union drv_info_to_mcp *addr_drv_info_to_mcp; 245 238 }; ··· 330 319 struct cnic_dev *(*cm_select_dev)(struct sockaddr_in *, int ulp_type); 331 320 int (*iscsi_nl_msg_recv)(struct cnic_dev *dev, u32 msg_type, 332 321 char *data, u16 data_size); 322 + int (*get_fc_npiv_tbl)(struct cnic_dev *, struct cnic_fc_npiv_tbl *); 333 323 unsigned long flags; 334 324 #define CNIC_F_CNIC_UP 1 335 325 #define CNIC_F_BNX2_CLASS 3