diff options
author | Rasesh Mody <rmody@brocade.com> | 2013-05-20 06:08:03 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-05-20 17:07:59 -0400 |
commit | 43c07adaebc34d8c23cdc60128fc7f41088515f7 (patch) | |
tree | e613c6d2644c77e0cc4b4fd2a850fd7ed9087643 /drivers/net/ethernet/brocade | |
parent | f489a4ba769ca1d7dd4657a4f68ea93746dd669b (diff) |
bna: Enahncement to Identify Default IOC Function
User should not be allowed to delete base function of eth port. Add a new field
to the bfa ioc attributes structure to indicate if the given ioc is default
function on the port or not.
Signed-off-by: Rasesh Mody <rmody@brocade.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/brocade')
-rw-r--r-- | drivers/net/ethernet/brocade/bna/bfa_defs.h | 3 | ||||
-rw-r--r-- | drivers/net/ethernet/brocade/bna/bfa_ioc.c | 7 | ||||
-rw-r--r-- | drivers/net/ethernet/brocade/bna/bfa_ioc.h | 2 |
3 files changed, 8 insertions, 4 deletions
diff --git a/drivers/net/ethernet/brocade/bna/bfa_defs.h b/drivers/net/ethernet/brocade/bna/bfa_defs.h index e423f82da490..b7d8127c198f 100644 --- a/drivers/net/ethernet/brocade/bna/bfa_defs.h +++ b/drivers/net/ethernet/brocade/bna/bfa_defs.h | |||
@@ -164,7 +164,8 @@ struct bfa_ioc_attr { | |||
164 | u8 port_mode; /*!< enum bfa_mode */ | 164 | u8 port_mode; /*!< enum bfa_mode */ |
165 | u8 cap_bm; /*!< capability */ | 165 | u8 cap_bm; /*!< capability */ |
166 | u8 port_mode_cfg; /*!< enum bfa_mode */ | 166 | u8 port_mode_cfg; /*!< enum bfa_mode */ |
167 | u8 rsvd[4]; /*!< 64bit align */ | 167 | u8 def_fn; /*!< 1 if default fn */ |
168 | u8 rsvd[3]; /*!< 64bit align */ | ||
168 | }; | 169 | }; |
169 | 170 | ||
170 | /* Adapter capability mask definition */ | 171 | /* Adapter capability mask definition */ |
diff --git a/drivers/net/ethernet/brocade/bna/bfa_ioc.c b/drivers/net/ethernet/brocade/bna/bfa_ioc.c index f2b73ffa9122..6f3cac060f29 100644 --- a/drivers/net/ethernet/brocade/bna/bfa_ioc.c +++ b/drivers/net/ethernet/brocade/bna/bfa_ioc.c | |||
@@ -2371,7 +2371,7 @@ bfa_nw_ioc_get_attr(struct bfa_ioc *ioc, struct bfa_ioc_attr *ioc_attr) | |||
2371 | memset((void *)ioc_attr, 0, sizeof(struct bfa_ioc_attr)); | 2371 | memset((void *)ioc_attr, 0, sizeof(struct bfa_ioc_attr)); |
2372 | 2372 | ||
2373 | ioc_attr->state = bfa_ioc_get_state(ioc); | 2373 | ioc_attr->state = bfa_ioc_get_state(ioc); |
2374 | ioc_attr->port_id = ioc->port_id; | 2374 | ioc_attr->port_id = bfa_ioc_portid(ioc); |
2375 | ioc_attr->port_mode = ioc->port_mode; | 2375 | ioc_attr->port_mode = ioc->port_mode; |
2376 | 2376 | ||
2377 | ioc_attr->port_mode_cfg = ioc->port_mode_cfg; | 2377 | ioc_attr->port_mode_cfg = ioc->port_mode_cfg; |
@@ -2381,8 +2381,9 @@ bfa_nw_ioc_get_attr(struct bfa_ioc *ioc, struct bfa_ioc_attr *ioc_attr) | |||
2381 | 2381 | ||
2382 | bfa_ioc_get_adapter_attr(ioc, &ioc_attr->adapter_attr); | 2382 | bfa_ioc_get_adapter_attr(ioc, &ioc_attr->adapter_attr); |
2383 | 2383 | ||
2384 | ioc_attr->pci_attr.device_id = ioc->pcidev.device_id; | 2384 | ioc_attr->pci_attr.device_id = bfa_ioc_devid(ioc); |
2385 | ioc_attr->pci_attr.pcifn = ioc->pcidev.pci_func; | 2385 | ioc_attr->pci_attr.pcifn = bfa_ioc_pcifn(ioc); |
2386 | ioc_attr->def_fn = bfa_ioc_is_default(ioc); | ||
2386 | bfa_ioc_get_pci_chip_rev(ioc, ioc_attr->pci_attr.chip_rev); | 2387 | bfa_ioc_get_pci_chip_rev(ioc, ioc_attr->pci_attr.chip_rev); |
2387 | } | 2388 | } |
2388 | 2389 | ||
diff --git a/drivers/net/ethernet/brocade/bna/bfa_ioc.h b/drivers/net/ethernet/brocade/bna/bfa_ioc.h index 63a85e555df8..f04e0aab25b4 100644 --- a/drivers/net/ethernet/brocade/bna/bfa_ioc.h +++ b/drivers/net/ethernet/brocade/bna/bfa_ioc.h | |||
@@ -222,6 +222,8 @@ struct bfa_ioc_hwif { | |||
222 | #define bfa_ioc_bar0(__ioc) ((__ioc)->pcidev.pci_bar_kva) | 222 | #define bfa_ioc_bar0(__ioc) ((__ioc)->pcidev.pci_bar_kva) |
223 | #define bfa_ioc_portid(__ioc) ((__ioc)->port_id) | 223 | #define bfa_ioc_portid(__ioc) ((__ioc)->port_id) |
224 | #define bfa_ioc_asic_gen(__ioc) ((__ioc)->asic_gen) | 224 | #define bfa_ioc_asic_gen(__ioc) ((__ioc)->asic_gen) |
225 | #define bfa_ioc_is_default(__ioc) \ | ||
226 | (bfa_ioc_pcifn(__ioc) == bfa_ioc_portid(__ioc)) | ||
225 | #define bfa_ioc_fetch_stats(__ioc, __stats) \ | 227 | #define bfa_ioc_fetch_stats(__ioc, __stats) \ |
226 | (((__stats)->drv_stats) = (__ioc)->stats) | 228 | (((__stats)->drv_stats) = (__ioc)->stats) |
227 | #define bfa_ioc_clr_stats(__ioc) \ | 229 | #define bfa_ioc_clr_stats(__ioc) \ |