mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 19:29:37 +00:00
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>
This commit is contained in:
parent
f489a4ba76
commit
43c07adaeb
3 changed files with 8 additions and 4 deletions
|
@ -164,7 +164,8 @@ struct bfa_ioc_attr {
|
|||
u8 port_mode; /*!< enum bfa_mode */
|
||||
u8 cap_bm; /*!< capability */
|
||||
u8 port_mode_cfg; /*!< enum bfa_mode */
|
||||
u8 rsvd[4]; /*!< 64bit align */
|
||||
u8 def_fn; /*!< 1 if default fn */
|
||||
u8 rsvd[3]; /*!< 64bit align */
|
||||
};
|
||||
|
||||
/* Adapter capability mask definition */
|
||||
|
|
|
@ -2371,7 +2371,7 @@ bfa_nw_ioc_get_attr(struct bfa_ioc *ioc, struct bfa_ioc_attr *ioc_attr)
|
|||
memset((void *)ioc_attr, 0, sizeof(struct bfa_ioc_attr));
|
||||
|
||||
ioc_attr->state = bfa_ioc_get_state(ioc);
|
||||
ioc_attr->port_id = ioc->port_id;
|
||||
ioc_attr->port_id = bfa_ioc_portid(ioc);
|
||||
ioc_attr->port_mode = ioc->port_mode;
|
||||
|
||||
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)
|
|||
|
||||
bfa_ioc_get_adapter_attr(ioc, &ioc_attr->adapter_attr);
|
||||
|
||||
ioc_attr->pci_attr.device_id = ioc->pcidev.device_id;
|
||||
ioc_attr->pci_attr.pcifn = ioc->pcidev.pci_func;
|
||||
ioc_attr->pci_attr.device_id = bfa_ioc_devid(ioc);
|
||||
ioc_attr->pci_attr.pcifn = bfa_ioc_pcifn(ioc);
|
||||
ioc_attr->def_fn = bfa_ioc_is_default(ioc);
|
||||
bfa_ioc_get_pci_chip_rev(ioc, ioc_attr->pci_attr.chip_rev);
|
||||
}
|
||||
|
||||
|
|
|
@ -222,6 +222,8 @@ struct bfa_ioc_hwif {
|
|||
#define bfa_ioc_bar0(__ioc) ((__ioc)->pcidev.pci_bar_kva)
|
||||
#define bfa_ioc_portid(__ioc) ((__ioc)->port_id)
|
||||
#define bfa_ioc_asic_gen(__ioc) ((__ioc)->asic_gen)
|
||||
#define bfa_ioc_is_default(__ioc) \
|
||||
(bfa_ioc_pcifn(__ioc) == bfa_ioc_portid(__ioc))
|
||||
#define bfa_ioc_fetch_stats(__ioc, __stats) \
|
||||
(((__stats)->drv_stats) = (__ioc)->stats)
|
||||
#define bfa_ioc_clr_stats(__ioc) \
|
||||
|
|
Loading…
Reference in a new issue