Update bna driver version to 3.0.2.0
Subsystems (3)
cover Update bna driver version to 3.0.2.0
Hello David,
The following patch set adds support for Brocade-1860 Fabric Adapter code re-org and cleaning.
It updates the Brocade BNA driver to v3.0.2.0.
The driver has been compiled & tested against net-next-2.6(3.0.0-rc7)
Note: pathces 0007 to 0009 are split for ease of review.
Thanks,
Rasesh
Rasesh Mody (45):
bna: Checkpatch Cleanup
bna: Update ASIC Register Definition to Support New Hardware
bna: Change IOC Event Notification Call Back Mechanism
bna: State Machine Fault Handling Cleanup
bna: MSGQ Implementation
bna: Use DEFINE_PCI_DEVICE_TABLE and Print Driver Version
bna: Introduce ENET as New Driver and FW Interface
bna: Tx and Rx Redesign
bna: ENET and Tx Rx Redesign Update
bna: Remove Obsolete Files
bna: Brocade-1860 Fabric Adapter Enablement
bna: Hardware Clock Setup
bna: IOC PLL changes and init cleanup
bna: Brocade 1860 Register and ASIC Mode Changes
bna: Set MBOX MSIX Index to Zero
bna: IOC PCI Init & Enable Changes
bna: Mailbox Interface Changes and FW MBOX fix
bna: Implement Polling Mechanism for FW Ready
bna: HW Type Check Fix
bna: MBOX IRQ Sync Vector Num Fix
bna: Remove Reset Call Back
bna: Capability Map and MFG Block Changes for New HW
bna: Added Defines for Multi TXQ Support
bna: Mboxq Flush When Ioc Disabled
bna: Move FW Init to HW Init and Disable Hang Unmapped Fix
bna: Ethfn LPU DMA Read Fix
bna: IOC Event Name Change
bna: Add New IOC event
bna: Add Sub-System Device ID Info
bna: Add HW Semaphore Unlock Logic
bna: Configuration changes
bna: TxRx Coalesce Settings Fix and Reorg PCI Probe Failure
bna: Device Init Fix
bna: Add Multiple Tx Queue Support
bna: Change TxQ Select Logic and Interrupt Handling
bna: Data Path and API Changes
bna: Adpater and Port Mode Settings
bna: HW Error Counter Fix
bna: RX Path Changes
bna: Add IOC MBOX Call Back to Client
bna: Ethtool Ring Param Set changes and Add Stats Attr
bna: PLL Init Fix and Add Stats Attributes
bna: Dropped BUG_ONs and Rx id init fix
bna: Header File and Unused Code Cleanup
bna: Driver Version changed to 3.0.2.0
drivers/net/bna/Makefile | 5 +- drivers/net/bna/bfa_cee.c | 70 +- drivers/net/bna/bfa_cee.h | 3 +- drivers/net/bna/bfa_cs.h | 148 ++ drivers/net/bna/bfa_defs.h | 77 +- drivers/net/bna/bfa_defs_cna.h | 8 +- drivers/net/bna/bfa_defs_mfg_comm.h | 93 +- drivers/net/bna/bfa_defs_status.h | 143 +- drivers/net/bna/bfa_ioc.c | 712 ++++-- drivers/net/bna/bfa_ioc.h | 106 +- drivers/net/bna/bfa_ioc_ct.c | 498 ++++- drivers/net/bna/bfa_msgq.c | 669 ++++++ drivers/net/bna/bfa_msgq.h | 130 + drivers/net/bna/bfi.h | 280 ++- drivers/net/bna/bfi_ctreg.h | 646 ----- drivers/net/bna/bfi_enet.h | 902 +++++++ drivers/net/bna/bfi_ll.h | 438 ---- drivers/net/bna/bfi_reg.h | 452 ++++ drivers/net/bna/bna.h | 456 +++-- drivers/net/bna/bna_ctrl.c | 3077 ------------------------ drivers/net/bna/bna_enet.c | 2202 +++++++++++++++++ drivers/net/bna/bna_hw.h | 1516 ++---------- drivers/net/bna/bna_txrx.c | 4417 +++++++++++++++++------------------ drivers/net/bna/bna_types.h | 696 +++---- drivers/net/bna/bnad.c | 1249 ++++++---- drivers/net/bna/bnad.h | 157 +- drivers/net/bna/bnad_ethtool.c | 481 +--- drivers/net/bna/cna.h | 44 +- include/linux/pci_ids.h | 1 + 29 files changed, 9824 insertions(+), 9852 deletions(-) create mode 100644 drivers/net/bna/bfa_cs.h create mode 100644 drivers/net/bna/bfa_msgq.c create mode 100644 drivers/net/bna/bfa_msgq.h delete mode 100644 drivers/net/bna/bfi_ctreg.h create mode 100644 drivers/net/bna/bfi_enet.h delete mode 100644 drivers/net/bna/bfi_ll.h create mode 100644 drivers/net/bna/bfi_reg.h delete mode 100644 drivers/net/bna/bna_ctrl.c create mode 100644 drivers/net/bna/bna_enet.c
PATCH 1/45 bna: Checkpatch Cleanup
Driver cleanup as per new check patch v0.31
--- drivers/net/bna/bfa_cs.h | 148 +++++++++++++++++++++++++++++++++++ drivers/net/bna/bfa_defs.h | 4 +- drivers/net/bna/bfa_defs_mfg_comm.h | 20 +++--- drivers/net/bna/bfa_defs_status.h | 134 ++++++++++++++++---------------- drivers/net/bna/bfa_ioc.c | 2 +- drivers/net/bna/bfa_ioc.h | 16 ++-- drivers/net/bna/bfi.h | 14 ++-- drivers/net/bna/bna.h | 16 ++-- drivers/net/bna/bna_hw.h | 92 +++++++++++----------- drivers/net/bna/bna_txrx.c | 4 +- drivers/net/bna/bna_types.h | 58 +++++++------- drivers/net/bna/bnad.c | 42 +++++----- drivers/net/bna/bnad.h | 24 +++--- drivers/net/bna/bnad_ethtool.c | 2 +- 14 files changed, 362 insertions(+), 214 deletions(-) create mode 100644 drivers/net/bna/bfa_cs.h
drivers/net/bna/bfa_cs.h new file +148 -0
@@ -0,0 +1,148 @@ +/* +* Linux network driver for Brocade Converged Network Adapter. +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License (GPL) Version 2 as +* published by the Free Software Foundation +* +* This program is distributed in the hope that it will be useful, but +* WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* General Public License for more details. +*/ +/* +* Copyright (c) 2005-2010 Brocade Communications Systems, Inc. +* All rights reserved +* www.brocade.com +*/ + +/** +* @file bfa_cs.h BFA common services +*/ + +#ifndef __BFA_CS_H__ +#define __BFA_CS_H__ + +#include "cna.h" + +#define bfa_assert (__cond) do { \ + if (!(__cond)) \ + pr_err("Assertion failure: %s:%d: %d", \ + __FILE__, __LINE__, __cond); \ +} while (0) + +#define bfa_assert_fp (__cond) bfa_assert(__cond) + +/** +* @ BFA state machine interfaces +*/ + +typedef void (*bfa_sm_t )(void *sm,int event); + +/** +* oc - object class eg. bfa_ioc +* st - state, eg. reset +* otype - object type, eg. struct bfa_ioc +* etype - object type, eg. enum ioc_event +*/ +#define bfa_sm_state_decl (oc, st, otype, etype) \ + static void oc ## _sm_ ## st(otype * fsm, etype event) + +#define bfa_sm_set_state (_sm, _state) ((_sm)->sm = (bfa_sm_t)(_state)) +#define bfa_sm_send_event (_sm, _event) ((_sm)->sm((_sm), (_event))) +#define bfa_sm_get_state (_sm) ((_sm)->sm) +#define bfa_sm_cmp_state (_sm, _state) ((_sm)->sm == (bfa_sm_t)(_state)) + +/** +* For converting from state machine function to state encoding. +*/ +struct bfa_sm_table { +bfa_sm_t sm;/*!< state machine function */ +int state;/*!< state machine encoding */ +char *name;/*!< state name for display */ +}; +#define BFA_SM (_sm) ((bfa_sm_t)(_sm)) + +/** +* State machine with entry actions. +*/ +typedef void (*bfa_fsm_t )(void *fsm,int event); + +/** +* oc - object class eg. bfa_ioc +* st - state, eg. reset +* otype - object type, eg. struct bfa_ioc +* etype - object type, eg. enum ioc_event +*/ +#define bfa_fsm_state_decl (oc, st, otype, etype) \ + static void oc ## _sm_ ## st(otype * fsm, etype event); \ + static void oc ## _sm_ ## st ## _entry(otype * fsm) + +#define bfa_fsm_set_state (_fsm, _state) do { \ + (_fsm)->fsm = (bfa_fsm_t)(_state); \ + _state ## _entry(_fsm); \ +} while (0) + +#define bfa_fsm_send_event (_fsm, _event) ((_fsm)->fsm((_fsm), (_event))) +#define bfa_fsm_get_state (_fsm) ((_fsm)->fsm) +#define bfa_fsm_cmp_state (_fsm, _state) \ + ((_fsm)->fsm == (bfa_fsm_t)(_state)) + +static inline int +bfa_sm_to_state (struct bfa_sm_table *smt,bfa_sm_t sm) +{ +int i =0 ; + +while (smt[i].sm && smt[i].sm != sm) + i++; +return smt[i].state; +} + +/** +* @ Generic wait counter. +*/ + +typedef void (*bfa_wc_resume_t ) (void *cbarg); + +struct bfa_wc { +bfa_wc_resume_t wc_resume; +void *wc_cbarg; +int wc_count; +}; + +static inline void +bfa_wc_up (struct bfa_wc *wc) +{ + wc->wc_count++; +} + +static inline void +bfa_wc_down (struct bfa_wc *wc) +{ + wc->wc_count--; +if (wc->wc_count ==0 ) + wc->wc_resume (wc->wc_cbarg); +} + +/** +* Initialize a waiting counter. +*/ +static inline void +bfa_wc_init (struct bfa_wc *wc,bfa_wc_resume_t wc_resume,void *wc_cbarg) +{ + wc->wc_resume = wc_resume; + wc->wc_cbarg = wc_cbarg; + wc->wc_count =0 ; +bfa_wc_up (wc); +} + +/** +* Wait for counter to reach zero +*/ +static inline void +bfa_wc_wait (struct bfa_wc *wc) +{ +bfa_wc_down (wc); +} + +#endif /* __BFA_CS_H__ */
drivers/net/bna/bfa_defs.h +2 -2
@@ -80,7 +80,7 @@ struct bfa_adapter_attr {enum {BFA_IOC_DRIVER_LEN =16 , -BFA_IOC_CHIP_REV_LEN =8 , +BFA_IOC_CHIP_REV_LEN =8 , };/**
@@ -174,7 +174,7 @@ enum bfa_ioc_type {*/ struct bfa_ioc_attr {enum bfa_ioc_type ioc_type; -enum bfa_ioc_state state;/*!< IOC state */ +enum bfa_ioc_state state;/*!< IOC state */ struct bfa_adapter_attr adapter_attr;/*!< HBA attributes */ struct bfa_ioc_driver_attr driver_attr;/*!< driver attr */ struct bfa_ioc_pci_attr pci_attr;
drivers/net/bna/bfa_defs_mfg_comm.h +10 -10
@@ -192,14 +192,14 @@ do { \* VPD vendor tag */ enum { -BFA_MFG_VPD_UNKNOWN =0 ,/*!< vendor unknown */ -BFA_MFG_VPD_IBM =1 ,/*!< vendor IBM */ -BFA_MFG_VPD_HP =2 ,/*!< vendor HP */ -BFA_MFG_VPD_DELL =3 ,/*!< vendor DELL */ -BFA_MFG_VPD_PCI_IBM =0x08 ,/*!< PCI VPD IBM */ -BFA_MFG_VPD_PCI_HP =0x10 ,/*!< PCI VPD HP */ -BFA_MFG_VPD_PCI_DELL =0x20 ,/*!< PCI VPD DELL */ -BFA_MFG_VPD_PCI_BRCD =0xf8 ,/*!< PCI VPD Brocade */ +BFA_MFG_VPD_UNKNOWN =0 ,/*!< vendor unknown */ +BFA_MFG_VPD_IBM =1 ,/*!< vendor IBM */ +BFA_MFG_VPD_HP =2 ,/*!< vendor HP */ +BFA_MFG_VPD_DELL =3 ,/*!< vendor DELL */ +BFA_MFG_VPD_PCI_IBM =0x08 ,/*!< PCI VPD IBM */ +BFA_MFG_VPD_PCI_HP =0x10 ,/*!< PCI VPD HP */ +BFA_MFG_VPD_PCI_DELL =0x20 ,/*!< PCI VPD DELL */ +BFA_MFG_VPD_PCI_BRCD =0xf8 ,/*!< PCI VPD Brocade */ };/**
@@ -212,8 +212,8 @@ struct bfa_mfg_vpd {u8 vpd_sig[3 ];/*!< characters 'V', 'P', 'D' */ u8 chksum;/*!< u8 checksum */ u8 vendor;/*!< vendor */ -u8 len;/*!< vpd data length excluding header */ -u8 rsv; +u8 len;/*!< vpd data length excluding header */ +u8 rsv;u8 data[BFA_MFG_VPD_LEN ];/*!< vpd data */ };
drivers/net/bna/bfa_defs_status.h +67 -67
177 lines not on this page · raw message
drivers/net/bna/bfa_ioc.c +1 -1
@@ -156,7 +156,7 @@ enum iocpf_event {IOCPF_E_ENABLE =1 ,/*!< IOCPF enable request */ IOCPF_E_DISABLE =2 ,/*!< IOCPF disable request */ IOCPF_E_STOP =3 ,/*!< stop on driver detach */ -IOCPF_E_FWREADY =4 ,/*!< f/w initialization done */ +IOCPF_E_FWREADY =4 ,/*!< f/w initialization done */ IOCPF_E_FWRSP_ENABLE =5 ,/*!< enable f/w response */ IOCPF_E_FWRSP_DISABLE =6 ,/*!< disable f/w response */ IOCPF_E_FAIL = 7, /*!< failure notice by ioc sm */
drivers/net/bna/bfa_ioc.h +8 -8
@@ -155,11 +155,11 @@ struct bfa_iocpf {struct bfa_ioc {bfa_fsm_t fsm; -struct bfa *bfa; -struct bfa_pcidev pcidev; -struct timer_list ioc_timer; -struct timer_list iocpf_timer; -struct timer_list sem_timer; +struct bfa *bfa; +struct bfa_pcidev pcidev; +struct timer_list ioc_timer; +struct timer_list iocpf_timer; +struct timer_list sem_timer;struct timer_list hb_timer;u32 hb_count;struct list_head hb_notify_q;
@@ -167,13 +167,13 @@ struct bfa_ioc {int dbg_fwsave_len;bool dbg_fwsave_once;enum bfi_mclass ioc_mc; -struct bfa_ioc_regs ioc_regs; +struct bfa_ioc_regs ioc_regs;struct bfa_ioc_drv_stats stats;bool fcmode;bool ctdev;bool cna;bool pllinit; -bool stats_busy;/*!< outstanding stats */ +bool stats_busy;/*!< outstanding stats */ u8 port_id;struct bfa_dma attr_dma;
@@ -219,7 +219,7 @@ struct bfa_ioc_hwif {#define bfa_ioc_stats (_ioc, _stats) ((_ioc)->stats._stats++)#define BFA_IOC_FWIMG_MINSZ (16 * 1024)#define BFA_IOC_FWIMG_TYPE (__ioc) \ - (((__ioc)->ctdev) ? \ + (((__ioc)->ctdev) ? \ (((__ioc)->fcmode) ? BFI_IMAGE_CT_FC : BFI_IMAGE_CT_CNA) : \ BFI_IMAGE_CB_FC)#define BFA_IOC_FW_SMEM_SIZE (__ioc) \
drivers/net/bna/bfi.h +7 -7
@@ -51,13 +51,13 @@ struct bfi_mhdr { };#define bfi_h2i_set (_mh, _mc, _op, _lpuid) do { \ - (_mh).msg_class = (_mc); \ + (_mh).msg_class = (_mc); \ (_mh).msg_id = (_op); \ (_mh).mtag.h2i.lpu_id = (_lpuid); \ } while (0)#define bfi_i2h_set (_mh, _mc, _op, _i2htok) do { \ - (_mh).msg_class = (_mc); \ + (_mh).msg_class = (_mc); \ (_mh).msg_id = (_op); \ (_mh).mtag.i2htok = (_i2htok); \ } while (0)
@@ -66,7 +66,7 @@ struct bfi_mhdr {* Message opcodes: 0-127 to firmware, 128-255 to host */ #define BFI_I2H_OPCODE_BASE 128 -#define BFA_I2HM (_x) ((_x) + BFI_I2H_OPCODE_BASE) +#define BFA_I2HM (_x) ((_x) + BFI_I2H_OPCODE_BASE)/** ****************************************************************************
@@ -186,7 +186,7 @@ enum bfi_mclass {#define BFI_BOOT_TYPE_OFF 8#define BFI_BOOT_LOADER_OFF 12 -#define BFI_BOOT_TYPE_NORMAL 0 +#define BFI_BOOT_TYPE_NORMAL 0#define BFI_BOOT_TYPE_FLASH 1#define BFI_BOOT_TYPE_MEMTEST 2
@@ -211,9 +211,9 @@ enum bfi_ioc_h2i_msgs {enum bfi_ioc_i2h_msgs {BFI_IOC_I2H_ENABLE_REPLY =BFA_I2HM (1 ), -BFI_IOC_I2H_DISABLE_REPLY =BFA_I2HM (2 ), -BFI_IOC_I2H_GETATTR_REPLY =BFA_I2HM (3 ), -BFI_IOC_I2H_READY_EVENT =BFA_I2HM (4 ), +BFI_IOC_I2H_DISABLE_REPLY =BFA_I2HM (2 ), +BFI_IOC_I2H_GETATTR_REPLY =BFA_I2HM (3 ), +BFI_IOC_I2H_READY_EVENT =BFA_I2HM (4 ),BFI_IOC_I2H_HBEAT =BFA_I2HM (5 ), };
drivers/net/bna/bna.h +8 -8
@@ -88,7 +88,7 @@ do { \ } while (0)#define containing_rec (addr, type, field) \ - ((type *)((unsigned char *)(addr) - \ + ((type *)((unsigned char *)(addr) - \ (unsigned char *)(&((type *)0)->field)))#define BNA_TXQ_WI_NEEDED (_vectors) (((_vectors) + 3) >> 2)
@@ -101,8 +101,8 @@ do { \ { \unsigned int page_index;/* index within a page */ \void *page_addr; \ - page_index = (_qe_idx) & (BNA_TXQ_PAGE_INDEX_MAX -1 ); \ - (_qe_ptr_range) = (BNA_TXQ_PAGE_INDEX_MAX - page_index); \ + page_index = (_qe_idx) & (BNA_TXQ_PAGE_INDEX_MAX -1 ); \ + (_qe_ptr_range) = (BNA_TXQ_PAGE_INDEX_MAX - page_index); \ page_addr = (_qpt_ptr)[((_qe_idx) >>BNA_TXQ_PAGE_INDEX_MAX_SHIFT )];\ (_qe_ptr) = &((struct bna_txq_entry *)(page_addr))[page_index]; \ }
@@ -166,25 +166,25 @@ do { \ (((_q_ptr)->q.producer_index + (_num)) & \ ((_q_ptr)->q.q_depth - 1)) -#define BNA_Q_CI_ADD (_q_ptr, _num) \ +#define BNA_Q_CI_ADD (_q_ptr, _num) \ (_q_ptr)->q.consumer_index = \ - (((_q_ptr)->q.consumer_index + (_num)) \ + (((_q_ptr)->q.consumer_index + (_num)) \ & ((_q_ptr)->q.q_depth - 1))#define BNA_Q_FREE_COUNT (_q_ptr) \ (BNA_QE_FREE_CNT(&((_q_ptr)->q), (_q_ptr)->q.q_depth)) -#define BNA_Q_IN_USE_COUNT (_q_ptr) \ +#define BNA_Q_IN_USE_COUNT (_q_ptr) \ (BNA_QE_IN_USE_CNT(&(_q_ptr)->q, (_q_ptr)->q.q_depth))/* These macros build the data portion of the TxQ/RxQ doorbell */ -#define BNA_DOORBELL_Q_PRD_IDX (_pi) (0x80000000 | (_pi)) +#define BNA_DOORBELL_Q_PRD_IDX (_pi) (0x80000000 | (_pi))#define BNA_DOORBELL_Q_STOP (0x40000000)/* These macros build the data portion of the IB doorbell */ #define BNA_DOORBELL_IB_INT_ACK (_timeout, _events) \ (0x80000000 | ((_timeout) << 16) | (_events)) -#define BNA_DOORBELL_IB_INT_DISABLE (0x40000000) +#define BNA_DOORBELL_IB_INT_DISABLE (0x40000000)/* Set the coalescing timer for the given ib */ #define bna_ib_coalescing_timer_set (_i_dbell, _cls_timer) \
drivers/net/bna/bna_hw.h +46 -46
188 lines not on this page · raw message
drivers/net/bna/bna_txrx.c +2 -2
@@ -734,7 +734,7 @@ bna_rxf_sm_cam_fltr_clr_wait_entry(struct bna_rxf *rxf)/** * Note: Do not add rxf_clear_packet_filter here. * It will overstep mbox when this transition happens: -* cam_fltr_mod_wait -> cam_fltr_clr_wait on RXF_E_STOP event +* cam_fltr_mod_wait -> cam_fltr_clr_wait on RXF_E_STOP event */ }
@@ -771,7 +771,7 @@ bna_rxf_sm_stop_wait_entry(struct bna_rxf *rxf)/** * NOTE: Do not add rxf_disable here. * It will overstep mbox when this transition happens: -* start_wait -> stop_wait on RXF_E_STOP event +* start_wait -> stop_wait on RXF_E_STOP event */ }
drivers/net/bna/bna_types.h +29 -29
149 lines not on this page · raw message
drivers/net/bna/bnad.c +21 -21
113 lines not on this page · raw message
drivers/net/bna/bnad.h +12 -12
@@ -69,8 +69,8 @@ struct bnad_rx_ctrl {#define BNAD_MAILBOX_MSIX_VECTORS 1 -#define BNAD_STATS_TIMER_FREQ 1000/* in msecs */ -#define BNAD_DIM_TIMER_FREQ 1000/* in msecs */ +#define BNAD_STATS_TIMER_FREQ 1000/* in msecs */ +#define BNAD_DIM_TIMER_FREQ 1000/* in msecs */ #define BNAD_MAX_Q_DEPTH 0x10000#define BNAD_MIN_Q_DEPTH 0x200
@@ -101,12 +101,12 @@ enum bnad_intr_source {enum bnad_link_state {BNAD_LS_DOWN =0 , -BNAD_LS_UP =1 +BNAD_LS_UP =1 };struct bnad_completion { -struct completion ioc_comp; -struct completion ucast_comp; +struct completion ioc_comp; +struct completion ucast_comp;struct completion mcast_comp;struct completion tx_comp;struct completion rx_comp;
@@ -124,7 +124,7 @@ struct bnad_completion {/* Tx Rx Control Stats */ struct bnad_drv_stats { -u64 netif_queue_stop; +u64 netif_queue_stop;u64 netif_queue_wakeup;u64 netif_queue_stopped;u64 tso4;
@@ -187,7 +187,7 @@ struct bnad_skb_unmap {struct bnad_unmap_q {u32 producer_index;u32 consumer_index; -u32 q_depth; +u32 q_depth;/* This should be the last one */ struct bnad_skb_unmap unmap_array[1 ]; };
@@ -210,7 +210,7 @@ struct bnad_unmap_q {#define BNAD_RF_RX_SHUTDOWN_DELAYED 7struct bnad { -struct net_device *netdev; +struct net_device *netdev;/* Data path */ struct bnad_tx_info tx_info[BNAD_MAX_TXS ];
@@ -244,7 +244,7 @@ struct bnad {u32 cfg_flags;unsigned long run_flags; -struct pci_dev *pcidev; +struct pci_dev *pcidev;u64 mmio_start;u64 mmio_len;
@@ -277,7 +277,7 @@ struct bnad {struct bnad_diag *diag;char adapter_name[BNAD_NAME_LEN ]; -char port_name[BNAD_NAME_LEN ]; +char port_name[BNAD_NAME_LEN ];char mbox_irq_name[BNAD_NAME_LEN ]; };
@@ -285,7 +285,7 @@ struct bnad {* EXTERN VARIABLES */ extern struct firmware *bfi_fw; -extern u32 bnad_rxqs_per_cq; +extern u32 bnad_rxqs_per_cq;/* * EXTERN PROTOTYPES
@@ -331,7 +331,7 @@ extern void bnad_netdev_hwstats_fill(struct bnad *bnad, }#define bnad_dim_timer_running (_bnad) \ - (((_bnad)->cfg_flags & BNAD_CF_DIM_ENABLED) && \ + (((_bnad)->cfg_flags & BNAD_CF_DIM_ENABLED) && \ (test_bit(BNAD_RF_DIM_TIMER_RUNNING, &((_bnad)->run_flags))))#endif /* __BNAD_H__ */
drivers/net/bna/bnad_ethtool.c +1 -1
@@ -295,7 +295,7 @@ get_regs(struct bnad *bnad, u32 * regs)u32 reg_addr;unsigned long flags; -#define BNAD_GET_REG (addr) \ +#define BNAD_GET_REG (addr) \ do { \ if (regs) \ regs[num++] = readl(bnad->bar0 + (addr)); \
Signature · 1 line
1.7.1
PATCH 2/45 bna: Update ASIC Register Definition to Support New Hardware
In reply to Rasesh ModyChange details:
- Introducing new file bfi_reg.h for new hardware registers. This file will completely replace bfi_ctreg.h in a later patch.
--- drivers/net/bna/bfa_ioc_ct.c | 78 ++++---- drivers/net/bna/bfi_reg.h | 452 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 492 insertions(+), 38 deletions(-) create mode 100644 drivers/net/bna/bfi_reg.h
drivers/net/bna/bfa_ioc_ct.c +40 -38
@@ -19,7 +19,7 @@#include "bfa_ioc.h" #include "cna.h" #include "bfi.h" -#include "bfi_ctreg.h" +#include "bfi_reg.h" #include "bfa_defs.h" #define bfa_ioc_ct_sync_pos (__ioc) \
@@ -178,7 +178,7 @@ bfa_ioc_ct_notify_fail(struct bfa_ioc *ioc)readl (ioc->ioc_regs.ll_halt);readl (ioc->ioc_regs.alt_ll_halt); }else { -writel (__PSS_ERR_STATUS_SET, ioc->ioc_regs.err_set); +writel (~0U , ioc->ioc_regs.err_set);readl (ioc->ioc_regs.err_set); } }
@@ -196,21 +196,21 @@ static struct { u32 hfn_mbox, lpu_mbox, hfn_pgn; } iocreg_fnreg[] = {/** * Host <-> LPU mailbox command/status registers - port 0 */ -static struct {u32 hfn, lpu; } iocreg_mbcmd_p0[] = { - {HOSTFN0_LPU0_MBOX0_CMD_STAT ,LPU0_HOSTFN0_MBOX0_CMD_STAT }, - {HOSTFN1_LPU0_MBOX0_CMD_STAT ,LPU0_HOSTFN1_MBOX0_CMD_STAT }, - {HOSTFN2_LPU0_MBOX0_CMD_STAT ,LPU0_HOSTFN2_MBOX0_CMD_STAT }, - {HOSTFN3_LPU0_MBOX0_CMD_STAT ,LPU0_HOSTFN3_MBOX0_CMD_STAT } +static struct {u32 hfn, lpu; } ct_p0reg[] = { + {HOSTFN0_LPU0_CMD_STAT ,LPU0_HOSTFN0_CMD_STAT }, + {HOSTFN1_LPU0_CMD_STAT ,LPU0_HOSTFN1_CMD_STAT }, + {HOSTFN2_LPU0_CMD_STAT ,LPU0_HOSTFN2_CMD_STAT }, + {HOSTFN3_LPU0_CMD_STAT ,LPU0_HOSTFN3_CMD_STAT } };/** * Host <-> LPU mailbox command/status registers - port 1 */ -static struct {u32 hfn, lpu; } iocreg_mbcmd_p1[] = { - {HOSTFN0_LPU1_MBOX0_CMD_STAT ,LPU1_HOSTFN0_MBOX0_CMD_STAT }, - {HOSTFN1_LPU1_MBOX0_CMD_STAT ,LPU1_HOSTFN1_MBOX0_CMD_STAT }, - {HOSTFN2_LPU1_MBOX0_CMD_STAT ,LPU1_HOSTFN2_MBOX0_CMD_STAT }, - {HOSTFN3_LPU1_MBOX0_CMD_STAT ,LPU1_HOSTFN3_MBOX0_CMD_STAT } +static struct {u32 hfn, lpu; } ct_p1reg[] = { + {HOSTFN0_LPU1_CMD_STAT ,LPU1_HOSTFN0_CMD_STAT }, + {HOSTFN1_LPU1_CMD_STAT ,LPU1_HOSTFN1_CMD_STAT }, + {HOSTFN2_LPU1_CMD_STAT ,LPU1_HOSTFN2_CMD_STAT }, + {HOSTFN3_LPU1_CMD_STAT ,LPU1_HOSTFN3_CMD_STAT } }; static void
@@ -229,16 +229,16 @@ bfa_ioc_ct_reg_init(struct bfa_ioc *ioc) ioc->ioc_regs.heartbeat = rb +BFA_IOC0_HBEAT_REG ; ioc->ioc_regs.ioc_fwstate = rb +BFA_IOC0_STATE_REG ; ioc->ioc_regs.alt_ioc_fwstate = rb +BFA_IOC1_STATE_REG ; - ioc->ioc_regs.hfn_mbox_cmd = rb + iocreg_mbcmd_p0[pcifn].hfn; - ioc->ioc_regs.lpu_mbox_cmd = rb + iocreg_mbcmd_p0[pcifn].lpu; + ioc->ioc_regs.hfn_mbox_cmd = rb + ct_p0reg[pcifn].hfn; + ioc->ioc_regs.lpu_mbox_cmd = rb + ct_p0reg[pcifn].lpu; ioc->ioc_regs.ll_halt = rb +FW_INIT_HALT_P0 ; ioc->ioc_regs.alt_ll_halt = rb +FW_INIT_HALT_P1 ; }else { ioc->ioc_regs.heartbeat = (rb +BFA_IOC1_HBEAT_REG ); ioc->ioc_regs.ioc_fwstate = (rb +BFA_IOC1_STATE_REG ); ioc->ioc_regs.alt_ioc_fwstate = rb +BFA_IOC0_STATE_REG ; - ioc->ioc_regs.hfn_mbox_cmd = rb + iocreg_mbcmd_p1[pcifn].hfn; - ioc->ioc_regs.lpu_mbox_cmd = rb + iocreg_mbcmd_p1[pcifn].lpu; + ioc->ioc_regs.hfn_mbox_cmd = rb + ct_p1reg[pcifn].hfn; + ioc->ioc_regs.lpu_mbox_cmd = rb + ct_p1reg[pcifn].lpu; ioc->ioc_regs.ll_halt = rb +FW_INIT_HALT_P1 ; ioc->ioc_regs.alt_ll_halt = rb +FW_INIT_HALT_P0 ; }
@@ -248,8 +248,8 @@ bfa_ioc_ct_reg_init(struct bfa_ioc *ioc)*/ ioc->ioc_regs.pss_ctl_reg = (rb +PSS_CTL_REG ); ioc->ioc_regs.pss_err_status_reg = (rb +PSS_ERR_STATUS_REG ); - ioc->ioc_regs.app_pll_fast_ctl_reg = (rb +APP_PLL_425_CTL_REG ); - ioc->ioc_regs.app_pll_slow_ctl_reg = (rb +APP_PLL_312_CTL_REG ); + ioc->ioc_regs.app_pll_fast_ctl_reg = (rb +APP_PLL_LCLK_CTL_REG ); + ioc->ioc_regs.app_pll_slow_ctl_reg = (rb +APP_PLL_SCLK_CTL_REG );/* * IOC semaphore registers and serialization
@@ -446,14 +446,15 @@ bfa_ioc_ct_pll_init(void __iomem *rb, bool fcmode) {u32 pll_sclk, pll_fclk, r32; - pll_sclk = __APP_PLL_312_LRESETN | __APP_PLL_312_ENARST | - __APP_PLL_312_RSEL200500 |__APP_PLL_312_P0_1 (3U ) | -__APP_PLL_312_JITLMT0_1 (3U ) | -__APP_PLL_312_CNTLMT0_1 (1U ); - pll_fclk = __APP_PLL_425_LRESETN | __APP_PLL_425_ENARST | - __APP_PLL_425_RSEL200500 |__APP_PLL_425_P0_1 (3U ) | -__APP_PLL_425_JITLMT0_1 (3U ) | -__APP_PLL_425_CNTLMT0_1 (1U ); + pll_sclk = __APP_PLL_SCLK_LRESETN | __APP_PLL_SCLK_ENARST | + __APP_PLL_SCLK_RSEL200500 |__APP_PLL_SCLK_P0_1 (3U ) | +__APP_PLL_SCLK_JITLMT0_1 (3U ) | +__APP_PLL_SCLK_CNTLMT0_1 (1U ); + pll_fclk = __APP_PLL_LCLK_LRESETN | __APP_PLL_LCLK_ENARST | + __APP_PLL_LCLK_RSEL200500 |__APP_PLL_LCLK_P0_1 (3U ) | +__APP_PLL_LCLK_JITLMT0_1 (3U ) | +__APP_PLL_LCLK_CNTLMT0_1 (1U ); +if (fcmode) {writel (0 , (rb +OP_MODE )); writel(__APP_EMS_CMLCKSEL |
@@ -474,27 +475,28 @@ bfa_ioc_ct_pll_init(void __iomem *rb, bool fcmode)writel (0xffffffffU , (rb +HOSTFN0_INT_MSK ));writel (0xffffffffU , (rb +HOSTFN1_INT_MSK ));writel (pll_sclk | - __APP_PLL_312_LOGIC_SOFT_RESET, - rb +APP_PLL_312_CTL_REG ); + __APP_PLL_SCLK_LOGIC_SOFT_RESET, + rb +APP_PLL_SCLK_CTL_REG );writel (pll_fclk | - __APP_PLL_425_LOGIC_SOFT_RESET, - rb +APP_PLL_425_CTL_REG ); + __APP_PLL_LCLK_LOGIC_SOFT_RESET, + rb +APP_PLL_LCLK_CTL_REG );writel (pll_sclk | - __APP_PLL_312_LOGIC_SOFT_RESET | __APP_PLL_312_ENABLE, - rb +APP_PLL_312_CTL_REG ); + __APP_PLL_SCLK_LOGIC_SOFT_RESET | __APP_PLL_SCLK_ENABLE, + rb +APP_PLL_SCLK_CTL_REG );writel (pll_fclk | - __APP_PLL_425_LOGIC_SOFT_RESET | __APP_PLL_425_ENABLE, - rb +APP_PLL_425_CTL_REG ); + __APP_PLL_LCLK_LOGIC_SOFT_RESET | __APP_PLL_LCLK_ENABLE, + rb +APP_PLL_LCLK_CTL_REG );readl (rb +HOSTFN0_INT_MSK );udelay (2000 );writel (0xffffffffU , (rb +HOSTFN0_INT_STATUS ));writel (0xffffffffU , (rb +HOSTFN1_INT_STATUS ));writel (pll_sclk | - __APP_PLL_312_ENABLE, - rb +APP_PLL_312_CTL_REG ); + __APP_PLL_SCLK_ENABLE, + rb +APP_PLL_SCLK_CTL_REG );writel (pll_fclk | - __APP_PLL_425_ENABLE, - rb +APP_PLL_425_CTL_REG ); + __APP_PLL_LCLK_ENABLE, + rb +APP_PLL_LCLK_CTL_REG ); +if (!fcmode) {writel (__PMM_1T_RESET_P, (rb +PMM_1T_RESET_REG_P0 ));writel (__PMM_1T_RESET_P, (rb +PMM_1T_RESET_REG_P1 ));
drivers/net/bna/bfi_reg.h new file +452 -0
452 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH 3/45 bna: Change IOC Event Notification Call Back Mechanism
In reply to Rasesh ModyChange details:
- A generic event notification callback mechanism that receives IOC enable, disable, failed events and notifies the registered modules of these events.
--- drivers/net/bna/bfa_cee.c | 65 +++++++++++++++++++++++++++------------------ drivers/net/bna/bfa_cee.h | 3 +- drivers/net/bna/bfa_ioc.c | 54 +++++++++++++++++++++++-------------- drivers/net/bna/bfa_ioc.h | 31 ++++++++++++++++++--- 4 files changed, 99 insertions(+), 54 deletions(-)
drivers/net/bna/bfa_cee.c +39 -26
@@ -223,44 +223,56 @@ bfa_cee_isr(void *cbarg, struct bfi_mbmsg *m) }/** -* bfa_cee_hbfail() +* bfa_cee_notify() * * @brief CEE module heart-beat failure handler. +* @brief CEE module IOC event handler. * -* @param[in] Pointer to the CEE module data structure. +* @param[in] IOC event type * * @return void */ static void -bfa_cee_hbfail (void *arg) +bfa_cee_notify (void *arg,enum bfa_ioc_event event) {struct bfa_cee *cee; - cee = arg; + cee = (struct bfa_cee *) arg; -if (cee->get_attr_pending == true) { - cee->get_attr_status =BFA_STATUS_FAILED ; - cee->get_attr_pending = false; -if (cee->cbfn.get_attr_cbfn) { - cee->cbfn.get_attr_cbfn (cee->cbfn.get_attr_cbarg, -BFA_STATUS_FAILED ); +switch (event) { +case BFA_IOC_E_DISABLED : +case BFA_IOC_E_FAILED : +if (cee->get_attr_pending == true) { + cee->get_attr_status =BFA_STATUS_FAILED ; + cee->get_attr_pending = false; +if (cee->cbfn.get_attr_cbfn) { + cee->cbfn.get_attr_cbfn ( + cee->cbfn.get_attr_cbarg, +BFA_STATUS_FAILED ); + } } - } -if (cee->get_stats_pending == true) { - cee->get_stats_status =BFA_STATUS_FAILED ; - cee->get_stats_pending = false; -if (cee->cbfn.get_stats_cbfn) { - cee->cbfn.get_stats_cbfn (cee->cbfn.get_stats_cbarg, -BFA_STATUS_FAILED ); +if (cee->get_stats_pending == true) { + cee->get_stats_status =BFA_STATUS_FAILED ; + cee->get_stats_pending = false; +if (cee->cbfn.get_stats_cbfn) { + cee->cbfn.get_stats_cbfn ( + cee->cbfn.get_stats_cbarg, +BFA_STATUS_FAILED ); + } } - } -if (cee->reset_stats_pending == true) { - cee->reset_stats_status =BFA_STATUS_FAILED ; - cee->reset_stats_pending = false; -if (cee->cbfn.reset_stats_cbfn) { - cee->cbfn.reset_stats_cbfn (cee->cbfn.reset_stats_cbarg, -BFA_STATUS_FAILED ); +if (cee->reset_stats_pending == true) { + cee->reset_stats_status =BFA_STATUS_FAILED ; + cee->reset_stats_pending = false; +if (cee->cbfn.reset_stats_cbfn) { + cee->cbfn.reset_stats_cbfn ( + cee->cbfn.reset_stats_cbarg, +BFA_STATUS_FAILED ); + } } +break ; + +default : +break ; } }
@@ -286,6 +298,7 @@ bfa_nw_cee_attach(struct bfa_cee *cee, struct bfa_ioc *ioc, cee->ioc = ioc;bfa_nw_ioc_mbox_regisr (cee->ioc,BFI_MC_CEE , bfa_cee_isr, cee); -bfa_ioc_hbfail_init (&cee->hbfail, bfa_cee_hbfail, cee); -bfa_nw_ioc_hbfail_register (cee->ioc, &cee->hbfail); +bfa_q_qe_init (&cee->ioc_notify); +bfa_ioc_notify_init (&cee->ioc_notify, bfa_cee_notify, cee); +bfa_nw_ioc_notify_register (cee->ioc, &cee->ioc_notify); }
drivers/net/bna/bfa_cee.h +1 -2
@@ -25,7 +25,6 @@typedef void (*bfa_cee_get_attr_cbfn_t ) (void *dev,enum bfa_status status);typedef void (*bfa_cee_get_stats_cbfn_t ) (void *dev,enum bfa_status status);typedef void (*bfa_cee_reset_stats_cbfn_t ) (void *dev,enum bfa_status status); -typedef void (*bfa_cee_hbfail_cbfn_t ) (void *dev,enum bfa_status status);struct bfa_cee_cbfn {bfa_cee_get_attr_cbfn_t get_attr_cbfn;
@@ -45,7 +44,7 @@ struct bfa_cee {enum bfa_status get_stats_status;enum bfa_status reset_stats_status;struct bfa_cee_cbfn cbfn; -struct bfa_ioc_hbfail_notify hbfail; +struct bfa_ioc_notify ioc_notify;struct bfa_cee_attr *attr;struct bfa_cee_stats *stats;struct bfa_dma attr_dma;
drivers/net/bna/bfa_ioc.c +33 -21
106 lines not on this page · raw message
drivers/net/bna/bfa_ioc.h +26 -5
@@ -97,9 +97,12 @@ struct bfa_ioc_regs {/** * IOC Mailbox structures */ +typedef void (*bfa_mbox_cmd_cbfn_t )(void *cbarg);struct bfa_mbox_cmd {struct list_head qe; -u32 msg[BFI_IOC_MSGSZ ]; +bfa_mbox_cmd_cbfn_t cbfn; +void *cbarg; +u32 msg[BFI_IOC_MSGSZ ]; };/**
@@ -130,6 +133,23 @@ struct bfa_ioc_cbfn { };/** +* IOC event notification mechanism. +*/ +enum bfa_ioc_event { +BFA_IOC_E_ENABLED =1 , +BFA_IOC_E_DISABLED =2 , +BFA_IOC_E_FAILED =3 , +}; + +typedef void (*bfa_ioc_notify_cbfn_t )(void *,enum bfa_ioc_event ); + +struct bfa_ioc_notify { +struct list_head qe; +bfa_ioc_notify_cbfn_t cbfn; +void *cbarg; +}; + +/** * Heartbeat failure notification queue element. */ struct bfa_ioc_hbfail_notify {
@@ -141,7 +161,7 @@ struct bfa_ioc_hbfail_notify {/** * Initialize a heartbeat failure notification structure */ -#define bfa_ioc_hbfail_init (__notify, __cbfn, __cbarg) do { \ +#define bfa_ioc_notify_init (__notify, __cbfn, __cbarg) do { \ (__notify)->cbfn = (__cbfn); \ (__notify)->cbarg = (__cbarg); \ } while (0)
@@ -162,7 +182,7 @@ struct bfa_ioc {struct timer_list sem_timer;struct timer_list hb_timer;u32 hb_count; -struct list_head hb_notify_q; +struct list_head notify_q;void *dbg_fwsave;int dbg_fwsave_len;bool dbg_fwsave_once;
@@ -263,9 +283,10 @@ void bfa_nw_ioc_enable(struct bfa_ioc *ioc);void bfa_nw_ioc_disable (struct bfa_ioc *ioc);void bfa_nw_ioc_error_isr (struct bfa_ioc *ioc); +bool bfa_nw_ioc_is_disabled (struct bfa_ioc *ioc);void bfa_nw_ioc_get_attr (struct bfa_ioc *ioc,struct bfa_ioc_attr *ioc_attr); -void bfa_nw_ioc_hbfail_register (struct bfa_ioc *ioc, -struct bfa_ioc_hbfail_notify *notify); +void bfa_nw_ioc_notify_register (struct bfa_ioc *ioc, +struct bfa_ioc_notify *notify);bool bfa_nw_ioc_sem_get (void __iomem *sem_reg);void bfa_nw_ioc_sem_release (void __iomem *sem_reg);void bfa_nw_ioc_hw_sem_release (struct bfa_ioc *ioc);
Signature · 1 line
1.7.1
PATCH 4/45 bna: State Machine Fault Handling Cleanup
In reply to Rasesh ModyChnage details:
- The module name is not used in case of state machine fault, hence no longer passing the module name to the fault handler.
--- drivers/net/bna/bfa_ioc.c | 46 ++++++++++++++++++++++---------------------- drivers/net/bna/bna_ctrl.c | 42 ++++++++++++++++++++-------------------- drivers/net/bna/bna_txrx.c | 38 ++++++++++++++++++------------------ drivers/net/bna/cna.h | 2 +- 4 files changed, 64 insertions(+), 64 deletions(-)
drivers/net/bna/bfa_ioc.c +23 -23
@@ -240,7 +240,7 @@ bfa_ioc_sm_uninit(struct bfa_ioc *ioc, enum ioc_event event)break ;default : -bfa_sm_fault (ioc, event); +bfa_sm_fault (event); } }
@@ -273,7 +273,7 @@ bfa_ioc_sm_reset(struct bfa_ioc *ioc, enum ioc_event event)break ;default : -bfa_sm_fault (ioc, event); +bfa_sm_fault (event); } }
@@ -317,7 +317,7 @@ bfa_ioc_sm_enabling(struct bfa_ioc *ioc, enum ioc_event event)break ;default : -bfa_sm_fault (ioc, event); +bfa_sm_fault (event); } }
@@ -365,7 +365,7 @@ bfa_ioc_sm_getattr(struct bfa_ioc *ioc, enum ioc_event event)break ;default : -bfa_sm_fault (ioc, event); +bfa_sm_fault (event); } }
@@ -404,7 +404,7 @@ bfa_ioc_sm_op(struct bfa_ioc *ioc, enum ioc_event event)break ;default : -bfa_sm_fault (ioc, event); +bfa_sm_fault (event); } }
@@ -435,7 +435,7 @@ bfa_ioc_sm_disabling(struct bfa_ioc *ioc, enum ioc_event event)break ;default : -bfa_sm_fault (ioc, event); +bfa_sm_fault (event); } }
@@ -466,7 +466,7 @@ bfa_ioc_sm_disabled(struct bfa_ioc *ioc, enum ioc_event event)break ;default : -bfa_sm_fault (ioc, event); +bfa_sm_fault (event); } }
@@ -513,7 +513,7 @@ bfa_ioc_sm_fail_retry(struct bfa_ioc *ioc, enum ioc_event event)break ;default : -bfa_sm_fault (ioc, event); +bfa_sm_fault (event); } }
@@ -547,7 +547,7 @@ bfa_ioc_sm_fail(struct bfa_ioc *ioc, enum ioc_event event)break ;default : -bfa_sm_fault (ioc, event); +bfa_sm_fault (event); } }
@@ -580,7 +580,7 @@ bfa_iocpf_sm_reset(struct bfa_iocpf *iocpf, enum iocpf_event event)break ;default : -bfa_sm_fault (iocpf->ioc, event); +bfa_sm_fault (event); } }
@@ -632,7 +632,7 @@ bfa_iocpf_sm_fwcheck(struct bfa_iocpf *iocpf, enum iocpf_event event)break ;default : -bfa_sm_fault (ioc, event); +bfa_sm_fault (event); } }
@@ -676,7 +676,7 @@ bfa_iocpf_sm_mismatch(struct bfa_iocpf *iocpf, enum iocpf_event event)break ;default : -bfa_sm_fault (ioc, event); +bfa_sm_fault (event); } }
@@ -715,7 +715,7 @@ bfa_iocpf_sm_semwait(struct bfa_iocpf *iocpf, enum iocpf_event event)break ;default : -bfa_sm_fault (ioc, event); +bfa_sm_fault (event); } }
@@ -763,7 +763,7 @@ bfa_iocpf_sm_hwinit(struct bfa_iocpf *iocpf, enum iocpf_event event)break ;default : -bfa_sm_fault (ioc, event); +bfa_sm_fault (event); } }
@@ -814,7 +814,7 @@ bfa_iocpf_sm_enabling(struct bfa_iocpf *iocpf, enum iocpf_event event)break ;default : -bfa_sm_fault (ioc, event); +bfa_sm_fault (event); } }
@@ -857,7 +857,7 @@ bfa_iocpf_sm_ready(struct bfa_iocpf *iocpf, enum iocpf_event event)break ;default : -bfa_sm_fault (ioc, event); +bfa_sm_fault (event); } }
@@ -899,7 +899,7 @@ bfa_iocpf_sm_disabling(struct bfa_iocpf *iocpf, enum iocpf_event event)break ;default : -bfa_sm_fault (ioc, event); +bfa_sm_fault (event); } }
@@ -928,7 +928,7 @@ bfa_iocpf_sm_disabling_sync(struct bfa_iocpf *iocpf, enum iocpf_event event)break ;default : -bfa_sm_fault (ioc, event); +bfa_sm_fault (event); } }
@@ -958,7 +958,7 @@ bfa_iocpf_sm_disabled(struct bfa_iocpf *iocpf, enum iocpf_event event)break ;default : -bfa_sm_fault (ioc, event); +bfa_sm_fault (event); } }
@@ -1010,7 +1010,7 @@ bfa_iocpf_sm_initfail_sync(struct bfa_iocpf *iocpf, enum iocpf_event event)break ;default : -bfa_sm_fault (ioc, event); +bfa_sm_fault (event); } }
@@ -1039,7 +1039,7 @@ bfa_iocpf_sm_initfail(struct bfa_iocpf *iocpf, enum iocpf_event event)break ;default : -bfa_sm_fault (ioc, event); +bfa_sm_fault (event); } }
@@ -1094,7 +1094,7 @@ bfa_iocpf_sm_fail_sync(struct bfa_iocpf *iocpf, enum iocpf_event event)break ;default : -bfa_sm_fault (ioc, event); +bfa_sm_fault (event); } }
@@ -1116,7 +1116,7 @@ bfa_iocpf_sm_fail(struct bfa_iocpf *iocpf, enum iocpf_event event)break ;default : -bfa_sm_fault (iocpf->ioc, event); +bfa_sm_fault (event); } }
drivers/net/bna/bna_ctrl.c +21 -21
168 lines not on this page · raw message
drivers/net/bna/bna_txrx.c +19 -19
@@ -569,7 +569,7 @@ bna_rxf_sm_stopped(struct bna_rxf *rxf, enum bna_rxf_event event)break ;default : -bfa_sm_fault (rxf->rx->bna, event); +bfa_sm_fault (event); } }
@@ -627,7 +627,7 @@ bna_rxf_sm_start_wait(struct bna_rxf *rxf, enum bna_rxf_event event)break ;default : -bfa_sm_fault (rxf->rx->bna, event); +bfa_sm_fault (event); } }
@@ -678,7 +678,7 @@ bna_rxf_sm_cam_fltr_mod_wait(struct bna_rxf *rxf, enum bna_rxf_event event)break ;default : -bfa_sm_fault (rxf->rx->bna, event); +bfa_sm_fault (event); } }
@@ -724,7 +724,7 @@ bna_rxf_sm_started(struct bna_rxf *rxf, enum bna_rxf_event event)break ;default : -bfa_sm_fault (rxf->rx->bna, event); +bfa_sm_fault (event); } }
@@ -761,7 +761,7 @@ bna_rxf_sm_cam_fltr_clr_wait(struct bna_rxf *rxf, enum bna_rxf_event event)break ;default : -bfa_sm_fault (rxf->rx->bna, event); +bfa_sm_fault (event); } }
@@ -815,7 +815,7 @@ bna_rxf_sm_stop_wait(struct bna_rxf *rxf, enum bna_rxf_event event)break ;default : -bfa_sm_fault (rxf->rx->bna, event); +bfa_sm_fault (event); } }
@@ -851,7 +851,7 @@ bna_rxf_sm_pause_wait(struct bna_rxf *rxf, enum bna_rxf_event event)* any other event during these states */ default : -bfa_sm_fault (rxf->rx->bna, event); +bfa_sm_fault (event); } }
@@ -887,7 +887,7 @@ bna_rxf_sm_resume_wait(struct bna_rxf *rxf, enum bna_rxf_event event)* any other event during these states */ default : -bfa_sm_fault (rxf->rx->bna, event); +bfa_sm_fault (event); } }
@@ -907,7 +907,7 @@ bna_rxf_sm_stat_clr_wait(struct bna_rxf *rxf, enum bna_rxf_event event)break ;default : -bfa_sm_fault (rxf->rx->bna, event); +bfa_sm_fault (event); } }
@@ -1898,7 +1898,7 @@ static void bna_rx_sm_stopped(struct bna_rx *rx,/* no-op */ break ;default : -bfa_sm_fault (rx->bna, event); +bfa_sm_fault (event);break ; }
@@ -1946,7 +1946,7 @@ static void bna_rx_sm_rxf_start_wait(struct bna_rx *rx,bfa_fsm_set_state (rx, bna_rx_sm_started);break ;default : -bfa_sm_fault (rx->bna, event); +bfa_sm_fault (event);break ; } }
@@ -1981,7 +1981,7 @@ bna_rx_sm_started(struct bna_rx *rx, enum bna_rx_event event)bfa_fsm_set_state (rx, bna_rx_sm_rxf_stop_wait);break ;default : -bfa_sm_fault (rx->bna, event); +bfa_sm_fault (event);break ; } }
@@ -2011,7 +2011,7 @@ bna_rx_sm_rxf_stop_wait(struct bna_rx *rx, enum bna_rx_event event)bna_rxf_fail (&rx->rxf);break ;default : -bfa_sm_fault (rx->bna, event); +bfa_sm_fault (event);break ; }
@@ -2064,7 +2064,7 @@ bna_rx_sm_rxq_stop_wait(struct bna_rx *rx, enum bna_rx_event event)bfa_fsm_set_state (rx, bna_rx_sm_stopped);break ;default : -bfa_sm_fault (rx->bna, event); +bfa_sm_fault (event);break ; } }
@@ -3216,7 +3216,7 @@ bna_tx_sm_stopped(struct bna_tx *tx, enum bna_tx_event event)break ;default : -bfa_sm_fault (tx->bna, event); +bfa_sm_fault (event); } }
@@ -3261,7 +3261,7 @@ bna_tx_sm_started(struct bna_tx *tx, enum bna_tx_event event)break ;default : -bfa_sm_fault (tx->bna, event); +bfa_sm_fault (event); } }
@@ -3294,7 +3294,7 @@ bna_tx_sm_txq_stop_wait(struct bna_tx *tx, enum bna_tx_event event)break ;default : -bfa_sm_fault (tx->bna, event); +bfa_sm_fault (event); } }
@@ -3335,7 +3335,7 @@ bna_tx_sm_prio_stop_wait(struct bna_tx *tx, enum bna_tx_event event)break ;default : -bfa_sm_fault (tx->bna, event); +bfa_sm_fault (event); } }
@@ -3355,7 +3355,7 @@ bna_tx_sm_stat_clr_wait(struct bna_tx *tx, enum bna_tx_event event)break ;default : -bfa_sm_fault (tx->bna, event); +bfa_sm_fault (event); } }
drivers/net/bna/cna.h +1 -1
@@ -33,7 +33,7 @@#include <linux/list.h> -#define bfa_sm_fault (__mod, __event) do { \ +#define bfa_sm_fault (__event) do { \ pr_err("SM Assertion failure: %s: %d: event = %d", __FILE__, __LINE__, \ __event); \ } while (0)
Signature · 1 line
1.7.1
PATCH 5/45 bna: MSGQ Implementation
In reply to Rasesh ModyChange details:
- Currently modules communicate with the FW using 32 byte command and response register. This limits the size of the command and response messages exchanged with the FW to 32 bytes. We need a mechanism to exchange the comamnds and responses exchange with FW that exceeds 32 bytes.
- MSGQ implementation provides that facility. It removes the assumption that command/response queue size is precisely calculated to accommodate all concurrent FW commands/responses. The queue depth is made variable now, defined by a macro. A waiting command list is implemented to hold all the commands when there is no place in the command queue. Callback is implemented for each command entry to invoke the module posting the command, when there is space in the command queue and the command was finally posted to the queue. Module/Object information is embedded in the response for tracking purpose.
--- drivers/net/bna/Makefile | 3 +- drivers/net/bna/bfa_ioc.c | 14 +- drivers/net/bna/bfa_ioc.h | 4 +- drivers/net/bna/bfa_msgq.c | 669 ++++++++++++++++++++++++++++++++++++++++++++ drivers/net/bna/bfa_msgq.h | 130 +++++++++ drivers/net/bna/bfi.h | 101 +++++++ drivers/net/bna/bna_ctrl.c | 6 +- 7 files changed, 918 insertions(+), 9 deletions(-) create mode 100644 drivers/net/bna/bfa_msgq.c create mode 100644 drivers/net/bna/bfa_msgq.h
drivers/net/bna/Makefile +2 -1
@@ -6,6 +6,7 @@ obj-$(CONFIG_BNA) += bna.o bna-objs := bnad.o bnad_ethtool.o bna_ctrl.o bna_txrx.o -bna-objs += bfa_ioc.o bfa_ioc_ct.o bfa_cee.o cna_fwimg.o +bna-objs += bfa_msgq.o bfa_ioc.o bfa_ioc_ct.o bfa_cee.o +bna-objs += cna_fwimg.o EXTRA_CFLAGS := -Idrivers/net/bna
drivers/net/bna/bfa_ioc.c +9 -5
@@ -1942,18 +1942,22 @@ bfa_nw_ioc_mbox_regisr(struct bfa_ioc *ioc, enum bfi_mclass mc,* @param[in] ioc IOC instance * @param[i] cmd Mailbox command */ -void -bfa_nw_ioc_mbox_queue (struct bfa_ioc *ioc,struct bfa_mbox_cmd *cmd) +bool +bfa_nw_ioc_mbox_queue (struct bfa_ioc *ioc,struct bfa_mbox_cmd *cmd, +bfa_mbox_cmd_cbfn_t cbfn,void *cbarg) {struct bfa_ioc_mbox_mod *mod = &ioc->mbox_mod;u32 stat; + cmd->cbfn = cbfn; + cmd->cbarg = cbarg; +/** * If a previous command is pending, queue new command */ if (!list_empty (&mod->cmd_q)) {list_add_tail (&cmd->qe, &mod->cmd_q); -return ; +return true; }/**
@@ -1962,7 +1966,7 @@ bfa_nw_ioc_mbox_queue(struct bfa_ioc *ioc, struct bfa_mbox_cmd *cmd) stat =readl (ioc->ioc_regs.hfn_mbox_cmd);if (stat) {list_add_tail (&cmd->qe, &mod->cmd_q); -return ; +return true; }/**
@@ -1970,7 +1974,7 @@ bfa_nw_ioc_mbox_queue(struct bfa_ioc *ioc, struct bfa_mbox_cmd *cmd)*/ bfa_ioc_mbox_send (ioc, cmd->msg,sizeof (cmd->msg)); -return ; +return false; }/**
drivers/net/bna/bfa_ioc.h +3 -1
@@ -251,7 +251,9 @@ struct bfa_ioc_hwif {/** * IOC mailbox interface */ -void bfa_nw_ioc_mbox_queue (struct bfa_ioc *ioc,struct bfa_mbox_cmd *cmd); +bool bfa_nw_ioc_mbox_queue (struct bfa_ioc *ioc, +struct bfa_mbox_cmd *cmd, +bfa_mbox_cmd_cbfn_t cbfn,void *cbarg);void bfa_nw_ioc_mbox_isr (struct bfa_ioc *ioc);void bfa_nw_ioc_mbox_regisr (struct bfa_ioc *ioc,enum bfi_mclass mc,bfa_ioc_mbox_mcfunc_t cbfn,void *cbarg);
drivers/net/bna/bfa_msgq.c new file +669 -0
669 lines not on this page · raw message
drivers/net/bna/bfa_msgq.h new file +130 -0
130 lines not on this page · raw message
drivers/net/bna/bfi.h +101 -0
113 lines not on this page · raw message
drivers/net/bna/bna_ctrl.c +4 -2
@@ -184,7 +184,8 @@ bna_ll_isr(void *llarg, struct bfi_mbmsg *msg)if (to_post) { mb_qe =bfa_q_first (&bna->mbox_mod.posted_q);bfa_nw_ioc_mbox_queue (&bna->device.ioc, - &mb_qe->cmd); + &mb_qe->cmd,NULL , +NULL ); } }else { snprintf(message, BNA_MESSAGE_SIZE,
@@ -235,7 +236,8 @@ bna_mbox_send(struct bna *bna, struct bna_mbox_qe *mbox_qe) bna->mbox_mod.msg_pending++;if (bna->mbox_mod.state ==BNA_MBOX_FREE ) {list_add_tail (&mbox_qe->qe, &bna->mbox_mod.posted_q); -bfa_nw_ioc_mbox_queue (&bna->device.ioc, &mbox_qe->cmd); +bfa_nw_ioc_mbox_queue (&bna->device.ioc, &mbox_qe->cmd, +NULL ,NULL ); bna->mbox_mod.state =BNA_MBOX_POSTED ; }else {list_add_tail (&mbox_qe->qe, &bna->mbox_mod.posted_q);
Signature · 1 line
1.7.1
PATCH 6/45 bna: Use DEFINE_PCI_DEVICE_TABLE and Print Driver Version
In reply to Rasesh ModyChange details:
- Use DEFINE_PCI_DEVICE_TABLE in place of struct pci_device_id
- Print the dirver version when module is loaded
--- drivers/net/bna/bnad.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/bna/bnad.c +2 -2
@@ -3230,7 +3230,7 @@ bnad_pci_remove(struct pci_dev *pdev)free_netdev (netdev); } -static const struct pci_device_id bnad_pci_id_table[] = { +static DEFINE_PCI_DEVICE_TABLE (bnad_pci_id_table) = { {PCI_DEVICE (PCI_VENDOR_ID_BROCADE ,PCI_DEVICE_ID_BROCADE_CT ),
@@ -3253,7 +3253,7 @@ bnad_module_init(void) {int err; -pr_info ("Brocade 10G Ethernet driver\n" ); +pr_info ("Brocade 10G Ethernet driver %s\n" ,BNAD_VERSION );bfa_nw_ioc_auto_recover (bnad_ioc_auto_recover);
Signature · 1 line
1.7.1
PATCH 7/45 bna: Introduce ENET as New Driver and FW Interface
In reply to Rasesh ModyChange details:
- This patch contains the messages, opcodes and structure format for the messages and responses exchanged between driver and the FW. In addition this patch contains the state machine implementation for Ethport, Enet, IOCEth.
- Ethport object is responsible for receiving link state events, sending port enable/disable commands to FW.
- Enet object is responsible for synchronizing initialization/teardown of tx & rx datapath configuration.
- IOCEth object is responsible for init/un-init of IOC in the adapter which runs the FW.
- This patch also contains code for initialization and resource assignment for Ethport, Enet, IOCEth, Tx, Rx objects.
--- drivers/net/bna/bfi_enet.h | 902 ++++++++++++++++++ drivers/net/bna/bna_enet.c | 2199 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 3101 insertions(+), 0 deletions(-) create mode 100644 drivers/net/bna/bfi_enet.h create mode 100644 drivers/net/bna/bna_enet.c
drivers/net/bna/bfi_enet.h new file +902 -0
@@ -0,0 +1,902 @@ +/* +* Linux network driver for Brocade Converged Network Adapter. +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License (GPL) Version 2 as +* published by the Free Software Foundation +* +* This program is distributed in the hope that it will be useful, but +* WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* General Public License for more details. +*/ +/* +* Copyright (c) 2005-2011 Brocade Communications Systems, Inc. +* All rights reserved +* www.brocade.com +*/ + +/** +* @file bfi_enet.h BNA Hardware and Firmware Interface +*/ + +/** +* Skipping statistics collection to avoid clutter. +* Command is no longer needed: +* MTU +* TxQ Stop +* RxQ Stop +* RxF Enable/Disable +* +* HDS-off request is dynamic +* keep structures as multiple of 32-bit fields for alignment. +* All values must be written in big-endian. +*/ +#ifndef __BFI_ENET_H__ +#define __BFI_ENET_H__ + +#include "bfa_defs.h" +#include "bfi.h" + +#pragma pack(1) + +#define BFI_ENET_CFG_MAX 32/* Max resources per PF */ + +#define BFI_ENET_TXQ_PRIO_MAX 8 +#define BFI_ENET_RX_QSET_MAX 16 +#define BFI_ENET_TXQ_WI_VECT_MAX 4 + +#define BFI_ENET_VLAN_ID_MAX 4096 +#define BFI_ENET_VLAN_BLOCK_SIZE 512/* in bits */ +#define BFI_ENET_VLAN_BLOCKS_MAX \ + (BFI_ENET_VLAN_ID_MAX / BFI_ENET_VLAN_BLOCK_SIZE) +#define BFI_ENET_VLAN_WORD_SIZE 32/* in bits */ +#define BFI_ENET_VLAN_WORDS_MAX \ + (BFI_ENET_VLAN_BLOCK_SIZE / BFI_ENET_VLAN_WORD_SIZE) + +#define BFI_ENET_RSS_RIT_MAX 64/* entries */ +#define BFI_ENET_RSS_KEY_LEN 10/* 32-bit words */ + +union bfi_addr_be_u { +struct { +u32 addr_hi;/* Most Significant 32-bits */ +u32 addr_lo;/* Least Significant 32-Bits */ + } a32; +}; + +/** +* T X Q U E U E D E F I N E S +*/ +/* TxQ Vector (a.k.a. Tx-Buffer Descriptor) */ +/* TxQ Entry Opcodes */ +#define BFI_ENET_TXQ_WI_SEND (0x402)/* Single Frame Transmission */ +#define BFI_ENET_TXQ_WI_SEND_LSO (0x403)/* Multi-Frame Transmission */ +#define BFI_ENET_TXQ_WI_EXTENSION (0x104)/* Extension WI */ + +/* TxQ Entry Control Flags */ +#define BFI_ENET_TXQ_WI_CF_FCOE_CRC (1 << 8) +#define BFI_ENET_TXQ_WI_CF_IPID_MODE (1 << 5) +#define BFI_ENET_TXQ_WI_CF_INS_PRIO (1 << 4) +#define BFI_ENET_TXQ_WI_CF_INS_VLAN (1 << 3) +#define BFI_ENET_TXQ_WI_CF_UDP_CKSUM (1 << 2) +#define BFI_ENET_TXQ_WI_CF_TCP_CKSUM (1 << 1) +#define BFI_ENET_TXQ_WI_CF_IP_CKSUM (1 << 0) + +struct bfi_enet_txq_wi_base { +u8 reserved; +u8 num_vectors;/* number of vectors present */ +u16 opcode; +/* BFI_ENET_TXQ_WI_SEND or BFI_ENET_TXQ_WI_SEND_LSO */ +u16 flags;/* OR of all the flags */ +u16 l4_hdr_size_n_offset; +u16 vlan_tag; +u16 lso_mss;/* Only 14 LSB are valid */ +u32 frame_length;/* Only 24 LSB are valid */ +}; + +struct bfi_enet_txq_wi_ext { +u16 reserved; +u16 opcode;/* BFI_ENET_TXQ_WI_EXTENSION */ +u32 reserved2[3 ]; +}; + +struct bfi_enet_txq_wi_vector {/* Tx Buffer Descriptor */ +u16 reserved; +u16 length;/* Only 14 LSB are valid */ +union bfi_addr_be_u addr; +}; + +/** +* TxQ Entry Structure +* +*/ +struct bfi_enet_txq_entry { +union { +struct bfi_enet_txq_wi_base base; +struct bfi_enet_txq_wi_ext ext; + } wi; +struct bfi_enet_txq_wi_vector vector[BFI_ENET_TXQ_WI_VECT_MAX ]; +}; + +#define wi_hdr wi.base +#define wi_ext_hdr wi.ext + +#define BFI_ENET_TXQ_WI_L4_HDR_N_OFFSET (_hdr_size, _offset) \ + (((_hdr_size) << 10) | ((_offset) & 0x3FF)) + +/** +* R X Q U E U E D E F I N E S +*/ +struct bfi_enet_rxq_entry { +union bfi_addr_be_u rx_buffer; +}; + +/** +* R X C O M P L E T I O N Q U E U E D E F I N E S +*/ +/* CQ Entry Flags */ +#define BFI_ENET_CQ_EF_MAC_ERROR (1 << 0) +#define BFI_ENET_CQ_EF_FCS_ERROR (1 << 1) +#define BFI_ENET_CQ_EF_TOO_LONG (1 << 2) +#define BFI_ENET_CQ_EF_FC_CRC_OK (1 << 3) + +#define BFI_ENET_CQ_EF_RSVD1 (1 << 4) +#define BFI_ENET_CQ_EF_L4_CKSUM_OK (1 << 5) +#define BFI_ENET_CQ_EF_L3_CKSUM_OK (1 << 6) +#define BFI_ENET_CQ_EF_HDS_HEADER (1 << 7) + +#define BFI_ENET_CQ_EF_UDP (1 << 8) +#define BFI_ENET_CQ_EF_TCP (1 << 9) +#define BFI_ENET_CQ_EF_IP_OPTIONS (1 << 10) +#define BFI_ENET_CQ_EF_IPV6 (1 << 11) + +#define BFI_ENET_CQ_EF_IPV4 (1 << 12) +#define BFI_ENET_CQ_EF_VLAN (1 << 13) +#define BFI_ENET_CQ_EF_RSS (1 << 14) +#define BFI_ENET_CQ_EF_RSVD2 (1 << 15) + +#define BFI_ENET_CQ_EF_MCAST_MATCH (1 << 16) +#define BFI_ENET_CQ_EF_MCAST (1 << 17) +#define BFI_ENET_CQ_EF_BCAST (1 << 18) +#define BFI_ENET_CQ_EF_REMOTE (1 << 19) + +#define BFI_ENET_CQ_EF_LOCAL (1 << 20) + +/* CQ Entry Structure */ +struct bfi_enet_cq_entry { +u32 flags; +u16 vlan_tag; +u16 length; +u32 rss_hash; +u8 valid; +u8 reserved1; +u8 reserved2; +u8 rxq_id; +}; + +/** +* E N E T C O N T R O L P A T H C O M M A N D S +*/ +struct bfi_enet_q { +union bfi_addr_u pg_tbl; +union bfi_addr_u first_entry; +u16 pages;/* # of pages */ +u16 page_sz; +}; + +struct bfi_enet_txq { +struct bfi_enet_q q; +u8 priority; +u8 rsvd[3 ]; +}; + +struct bfi_enet_rxq { +struct bfi_enet_q q; +u16 rx_buffer_size; +u16 rsvd; +}; + +struct bfi_enet_cq { +struct bfi_enet_q q; +}; + +struct bfi_enet_ib_cfg { +u8 int_pkt_dma; +u8 int_enabled; +u8 int_pkt_enabled; +u8 continuous_coalescing; +u8 msix; +u8 rsvd[3 ]; +u32 coalescing_timeout; +u32 inter_pkt_timeout; +u8 inter_pkt_count; +u8 rsvd1[3 ]; +}; + +struct bfi_enet_ib { +union bfi_addr_u index_addr; +union { +u16 msix_index; +u16 intx_bitmask; + } intr; +u16 rsvd; +}; + +/** +* ENET command messages +*/ +enum bfi_enet_h2i_msgs { +/* Rx Commands */ +BFI_ENET_H2I_RX_CFG_SET_REQ =1 , +BFI_ENET_H2I_RX_CFG_CLR_REQ =2 , + +BFI_ENET_H2I_RIT_CFG_REQ =3 , +BFI_ENET_H2I_RSS_CFG_REQ =4 , +BFI_ENET_H2I_RSS_ENABLE_REQ =5 , +BFI_ENET_H2I_RX_PROMISCUOUS_REQ =6 , +BFI_ENET_H2I_RX_DEFAULT_REQ =7 , + +BFI_ENET_H2I_MAC_UCAST_SET_REQ =8 , +BFI_ENET_H2I_MAC_UCAST_CLR_REQ =9 , +BFI_ENET_H2I_MAC_UCAST_ADD_REQ =10 , +BFI_ENET_H2I_MAC_UCAST_DEL_REQ =11 , + +BFI_ENET_H2I_MAC_MCAST_ADD_REQ =12 , +BFI_ENET_H2I_MAC_MCAST_DEL_REQ =13 , +BFI_ENET_H2I_MAC_MCAST_FILTER_REQ =14 , + +BFI_ENET_H2I_RX_VLAN_SET_REQ =15 , +BFI_ENET_H2I_RX_VLAN_STRIP_ENABLE_REQ =16 , + +/* Tx Commands */ +BFI_ENET_H2I_TX_CFG_SET_REQ =17 , +BFI_ENET_H2I_TX_CFG_CLR_REQ =18 , + +/* Port Commands */ +BFI_ENET_H2I_PORT_ADMIN_UP_REQ =19 , +BFI_ENET_H2I_SET_PAUSE_REQ =20 , +BFI_ENET_H2I_DIAG_LOOPBACK_REQ =21 , + +/* Get Attributes Command */ +BFI_ENET_H2I_GET_ATTR_REQ =22 , + +/* Statistics Commands */ +BFI_ENET_H2I_STATS_GET_REQ =23 , +BFI_ENET_H2I_STATS_CLR_REQ =24 , + +BFI_ENET_H2I_WOL_MAGIC_REQ =25 , +BFI_ENET_H2I_WOL_FRAME_REQ =26 , + +BFI_ENET_H2I_MAX =27 , +}; + +enum bfi_enet_i2h_msgs { +/* Rx Responses */ +BFI_ENET_I2H_RX_CFG_SET_RSP = +BFA_I2HM (BFI_ENET_H2I_RX_CFG_SET_REQ ), +BFI_ENET_I2H_RX_CFG_CLR_RSP = +BFA_I2HM (BFI_ENET_H2I_RX_CFG_CLR_REQ ), + +BFI_ENET_I2H_RIT_CFG_RSP = +BFA_I2HM (BFI_ENET_H2I_RIT_CFG_REQ ), +BFI_ENET_I2H_RSS_CFG_RSP = +BFA_I2HM (BFI_ENET_H2I_RSS_CFG_REQ ), +BFI_ENET_I2H_RSS_ENABLE_RSP = +BFA_I2HM (BFI_ENET_H2I_RSS_ENABLE_REQ ), +BFI_ENET_I2H_RX_PROMISCUOUS_RSP = +BFA_I2HM (BFI_ENET_H2I_RX_PROMISCUOUS_REQ ), +BFI_ENET_I2H_RX_DEFAULT_RSP = +BFA_I2HM (BFI_ENET_H2I_RX_DEFAULT_REQ ), + +BFI_ENET_I2H_MAC_UCAST_SET_RSP = +BFA_I2HM (BFI_ENET_H2I_MAC_UCAST_SET_REQ ), +BFI_ENET_I2H_MAC_UCAST_CLR_RSP = +BFA_I2HM (BFI_ENET_H2I_MAC_UCAST_CLR_REQ ), +BFI_ENET_I2H_MAC_UCAST_ADD_RSP = +BFA_I2HM (BFI_ENET_H2I_MAC_UCAST_ADD_REQ ), +BFI_ENET_I2H_MAC_UCAST_DEL_RSP = +BFA_I2HM (BFI_ENET_H2I_MAC_UCAST_DEL_REQ ), + +BFI_ENET_I2H_MAC_MCAST_ADD_RSP = +BFA_I2HM (BFI_ENET_H2I_MAC_MCAST_ADD_REQ ), +BFI_ENET_I2H_MAC_MCAST_DEL_RSP = +BFA_I2HM (BFI_ENET_H2I_MAC_MCAST_DEL_REQ ), +BFI_ENET_I2H_MAC_MCAST_FILTER_RSP = +BFA_I2HM (BFI_ENET_H2I_MAC_MCAST_FILTER_REQ ), + +BFI_ENET_I2H_RX_VLAN_SET_RSP = +BFA_I2HM (BFI_ENET_H2I_RX_VLAN_SET_REQ ), + +BFI_ENET_I2H_RX_VLAN_STRIP_ENABLE_RSP = +BFA_I2HM (BFI_ENET_H2I_RX_VLAN_STRIP_ENABLE_REQ ), + +/* Tx Responses */ +BFI_ENET_I2H_TX_CFG_SET_RSP = +BFA_I2HM (BFI_ENET_H2I_TX_CFG_SET_REQ ), +BFI_ENET_I2H_TX_CFG_CLR_RSP = +BFA_I2HM (BFI_ENET_H2I_TX_CFG_CLR_REQ ), + +/* Port Responses */ +BFI_ENET_I2H_PORT_ADMIN_RSP = +BFA_I2HM (BFI_ENET_H2I_PORT_ADMIN_UP_REQ ), + +BFI_ENET_I2H_SET_PAUSE_RSP = +BFA_I2HM (BFI_ENET_H2I_SET_PAUSE_REQ ), +BFI_ENET_I2H_DIAG_LOOPBACK_RSP = +BFA_I2HM (BFI_ENET_H2I_DIAG_LOOPBACK_REQ ), + +/* Attributes Response */ +BFI_ENET_I2H_GET_ATTR_RSP = +BFA_I2HM (BFI_ENET_H2I_GET_ATTR_REQ ), + +/* Statistics Responses */ +BFI_ENET_I2H_STATS_GET_RSP = +BFA_I2HM (BFI_ENET_H2I_STATS_GET_REQ ), +BFI_ENET_I2H_STATS_CLR_RSP = +BFA_I2HM (BFI_ENET_H2I_STATS_CLR_REQ ), + +BFI_ENET_I2H_WOL_MAGIC_RSP = +BFA_I2HM (BFI_ENET_H2I_WOL_MAGIC_REQ ), +BFI_ENET_I2H_WOL_FRAME_RSP = +BFA_I2HM (BFI_ENET_H2I_WOL_FRAME_REQ ), + +/* AENs */ +BFI_ENET_I2H_LINK_DOWN_AEN =BFA_I2HM (BFI_ENET_H2I_MAX ), +BFI_ENET_I2H_LINK_UP_AEN =BFA_I2HM (BFI_ENET_H2I_MAX +1 ), + +BFI_ENET_I2H_PORT_ENABLE_AEN =BFA_I2HM (BFI_ENET_H2I_MAX +2 ), +BFI_ENET_I2H_PORT_DISABLE_AEN =BFA_I2HM (BFI_ENET_H2I_MAX +3 ), + +BFI_ENET_I2H_BW_UPDATE_AEN =BFA_I2HM (BFI_ENET_H2I_MAX +4 ), +}; + +/** +* The following error codes can be returned by the enet commands +*/ +enum bfi_enet_err { +BFI_ENET_CMD_OK =0 , +BFI_ENET_CMD_FAIL =1 , +BFI_ENET_CMD_DUP_ENTRY =2 ,/* !< Duplicate entry in CAM */ +BFI_ENET_CMD_CAM_FULL =3 ,/* !< CAM is full */ +BFI_ENET_CMD_NOT_OWNER =4 ,/* !< Not permitted, b'cos not owner */ +BFI_ENET_CMD_NOT_EXEC =5 ,/* !< Was not sent to f/w at all */ +BFI_ENET_CMD_WAITING =6 ,/* !< Waiting for completion */ +BFI_ENET_CMD_PORT_DISABLED =7 ,/* !< port in disabled state */ +}; + +/** +* Generic Request +* +* bfi_enet_req is used by: +* BFI_ENET_H2I_RX_CFG_CLR_REQ +* BFI_ENET_H2I_TX_CFG_CLR_REQ +*/ +struct bfi_enet_req { +struct bfi_msgq_mhdr mh; +}; + +/** +* Enable/Disable Request +* +* bfi_enet_enable_req is used by: +* BFI_ENET_H2I_RSS_ENABLE_REQ (enet_id must be zero) +* BFI_ENET_H2I_RX_PROMISCUOUS_REQ (enet_id must be zero) +* BFI_ENET_H2I_RX_DEFAULT_REQ (enet_id must be zero) +* BFI_ENET_H2I_RX_MAC_MCAST_FILTER_REQ +* BFI_ENET_H2I_PORT_ADMIN_UP_REQ (enet_id must be zero) +*/ +struct bfi_enet_enable_req { +struct bfi_msgq_mhdr mh; +u8 enable;/* 1 = enable; 0 = disable */ +u8 rsvd[3 ]; +}; + +/** +* Generic Response +*/ +struct bfi_enet_rsp { +struct bfi_msgq_mhdr mh; +u8 error;/*!< if error see cmd_offset */ +u8 rsvd; +u16 cmd_offset;/*!< offset to invalid parameter */ +}; + +/** +* GLOBAL CONFIGURATION +*/ + +/** +* bfi_enet_attr_req is used by: +* BFI_ENET_H2I_GET_ATTR_REQ +*/ +struct bfi_enet_attr_req { +struct bfi_msgq_mhdr mh; +}; + +/** +* bfi_enet_attr_rsp is used by: +* BFI_ENET_I2H_GET_ATTR_RSP +*/ +struct bfi_enet_attr_rsp { +struct bfi_msgq_mhdr mh; +u8 error;/*!< if error see cmd_offset */ +u8 rsvd; +u16 cmd_offset;/*!< offset to invalid parameter */ +u32 max_cfg; +u32 max_ucmac; +u32 rit_size; +}; + +/** +* Tx Configuration +* +* bfi_enet_tx_cfg is used by: +* BFI_ENET_H2I_TX_CFG_SET_REQ +*/ +enum bfi_enet_tx_vlan_mode { +BFI_ENET_TX_VLAN_NOP =0 , +BFI_ENET_TX_VLAN_INS =1 , +BFI_ENET_TX_VLAN_WI =2 , +}; + +struct bfi_enet_tx_cfg { +u8 vlan_mode;/*!< processing mode */ +u8 rsvd; +u16 vlan_id; +u8 admit_tagged_frame; +u8 apply_vlan_filter; +u8 add_to_vswitch; +u8 rsvd1[1 ]; +}; + +struct bfi_enet_tx_cfg_req { +struct bfi_msgq_mhdr mh; +u8 num_queues;/* # of Tx Queues */ +u8 rsvd[3 ]; + +struct { +struct bfi_enet_txq q; +struct bfi_enet_ib ib; + } q_cfg[BFI_ENET_TXQ_PRIO_MAX ]; + +struct bfi_enet_ib_cfg ib_cfg; + +struct bfi_enet_tx_cfg tx_cfg; +}; + +struct bfi_enet_tx_cfg_rsp { +struct bfi_msgq_mhdr mh; +u8 error; +u8 hw_id;/* For debugging */ +u8 rsvd[2 ]; +struct { +u32 q_dbell;/* PCI base address offset */ +u32 i_dbell;/* PCI base address offset */ +u8 hw_qid;/* For debugging */ +u8 rsvd[3 ]; + } q_handles[BFI_ENET_TXQ_PRIO_MAX ]; +}; + +/** +* Rx Configuration +* +* bfi_enet_rx_cfg is used by: +* BFI_ENET_H2I_RX_CFG_SET_REQ +*/ +enum bfi_enet_rxq_type { +BFI_ENET_RXQ_SINGLE =1 , +BFI_ENET_RXQ_LARGE_SMALL =2 , +BFI_ENET_RXQ_HDS =3 , +BFI_ENET_RXQ_HDS_OPT_BASED =4 , +}; + +enum bfi_enet_hds_type { +BFI_ENET_HDS_FORCED =0x01 , +BFI_ENET_HDS_IPV6_UDP =0x02 , +BFI_ENET_HDS_IPV6_TCP =0x04 , +BFI_ENET_HDS_IPV4_TCP =0x08 , +BFI_ENET_HDS_IPV4_UDP =0x10 , +}; + +struct bfi_enet_rx_cfg { +u8 rxq_type; +u8 rsvd[3 ]; + +struct { +u8 max_header_size; +u8 force_offset; +u8 type; +u8 rsvd1; + } hds; + +u8 multi_buffer; +u8 strip_vlan; +u8 drop_untagged; +u8 rsvd2; +}; + +/* +* Multicast frames are received on the ql of q-set index zero. +* On the completion queue. RxQ ID = even is for large/data buffer queues +* and RxQ ID = odd is for small/header buffer queues. +*/ +struct bfi_enet_rx_cfg_req { +struct bfi_msgq_mhdr mh; +u8 num_queue_sets;/* # of Rx Queue Sets */ +u8 rsvd[3 ]; + +struct { +struct bfi_enet_rxq ql;/* large/data/single buffers */ +struct bfi_enet_rxq qs;/* small/header buffers */ +struct bfi_enet_cq cq; +struct bfi_enet_ib ib; + } q_cfg[BFI_ENET_RX_QSET_MAX ]; + +struct bfi_enet_ib_cfg ib_cfg; + +struct bfi_enet_rx_cfg rx_cfg; +}; + +struct bfi_enet_rx_cfg_rsp { +struct bfi_msgq_mhdr mh; +u8 error; +u8 hw_id;/* For debugging */ +u8 rsvd[2 ]; +struct { +u32 ql_dbell;/* PCI base address offset */ +u32 qs_dbell;/* PCI base address offset */ +u32 i_dbell;/* PCI base address offset */ +u8 hw_lqid;/* For debugging */ +u8 hw_sqid;/* For debugging */ +u8 hw_cqid;/* For debugging */ +u8 rsvd; + } q_handles[BFI_ENET_RX_QSET_MAX ]; +}; + +/** +* RIT +* +* bfi_enet_rit_req is used by: +* BFI_ENET_H2I_RIT_CFG_REQ +*/ +struct bfi_enet_rit_req { +struct bfi_msgq_mhdr mh; +u16 size;/* number of table-entries used */ +u8 rsvd[2 ]; +u8 table[BFI_ENET_RSS_RIT_MAX ]; +}; + +/** +* RSS +* +* bfi_enet_rss_cfg_req is used by: +* BFI_ENET_H2I_RSS_CFG_REQ +*/ +enum bfi_enet_rss_type { +BFI_ENET_RSS_IPV6 =0x01 , +BFI_ENET_RSS_IPV6_TCP =0x02 , +BFI_ENET_RSS_IPV4 =0x04 , +BFI_ENET_RSS_IPV4_TCP =0x08 +}; + +struct bfi_enet_rss_cfg { +u8 type; +u8 mask; +u8 rsvd[2 ]; +u32 key[BFI_ENET_RSS_KEY_LEN ]; +}; + +struct bfi_enet_rss_cfg_req { +struct bfi_msgq_mhdr mh; +struct bfi_enet_rss_cfg cfg; +}; + +/** +* MAC Unicast +* +* bfi_enet_rx_vlan_req is used by: +* BFI_ENET_H2I_MAC_UCAST_SET_REQ +* BFI_ENET_H2I_MAC_UCAST_CLR_REQ +* BFI_ENET_H2I_MAC_UCAST_ADD_REQ +* BFI_ENET_H2I_MAC_UCAST_DEL_REQ +*/ +struct bfi_enet_ucast_req { +struct bfi_msgq_mhdr mh; +mac_t mac_addr; +u8 rsvd[2 ]; +}; + +/** +* MAC Unicast + VLAN +*/ +struct bfi_enet_mac_n_vlan_req { +struct bfi_msgq_mhdr mh; +u16 vlan_id; +mac_t mac_addr; +}; + +/** +* MAC Multicast +* +* bfi_enet_mac_mfilter_add_req is used by: +* BFI_ENET_H2I_MAC_MCAST_ADD_REQ +*/ +struct bfi_enet_mcast_add_req { +struct bfi_msgq_mhdr mh; +mac_t mac_addr; +u8 rsvd[2 ]; +}; + +/** +* bfi_enet_mac_mfilter_add_rsp is used by: +* BFI_ENET_I2H_MAC_MCAST_ADD_RSP +*/ +struct bfi_enet_mcast_add_rsp { +struct bfi_msgq_mhdr mh; +u8 error; +u8 rsvd; +u16 cmd_offset; +u16 handle; +u8 rsvd1[2 ]; +}; + +/** +* bfi_enet_mac_mfilter_del_req is used by: +* BFI_ENET_H2I_MAC_MCAST_DEL_REQ +*/ +struct bfi_enet_mcast_del_req { +struct bfi_msgq_mhdr mh; +u16 handle; +u8 rsvd[2 ]; +}; + +/** +* VLAN +* +* bfi_enet_rx_vlan_req is used by: +* BFI_ENET_H2I_RX_VLAN_SET_REQ +*/ +struct bfi_enet_rx_vlan_req { +struct bfi_msgq_mhdr mh; +u8 block_idx; +u8 rsvd[3 ]; +u32 bit_mask[BFI_ENET_VLAN_WORDS_MAX ]; +}; + +/** +* PAUSE +* +* bfi_enet_set_pause_req is used by: +* BFI_ENET_H2I_SET_PAUSE_REQ +*/ +struct bfi_enet_set_pause_req { +struct bfi_msgq_mhdr mh; +u8 rsvd[2 ]; +u8 tx_pause;/* 1 = enable; 0 = disable */ +u8 rx_pause;/* 1 = enable; 0 = disable */ +}; + +/** +* DIAGNOSTICS +* +* bfi_enet_diag_lb_req is used by: +* BFI_ENET_H2I_DIAG_LOOPBACK +*/ +struct bfi_enet_diag_lb_req { +struct bfi_msgq_mhdr mh; +u8 rsvd[2 ]; +u8 mode;/* cable or Serdes */ +u8 enable;/* 1 = enable; 0 = disable */ +}; + +/** +* enum for Loopback opmodes +*/ +enum { +BFI_ENET_DIAG_LB_OPMODE_EXT =0 , +BFI_ENET_DIAG_LB_OPMODE_CBL =1 , +}; + +/** +* STATISTICS +* +* bfi_enet_stats_req is used by: +* BFI_ENET_H2I_STATS_GET_REQ +* BFI_ENET_I2H_STATS_CLR_REQ +*/ +struct bfi_enet_stats_req { +struct bfi_msgq_mhdr mh; +u16 stats_mask; +u8 rsvd[2 ]; +u32 rx_enet_mask; +u32 tx_enet_mask; +union bfi_addr_u host_buffer; +}; + +/** +* defines for "stats_mask" above. +*/ +#define BFI_ENET_STATS_MAC (1 << 0)/* !< MAC Statistics */ +#define BFI_ENET_STATS_BPC (1 << 1)/* !< Pause Stats from BPC */ +#define BFI_ENET_STATS_RAD (1 << 2)/* !< Rx Admission Statistics */ +#define BFI_ENET_STATS_RX_FC (1 << 3)/* !< Rx FC Stats from RxA */ +#define BFI_ENET_STATS_TX_FC (1 << 4)/* !< Tx FC Stats from TxA */ + +#define BFI_ENET_STATS_ALL 0x1f + +/* TxF Frame Statistics */ +struct bfi_enet_stats_txf { +u64 ucast_octets; +u64 ucast; +u64 ucast_vlan; + +u64 mcast_octets; +u64 mcast; +u64 mcast_vlan; + +u64 bcast_octets; +u64 bcast; +u64 bcast_vlan; + +u64 errors; +u64 filter_vlan;/* frames filtered due to VLAN */ +u64 filter_mac_sa;/* frames filtered due to SA check */ +}; + +/* RxF Frame Statistics */ +struct bfi_enet_stats_rxf { +u64 ucast_octets; +u64 ucast; +u64 ucast_vlan; + +u64 mcast_octets; +u64 mcast; +u64 mcast_vlan; + +u64 bcast_octets; +u64 bcast; +u64 bcast_vlan; +u64 frame_drops; +}; + +/* Fixme combine fc_tx & fc_rx */ +/* FC Tx Frame Statistics */ +struct bfi_enet_stats_fc_tx { +u64 txf_ucast_octets; +u64 txf_ucast; +u64 txf_ucast_vlan; + +u64 txf_mcast_octets; +u64 txf_mcast; +u64 txf_mcast_vlan; + +u64 txf_bcast_octets; +u64 txf_bcast; +u64 txf_bcast_vlan; + +u64 txf_parity_errors; +u64 txf_timeout; +u64 txf_fid_parity_errors; +}; + +/* FC Rx Frame Statistics */ +struct bfi_enet_stats_fc_rx { +u64 rxf_ucast_octets; +u64 rxf_ucast; +u64 rxf_ucast_vlan; + +u64 rxf_mcast_octets; +u64 rxf_mcast; +u64 rxf_mcast_vlan; + +u64 rxf_bcast_octets; +u64 rxf_bcast; +u64 rxf_bcast_vlan; +}; + +/* RAD Frame Statistics */ +struct bfi_enet_stats_rad { +u64 rx_frames; +u64 rx_octets; +u64 rx_vlan_frames; + +u64 rx_ucast; +u64 rx_ucast_octets; +u64 rx_ucast_vlan; + +u64 rx_mcast; +u64 rx_mcast_octets; +u64 rx_mcast_vlan; + +u64 rx_bcast; +u64 rx_bcast_octets; +u64 rx_bcast_vlan; + +u64 rx_drops; +}; + +/* BPC Tx Registers */ +struct bfi_enet_stats_bpc { +/* transmit stats */ +u64 tx_pause[8 ]; +u64 tx_zero_pause[8 ];/*!< Pause cancellation */ +/*!<Pause initiation rather than retention */ +u64 tx_first_pause[8 ]; + +/* receive stats */ +u64 rx_pause[8 ]; +u64 rx_zero_pause[8 ];/*!< Pause cancellation */ +/*!<Pause initiation rather than retention */ +u64 rx_first_pause[8 ]; +}; + +/* MAC Rx Statistics */ +struct bfi_enet_stats_mac { +u64 frame_64;/* both rx and tx counter */ +u64 frame_65_127;/* both rx and tx counter */ +u64 frame_128_255;/* both rx and tx counter */ +u64 frame_256_511;/* both rx and tx counter */ +u64 frame_512_1023;/* both rx and tx counter */ +u64 frame_1024_1518;/* both rx and tx counter */ +u64 frame_1519_1522;/* both rx and tx counter */ + +/* receive stats */ +u64 rx_bytes; +u64 rx_packets; +u64 rx_fcs_error; +u64 rx_multicast; +u64 rx_broadcast; +u64 rx_control_frames; +u64 rx_pause; +u64 rx_unknown_opcode; +u64 rx_alignment_error; +u64 rx_frame_length_error; +u64 rx_code_error; +u64 rx_carrier_sense_error; +u64 rx_undersize; +u64 rx_oversize; +u64 rx_fragments; +u64 rx_jabber; +u64 rx_drop; + +/* transmit stats */ +u64 tx_bytes; +u64 tx_packets; +u64 tx_multicast; +u64 tx_broadcast; +u64 tx_pause; +u64 tx_deferral; +u64 tx_excessive_deferral; +u64 tx_single_collision; +u64 tx_muliple_collision; +u64 tx_late_collision; +u64 tx_excessive_collision; +u64 tx_total_collision; +u64 tx_pause_honored; +u64 tx_drop; +u64 tx_jabber; +u64 tx_fcs_error; +u64 tx_control_frame; +u64 tx_oversize; +u64 tx_undersize; +u64 tx_fragments; +}; + +/** +* Complete statistics, DMAed from fw to host followed by +* BFI_ENET_I2H_STATS_GET_RSP +*/ +struct bfi_enet_stats { +struct bfi_enet_stats_mac mac_stats; +struct bfi_enet_stats_bpc bpc_stats; +struct bfi_enet_stats_rad rad_stats; +struct bfi_enet_stats_rad rlb_stats; +struct bfi_enet_stats_fc_rx fc_rx_stats; +struct bfi_enet_stats_fc_tx fc_tx_stats; +struct bfi_enet_stats_rxf rxf_stats[BFI_ENET_CFG_MAX ]; +struct bfi_enet_stats_txf txf_stats[BFI_ENET_CFG_MAX ]; +}; + +#pragma pack() + +#endif /* __BFI_ENET_H__ */
drivers/net/bna/bna_enet.c new file +2199 -0
2,098 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
1.7.1
Part of the diff is not shown here. View the raw message.
PATCH 8/45 bna: Tx and Rx Redesign
In reply to Rasesh ModyChange details:
- This patch contains the changes as a result of redesigning of Tx, Rx data path setup. In the old design, setting up Txqs, Rxqs were done in the driver. With the new design, most of the hardware setup steps for the Txq, Rxqs are moved to FW. Host driver issues commands to FW through the message queue to setup/teardown tx, rx data path. FW performs necessary steps and responds back to the driver with a status.
- As a result of this redesign, the state machine implementation for Tx, Rx objects have changed significantly. Instead of doing the raw register access, these state machines mostly send a command to FW and wait for response and take the next action. In addition to tx, rx datapath setup, this patch also deals with rx filter configuration - such as unicast address, multicast address, vlan filter, promiscuous mode etc.
--- drivers/net/bna/bna_txrx.c | 4385 +++++++++++++++++++++----------------------- 1 files changed, 2083 insertions(+), 2302 deletions(-)
drivers/net/bna/bna_txrx.c +2083 -2302
@@ -16,516 +16,68 @@* www.brocade.com */ #include "bna.h" -#include "bfa_sm.h" #include "bfi.h" /** * IB */ -#define bna_ib_find_free_ibidx (_mask, _pos)\ -do {\ - (_pos) = 0;\ - while (((_pos) < (BFI_IBIDX_MAX_SEGSIZE)) &&\ - ((1 << (_pos)) & (_mask)))\ - (_pos)++;\ -} while (0) - -#define bna_ib_count_ibidx (_mask, _count)\ -do {\ - int pos = 0;\ - (_count) = 0;\ - while (pos < (BFI_IBIDX_MAX_SEGSIZE)) {\ - if ((1 << pos) & (_mask))\ - (_count) = pos + 1;\ - pos++;\ - } \ -} while (0) - -#define bna_ib_select_segpool (_count, _q_idx)\ -do {\ - int i;\ - (_q_idx) = -1;\ - for (i = 0; i < BFI_IBIDX_TOTAL_POOLS; i++) {\ - if ((_count <= ibidx_pool[i].pool_entry_size)) {\ - (_q_idx) = i;\ - break;\ - } \ - } \ -} while (0) - -struct bna_ibidx_pool { -int pool_size; -int pool_entry_size; -}; -init_ibidx_pool (ibidx_pool); - -static struct bna_intr * -bna_intr_get (struct bna_ib_mod *ib_mod,enum bna_intr_type intr_type, -int vector) -{ -struct bna_intr *intr; -struct list_head *qe; - -list_for_each (qe, &ib_mod->intr_active_q) { - intr = (struct bna_intr *)qe; - -if ((intr->intr_type == intr_type) && - (intr->vector == vector)) { - intr->ref_count++; -return intr; - } - } - -if (list_empty (&ib_mod->intr_free_q)) -return NULL ; - -bfa_q_deq (&ib_mod->intr_free_q, &intr); -bfa_q_qe_init (&intr->qe); - - intr->ref_count =1 ; - intr->intr_type = intr_type; - intr->vector = vector; - -list_add_tail (&intr->qe, &ib_mod->intr_active_q); - -return intr; -} - -static void -bna_intr_put (struct bna_ib_mod *ib_mod, -struct bna_intr *intr) -{ - intr->ref_count--; - -if (intr->ref_count ==0 ) { - intr->ib =NULL ; -list_del (&intr->qe); -bfa_q_qe_init (&intr->qe); -list_add_tail (&intr->qe, &ib_mod->intr_free_q); - } -} -void -bna_ib_mod_init (struct bna_ib_mod *ib_mod,struct bna *bna, -struct bna_res_info *res_info) -{ -int i; -int j; -int count; -u8 offset; -struct bna_doorbell_qset *qset; -unsigned long off; - - ib_mod->bna = bna; - - ib_mod->ib = (struct bna_ib *) - res_info[BNA_RES_MEM_T_IB_ARRAY ].res_u.mem_info.mdl[0 ].kva; - ib_mod->intr = (struct bna_intr *) - res_info[BNA_RES_MEM_T_INTR_ARRAY ].res_u.mem_info.mdl[0 ].kva; - ib_mod->idx_seg = (struct bna_ibidx_seg *) - res_info[BNA_RES_MEM_T_IDXSEG_ARRAY ].res_u.mem_info.mdl[0 ].kva; - -INIT_LIST_HEAD (&ib_mod->ib_free_q); -INIT_LIST_HEAD (&ib_mod->intr_free_q); -INIT_LIST_HEAD (&ib_mod->intr_active_q); - -for (i =0 ; i <BFI_IBIDX_TOTAL_POOLS ; i++) -INIT_LIST_HEAD (&ib_mod->ibidx_seg_pool[i]); - -for (i =0 ; i <BFI_MAX_IB ; i++) { - ib_mod->ib[i].ib_id = i; - - ib_mod->ib[i].ib_seg_host_addr_kva = - res_info[BNA_RES_MEM_T_IBIDX ].res_u.mem_info.mdl[i].kva; - ib_mod->ib[i].ib_seg_host_addr.lsb = - res_info[BNA_RES_MEM_T_IBIDX ].res_u.mem_info.mdl[i].dma.lsb; - ib_mod->ib[i].ib_seg_host_addr.msb = - res_info[BNA_RES_MEM_T_IBIDX ].res_u.mem_info.mdl[i].dma.msb; - - qset = (struct bna_doorbell_qset *)0 ; - off = (unsigned long )(&qset[i >>1 ].ib0[(i &0x1 ) - * (0x20 >>2 )]); - ib_mod->ib[i].door_bell.doorbell_addr = off + -BNA_GET_DOORBELL_BASE_ADDR (bna->pcidev.pci_bar_kva); - -bfa_q_qe_init (&ib_mod->ib[i].qe); -list_add_tail (&ib_mod->ib[i].qe, &ib_mod->ib_free_q); - -bfa_q_qe_init (&ib_mod->intr[i].qe); -list_add_tail (&ib_mod->intr[i].qe, &ib_mod->intr_free_q); - } - - count =0 ; - offset =0 ; -for (i =0 ; i <BFI_IBIDX_TOTAL_POOLS ; i++) { -for (j =0 ; j < ibidx_pool[i].pool_size; j++) { -bfa_q_qe_init (&ib_mod->idx_seg[count]); - ib_mod->idx_seg[count].ib_seg_size = - ibidx_pool[i].pool_entry_size; - ib_mod->idx_seg[count].ib_idx_tbl_offset = offset; -list_add_tail (&ib_mod->idx_seg[count].qe, - &ib_mod->ibidx_seg_pool[i]); - count++; - offset += ibidx_pool[i].pool_entry_size; - } - } -} - -void -bna_ib_mod_uninit (struct bna_ib_mod *ib_mod) -{ -int i; -int j; -struct list_head *qe; - - i =0 ; -list_for_each (qe, &ib_mod->ib_free_q) - i++; - - i =0 ; -list_for_each (qe, &ib_mod->intr_free_q) - i++; - -for (i =0 ; i <BFI_IBIDX_TOTAL_POOLS ; i++) { - j =0 ; -list_for_each (qe, &ib_mod->ibidx_seg_pool[i]) - j++; - } - - ib_mod->bna =NULL ; -} - -static struct bna_ib * -bna_ib_get (struct bna_ib_mod *ib_mod, -enum bna_intr_type intr_type, -int vector) -{ -struct bna_ib *ib; -struct bna_intr *intr; - -if (intr_type ==BNA_INTR_T_INTX ) - vector = (1 << vector); - - intr =bna_intr_get (ib_mod, intr_type, vector); -if (intr ==NULL ) -return NULL ; - -if (intr->ib) { -if (intr->ib->ref_count ==BFI_IBIDX_MAX_SEGSIZE ) { -bna_intr_put (ib_mod, intr); -return NULL ; - } - intr->ib->ref_count++; -return intr->ib; - } - -if (list_empty (&ib_mod->ib_free_q)) { -bna_intr_put (ib_mod, intr); -return NULL ; - } - -bfa_q_deq (&ib_mod->ib_free_q, &ib); -bfa_q_qe_init (&ib->qe); - - ib->ref_count =1 ; - ib->start_count =0 ; - ib->idx_mask =0 ; - - ib->intr = intr; - ib->idx_seg =NULL ; - intr->ib = ib; - - ib->bna = ib_mod->bna; - -return ib; -} - -static void -bna_ib_put (struct bna_ib_mod *ib_mod,struct bna_ib *ib) -{ -bna_intr_put (ib_mod, ib->intr); - - ib->ref_count--; - -if (ib->ref_count ==0 ) { - ib->intr =NULL ; - ib->bna =NULL ; -list_add_tail (&ib->qe, &ib_mod->ib_free_q); - } -} - -/* Returns index offset - starting from 0 */ -static int -bna_ib_reserve_idx (struct bna_ib *ib) -{ -struct bna_ib_mod *ib_mod = &ib->bna->ib_mod; -struct bna_ibidx_seg *idx_seg; -int idx; -int num_idx; -int q_idx; - -/* Find the first free index position */ -bna_ib_find_free_ibidx (ib->idx_mask, idx); -if (idx ==BFI_IBIDX_MAX_SEGSIZE ) -return -1 ; - -/* -* Calculate the total number of indexes held by this IB, -* including the index newly reserved above. -*/ -bna_ib_count_ibidx ((ib->idx_mask | (1 << idx)), num_idx); - -/* See if there is a free space in the index segment held by this IB */ -if (ib->idx_seg && (num_idx <= ib->idx_seg->ib_seg_size)) { - ib->idx_mask |= (1 << idx); -return idx; - } - -if (ib->start_count) -return -1 ; - -/* Allocate a new segment */ -bna_ib_select_segpool (num_idx, q_idx); -while (1 ) { -if (q_idx ==BFI_IBIDX_TOTAL_POOLS ) -return -1 ; -if (!list_empty (&ib_mod->ibidx_seg_pool[q_idx])) -break ; - q_idx++; - } -bfa_q_deq (&ib_mod->ibidx_seg_pool[q_idx], &idx_seg); -bfa_q_qe_init (&idx_seg->qe); - -/* Free the old segment */ -if (ib->idx_seg) { -bna_ib_select_segpool (ib->idx_seg->ib_seg_size, q_idx); -list_add_tail (&ib->idx_seg->qe, &ib_mod->ibidx_seg_pool[q_idx]); - } - - ib->idx_seg = idx_seg; - - ib->idx_mask |= (1 << idx); - -return idx; -} - -static void -bna_ib_release_idx (struct bna_ib *ib,int idx) -{ -struct bna_ib_mod *ib_mod = &ib->bna->ib_mod; -struct bna_ibidx_seg *idx_seg; -int num_idx; -int cur_q_idx; -int new_q_idx; - - ib->idx_mask &= ~(1 << idx); - -if (ib->start_count) -return ; - -bna_ib_count_ibidx (ib->idx_mask, num_idx); - -/* -* Free the segment, if there are no more indexes in the segment -* held by this IB -*/ -if (!num_idx) { -bna_ib_select_segpool (ib->idx_seg->ib_seg_size, cur_q_idx); -list_add_tail (&ib->idx_seg->qe, - &ib_mod->ibidx_seg_pool[cur_q_idx]); - ib->idx_seg =NULL ; -return ; - } - -/* See if we can move to a smaller segment */ -bna_ib_select_segpool (num_idx, new_q_idx); -bna_ib_select_segpool (ib->idx_seg->ib_seg_size, cur_q_idx); -while (new_q_idx < cur_q_idx) { -if (!list_empty (&ib_mod->ibidx_seg_pool[new_q_idx])) -break ; - new_q_idx++; - } -if (new_q_idx < cur_q_idx) { -/* Select the new smaller segment */ -bfa_q_deq (&ib_mod->ibidx_seg_pool[new_q_idx], &idx_seg); -bfa_q_qe_init (&idx_seg->qe); -/* Free the old segment */ -list_add_tail (&ib->idx_seg->qe, - &ib_mod->ibidx_seg_pool[cur_q_idx]); - ib->idx_seg = idx_seg; - } -} - -static int -bna_ib_config (struct bna_ib *ib,struct bna_ib_config *ib_config) +bna_ib_coalescing_timeo_set (struct bna_ib *ib,u8 coalescing_timeo) { -if (ib->start_count) -return -1 ; - - ib->ib_config.coalescing_timeo = ib_config->coalescing_timeo; - ib->ib_config.interpkt_timeo = ib_config->interpkt_timeo; - ib->ib_config.interpkt_count = ib_config->interpkt_count; - ib->ib_config.ctrl_flags = ib_config->ctrl_flags; - - ib->ib_config.ctrl_flags |=BFI_IB_CF_MASTER_ENABLE ; -if (ib->intr->intr_type ==BNA_INTR_T_MSIX ) - ib->ib_config.ctrl_flags |=BFI_IB_CF_MSIX_MODE ; - -return 0 ; -} - -static void -bna_ib_start (struct bna_ib *ib) -{ -struct bna_ib_blk_mem ib_cfg; -struct bna_ib_blk_mem *ib_mem; -u32 pg_num; -u32 intx_mask; -int i; -void __iomem *base_addr; -unsigned long off; - - ib->start_count++; - -if (ib->start_count >1 ) -return ; - - ib_cfg.host_addr_lo = (u32)(ib->ib_seg_host_addr.lsb); - ib_cfg.host_addr_hi = (u32)(ib->ib_seg_host_addr.msb); - - ib_cfg.clsc_n_ctrl_n_msix = (((u32 ) - ib->ib_config.coalescing_timeo <<16 ) | - ((u32 )ib->ib_config.ctrl_flags <<8 ) | - (ib->intr->vector)); - ib_cfg.ipkt_n_ent_n_idxof = - ((u32) - (ib->ib_config.interpkt_timeo &0xf ) <<16 ) | - ((u32 )ib->idx_seg->ib_seg_size <<8 ) | - (ib->idx_seg->ib_idx_tbl_offset); - ib_cfg.ipkt_cnt_cfg_n_unacked = ((u32 ) - ib->ib_config.interpkt_count <<24 ); - - pg_num =BNA_GET_PAGE_NUM (HQM0_BLK_PG_NUM + ib->bna->port_num, -HQM_IB_RAM_BASE_OFFSET ); -writel (pg_num, ib->bna->regs.page_addr); - - base_addr =BNA_GET_MEM_BASE_ADDR (ib->bna->pcidev.pci_bar_kva, -HQM_IB_RAM_BASE_OFFSET ); - - ib_mem = (struct bna_ib_blk_mem *)0 ; - off = (unsigned long )&ib_mem[ib->ib_id].host_addr_lo; -writel (htonl (ib_cfg.host_addr_lo), base_addr + off); - - off = (unsigned long )&ib_mem[ib->ib_id].host_addr_hi; -writel (htonl (ib_cfg.host_addr_hi), base_addr + off); - - off = (unsigned long )&ib_mem[ib->ib_id].clsc_n_ctrl_n_msix; -writel (ib_cfg.clsc_n_ctrl_n_msix, base_addr + off); - - off = (unsigned long )&ib_mem[ib->ib_id].ipkt_n_ent_n_idxof; -writel (ib_cfg.ipkt_n_ent_n_idxof, base_addr + off); - - off = (unsigned long )&ib_mem[ib->ib_id].ipkt_cnt_cfg_n_unacked; -writel (ib_cfg.ipkt_cnt_cfg_n_unacked, base_addr + off); - + ib->coalescing_timeo = coalescing_timeo; ib->door_bell.doorbell_ack =BNA_DOORBELL_IB_INT_ACK ( - (u32 )ib->ib_config.coalescing_timeo,0 ); - - pg_num =BNA_GET_PAGE_NUM (HQM0_BLK_PG_NUM + ib->bna->port_num, -HQM_INDX_TBL_RAM_BASE_OFFSET ); -writel (pg_num, ib->bna->regs.page_addr); - - base_addr =BNA_GET_MEM_BASE_ADDR (ib->bna->pcidev.pci_bar_kva, -HQM_INDX_TBL_RAM_BASE_OFFSET ); -for (i =0 ; i < ib->idx_seg->ib_seg_size; i++) { - off = (unsigned long ) - ((ib->idx_seg->ib_idx_tbl_offset + i) *BFI_IBIDX_SIZE ); -writel (0 , base_addr + off); - } - -if (ib->intr->intr_type ==BNA_INTR_T_INTX ) { -bna_intx_disable (ib->bna, intx_mask); - intx_mask &= ~(ib->intr->vector); -bna_intx_enable (ib->bna, intx_mask); - } -} - -static void -bna_ib_stop (struct bna_ib *ib) -{ -u32 intx_mask; - - ib->start_count--; - -if (ib->start_count ==0 ) { -writel (BNA_DOORBELL_IB_INT_DISABLE , - ib->door_bell.doorbell_addr); -if (ib->intr->intr_type ==BNA_INTR_T_INTX ) { -bna_intx_disable (ib->bna, intx_mask); - intx_mask |= (ib->intr->vector); -bna_intx_enable (ib->bna, intx_mask); - } - } -} - -static void -bna_ib_fail (struct bna_ib *ib) -{ - ib->start_count =0 ; + (u32 )ib->coalescing_timeo,0 ); }/** * RXF */ -static void rxf_enable (struct bna_rxf *rxf); -static void rxf_disable (struct bna_rxf *rxf); -static void __rxf_config_set (struct bna_rxf *rxf); -static void __rxf_rit_set (struct bna_rxf *rxf); -static void __bna_rxf_stat_clr (struct bna_rxf *rxf); -static int rxf_process_packet_filter (struct bna_rxf *rxf); -static int rxf_clear_packet_filter (struct bna_rxf *rxf); -static void rxf_reset_packet_filter (struct bna_rxf *rxf); -static void rxf_cb_enabled (void *arg,int status); -static void rxf_cb_disabled (void *arg,int status); -static void bna_rxf_cb_stats_cleared (void *arg,int status); -static void __rxf_enable (struct bna_rxf *rxf); -static void __rxf_disable (struct bna_rxf *rxf); + +#define bna_rxf_vlan_cfg_soft_reset (rxf) \ +do { \ + (rxf)->vlan_pending_bitmask = (u8)BFI_VLAN_BMASK_ALL; \ + (rxf)->vlan_strip_pending = true; \ +} while (0) + +#define bna_rxf_rss_cfg_soft_reset (rxf) \ +do { \ + if ((rxf)->rss_status == BNA_STATUS_T_ENABLED) \ + (rxf)->rss_pending = (BNA_RSS_F_RIT_PENDING | \ + BNA_RSS_F_CFG_PENDING | \ + BNA_RSS_F_STATUS_PENDING); \ +} while (0) + +static int bna_rxf_cfg_apply (struct bna_rxf *rxf); +static void bna_rxf_cfg_reset (struct bna_rxf *rxf); +static int bna_rxf_fltr_clear (struct bna_rxf *rxf); +static int bna_rxf_ucast_cfg_apply (struct bna_rxf *rxf); +static int bna_rxf_promisc_cfg_apply (struct bna_rxf *rxf); +static int bna_rxf_allmulti_cfg_apply (struct bna_rxf *rxf); +static int bna_rxf_vlan_strip_cfg_apply (struct bna_rxf *rxf); +static int bna_rxf_ucast_cfg_reset (struct bna_rxf *rxf, +enum bna_cleanup_type cleanup); +static int bna_rxf_promisc_cfg_reset (struct bna_rxf *rxf, +enum bna_cleanup_type cleanup); +static int bna_rxf_allmulti_cfg_reset (struct bna_rxf *rxf, +enum bna_cleanup_type cleanup); bfa_fsm_state_decl(bna_rxf, stopped, struct bna_rxf, enum bna_rxf_event); -bfa_fsm_state_decl(bna_rxf, start_wait, struct bna_rxf, +bfa_fsm_state_decl(bna_rxf, paused, struct bna_rxf, enum bna_rxf_event); -bfa_fsm_state_decl(bna_rxf, cam_fltr_mod_wait, struct bna_rxf, +bfa_fsm_state_decl(bna_rxf, cfg_wait, struct bna_rxf, enum bna_rxf_event); bfa_fsm_state_decl(bna_rxf, started, struct bna_rxf, enum bna_rxf_event); -bfa_fsm_state_decl(bna_rxf, cam_fltr_clr_wait, struct bna_rxf, - enum bna_rxf_event); -bfa_fsm_state_decl(bna_rxf, stop_wait, struct bna_rxf, - enum bna_rxf_event); -bfa_fsm_state_decl(bna_rxf, pause_wait, struct bna_rxf, +bfa_fsm_state_decl(bna_rxf, fltr_clr_wait, struct bna_rxf, enum bna_rxf_event); -bfa_fsm_state_decl(bna_rxf, resume_wait, struct bna_rxf, +bfa_fsm_state_decl(bna_rxf, last_resp_wait, struct bna_rxf, enum bna_rxf_event); -bfa_fsm_state_decl(bna_rxf, stat_clr_wait, struct bna_rxf, - enum bna_rxf_event); - -static struct bfa_sm_table rxf_sm_table[] = { - {BFA_SM (bna_rxf_sm_stopped),BNA_RXF_STOPPED }, - {BFA_SM (bna_rxf_sm_start_wait),BNA_RXF_START_WAIT }, - {BFA_SM (bna_rxf_sm_cam_fltr_mod_wait),BNA_RXF_CAM_FLTR_MOD_WAIT }, - {BFA_SM (bna_rxf_sm_started),BNA_RXF_STARTED }, - {BFA_SM (bna_rxf_sm_cam_fltr_clr_wait),BNA_RXF_CAM_FLTR_CLR_WAIT }, - {BFA_SM (bna_rxf_sm_stop_wait),BNA_RXF_STOP_WAIT }, - {BFA_SM (bna_rxf_sm_pause_wait),BNA_RXF_PAUSE_WAIT }, - {BFA_SM (bna_rxf_sm_resume_wait),BNA_RXF_RESUME_WAIT }, - {BFA_SM (bna_rxf_sm_stat_clr_wait),BNA_RXF_STAT_CLR_WAIT } -};static void bna_rxf_sm_stopped_entry (struct bna_rxf *rxf) { -call_rxf_stop_cbfn (rxf,BNA_CB_SUCCESS ); +call_rxf_stop_cbfn (rxf); } static void
@@ -533,39 +85,33 @@ bna_rxf_sm_stopped(struct bna_rxf *rxf, enum bna_rxf_event event) {switch (event) {case RXF_E_START : -bfa_fsm_set_state (rxf, bna_rxf_sm_start_wait); +if (rxf->flags &BNA_RXF_F_PAUSED ) { +bfa_fsm_set_state (rxf, bna_rxf_sm_paused); +call_rxf_start_cbfn (rxf); + }else +bfa_fsm_set_state (rxf, bna_rxf_sm_cfg_wait);break ;case RXF_E_STOP : -bfa_fsm_set_state (rxf, bna_rxf_sm_stopped); +call_rxf_stop_cbfn (rxf);break ;case RXF_E_FAIL :/* No-op */ break ; -case RXF_E_CAM_FLTR_MOD : -call_rxf_cam_fltr_cbfn (rxf,BNA_CB_SUCCESS ); -break ; - -case RXF_E_STARTED : -case RXF_E_STOPPED : -case RXF_E_CAM_FLTR_RESP : -/** -* These events are received due to flushing of mbox -* when device fails -*/ -/* No-op */ +case RXF_E_CONFIG : +call_rxf_cam_fltr_cbfn (rxf);break ;case RXF_E_PAUSE : - rxf->rxf_oper_state =BNA_RXF_OPER_STATE_PAUSED ; -call_rxf_pause_cbfn (rxf,BNA_CB_SUCCESS ); + rxf->flags |=BNA_RXF_F_PAUSED ; +call_rxf_pause_cbfn (rxf);break ;case RXF_E_RESUME : - rxf->rxf_oper_state =BNA_RXF_OPER_STATE_RUNNING ; -call_rxf_resume_cbfn (rxf,BNA_CB_SUCCESS ); + rxf->flags &= ~BNA_RXF_F_PAUSED ; +call_rxf_resume_cbfn (rxf);break ;default :
@@ -574,56 +120,27 @@ bna_rxf_sm_stopped(struct bna_rxf *rxf, enum bna_rxf_event event) }static void -bna_rxf_sm_start_wait_entry (struct bna_rxf *rxf) +bna_rxf_sm_paused_entry (struct bna_rxf *rxf) { -__rxf_config_set (rxf); -__rxf_rit_set (rxf); -rxf_enable (rxf); +call_rxf_pause_cbfn (rxf); }static void -bna_rxf_sm_start_wait (struct bna_rxf *rxf,enum bna_rxf_event event) +bna_rxf_sm_paused (struct bna_rxf *rxf,enum bna_rxf_event event) {switch (event) {case RXF_E_STOP : -/** -* STOP is originated from bnad. When this happens, -* it can not be waiting for filter update -*/ -call_rxf_start_cbfn (rxf,BNA_CB_INTERRUPT ); -bfa_fsm_set_state (rxf, bna_rxf_sm_stop_wait); -break ; -case RXF_E_FAIL : -call_rxf_cam_fltr_cbfn (rxf,BNA_CB_SUCCESS ); -call_rxf_start_cbfn (rxf,BNA_CB_FAIL );bfa_fsm_set_state (rxf, bna_rxf_sm_stopped);break ; -case RXF_E_CAM_FLTR_MOD : -/* No-op */ +case RXF_E_CONFIG : +call_rxf_cam_fltr_cbfn (rxf);break ; -case RXF_E_STARTED : -/** -* Force rxf_process_filter() to go through initial -* config -*/ -if ((rxf->ucast_active_mac !=NULL ) && - (rxf->ucast_pending_set ==0 )) - rxf->ucast_pending_set =1 ; - -if (rxf->rss_status ==BNA_STATUS_T_ENABLED ) - rxf->rxf_flags |=BNA_RXF_FL_RSS_CONFIG_PENDING ; - - rxf->rxf_flags |=BNA_RXF_FL_VLAN_CONFIG_PENDING ; - -bfa_fsm_set_state (rxf, bna_rxf_sm_cam_fltr_mod_wait); -break ; - -case RXF_E_PAUSE :case RXF_E_RESUME : - rxf->rxf_flags |=BNA_RXF_FL_OPERSTATE_CHANGED ; + rxf->flags &= ~BNA_RXF_F_PAUSED ; +bfa_fsm_set_state (rxf, bna_rxf_sm_cfg_wait);break ;default :
@@ -632,49 +149,45 @@ bna_rxf_sm_start_wait(struct bna_rxf *rxf, enum bna_rxf_event event) }static void -bna_rxf_sm_cam_fltr_mod_wait_entry (struct bna_rxf *rxf) +bna_rxf_sm_cfg_wait_entry (struct bna_rxf *rxf) { -if (!rxf_process_packet_filter (rxf)) { -/* No more pending CAM entries to update */ +if (!bna_rxf_cfg_apply (rxf)) { +/* No more pending config updates */ bfa_fsm_set_state (rxf, bna_rxf_sm_started); } }static void -bna_rxf_sm_cam_fltr_mod_wait (struct bna_rxf *rxf,enum bna_rxf_event event) +bna_rxf_sm_cfg_wait (struct bna_rxf *rxf,enum bna_rxf_event event) {switch (event) {case RXF_E_STOP : -/** -* STOP is originated from bnad. When this happens, -* it can not be waiting for filter update -*/ -call_rxf_start_cbfn (rxf,BNA_CB_INTERRUPT ); -bfa_fsm_set_state (rxf, bna_rxf_sm_cam_fltr_clr_wait); +bfa_fsm_set_state (rxf, bna_rxf_sm_last_resp_wait);break ;case RXF_E_FAIL : -rxf_reset_packet_filter (rxf); -call_rxf_cam_fltr_cbfn (rxf,BNA_CB_SUCCESS ); -call_rxf_start_cbfn (rxf,BNA_CB_FAIL ); +bna_rxf_cfg_reset (rxf); +call_rxf_start_cbfn (rxf); +call_rxf_cam_fltr_cbfn (rxf); +call_rxf_resume_cbfn (rxf);bfa_fsm_set_state (rxf, bna_rxf_sm_stopped);break ; -case RXF_E_CAM_FLTR_MOD : +case RXF_E_CONFIG :/* No-op */ break ; -case RXF_E_CAM_FLTR_RESP : -if (!rxf_process_packet_filter (rxf)) { -/* No more pending CAM entries to update */ -call_rxf_cam_fltr_cbfn (rxf,BNA_CB_SUCCESS ); -bfa_fsm_set_state (rxf, bna_rxf_sm_started); - } +case RXF_E_PAUSE : + rxf->flags |=BNA_RXF_F_PAUSED ; +call_rxf_start_cbfn (rxf); +bfa_fsm_set_state (rxf, bna_rxf_sm_fltr_clr_wait);break ; -case RXF_E_PAUSE : -case RXF_E_RESUME : - rxf->rxf_flags |=BNA_RXF_FL_OPERSTATE_CHANGED ; +case RXF_E_FW_RESP : +if (!bna_rxf_cfg_apply (rxf)) { +/* No more pending config updates */ +bfa_fsm_set_state (rxf, bna_rxf_sm_started); + }break ;default :
@@ -685,15 +198,9 @@ bna_rxf_sm_cam_fltr_mod_wait(struct bna_rxf *rxf, enum bna_rxf_event event)static void bna_rxf_sm_started_entry (struct bna_rxf *rxf) { -call_rxf_start_cbfn (rxf,BNA_CB_SUCCESS ); - -if (rxf->rxf_flags &BNA_RXF_FL_OPERSTATE_CHANGED ) { -if (rxf->rxf_oper_state ==BNA_RXF_OPER_STATE_PAUSED ) -bfa_fsm_send_event (rxf,RXF_E_PAUSE ); -else -bfa_fsm_send_event (rxf,RXF_E_RESUME ); - } - +call_rxf_start_cbfn (rxf); +call_rxf_cam_fltr_cbfn (rxf); +call_rxf_resume_cbfn (rxf); } static void
@@ -701,26 +208,21 @@ bna_rxf_sm_started(struct bna_rxf *rxf, enum bna_rxf_event event) {switch (event) {case RXF_E_STOP : -bfa_fsm_set_state (rxf, bna_rxf_sm_cam_fltr_clr_wait); -/* Hack to get FSM start clearing CAM entries */ -bfa_fsm_send_event (rxf,RXF_E_CAM_FLTR_RESP ); -break ; -case RXF_E_FAIL : -rxf_reset_packet_filter (rxf); +bna_rxf_cfg_reset (rxf);bfa_fsm_set_state (rxf, bna_rxf_sm_stopped);break ; -case RXF_E_CAM_FLTR_MOD : -bfa_fsm_set_state (rxf, bna_rxf_sm_cam_fltr_mod_wait); +case RXF_E_CONFIG : +bfa_fsm_set_state (rxf, bna_rxf_sm_cfg_wait);break ;case RXF_E_PAUSE : -bfa_fsm_set_state (rxf, bna_rxf_sm_pause_wait); -break ; - -case RXF_E_RESUME : -bfa_fsm_set_state (rxf, bna_rxf_sm_resume_wait); + rxf->flags |=BNA_RXF_F_PAUSED ; +if (!bna_rxf_fltr_clear (rxf)) +bfa_fsm_set_state (rxf, bna_rxf_sm_paused); +else +bfa_fsm_set_state (rxf, bna_rxf_sm_fltr_clr_wait);break ;default :
@@ -729,34 +231,24 @@ bna_rxf_sm_started(struct bna_rxf *rxf, enum bna_rxf_event event) }static void -bna_rxf_sm_cam_fltr_clr_wait_entry (struct bna_rxf *rxf) +bna_rxf_sm_fltr_clr_wait_entry (struct bna_rxf *rxf) { -/** -* Note: Do not add rxf_clear_packet_filter here. -* It will overstep mbox when this transition happens: -* cam_fltr_mod_wait -> cam_fltr_clr_wait on RXF_E_STOP event -*/ }static void -bna_rxf_sm_cam_fltr_clr_wait (struct bna_rxf *rxf,enum bna_rxf_event event) +bna_rxf_sm_fltr_clr_wait (struct bna_rxf *rxf,enum bna_rxf_event event) {switch (event) {case RXF_E_FAIL : -/** -* FSM was in the process of stopping, initiated by -* bnad. When this happens, no one can be waiting for -* start or filter update -*/ -rxf_reset_packet_filter (rxf); +bna_rxf_cfg_reset (rxf); +call_rxf_pause_cbfn (rxf);bfa_fsm_set_state (rxf, bna_rxf_sm_stopped);break ; -case RXF_E_CAM_FLTR_RESP : -if (!rxf_clear_packet_filter (rxf)) { +case RXF_E_FW_RESP : +if (!bna_rxf_fltr_clear (rxf)) {/* No more pending CAM entries to clear */ -bfa_fsm_set_state (rxf, bna_rxf_sm_stop_wait); -rxf_disable (rxf); +bfa_fsm_set_state (rxf, bna_rxf_sm_paused); }break ;
@@ -766,674 +258,518 @@ bna_rxf_sm_cam_fltr_clr_wait(struct bna_rxf *rxf, enum bna_rxf_event event) }static void -bna_rxf_sm_stop_wait_entry (struct bna_rxf *rxf) +bna_rxf_sm_last_resp_wait_entry (struct bna_rxf *rxf) { -/** -* NOTE: Do not add rxf_disable here. -* It will overstep mbox when this transition happens: -* start_wait -> stop_wait on RXF_E_STOP event -*/ }static void -bna_rxf_sm_stop_wait (struct bna_rxf *rxf,enum bna_rxf_event event) +bna_rxf_sm_last_resp_wait (struct bna_rxf *rxf,enum bna_rxf_event event) {switch (event) {case RXF_E_FAIL : -/** -* FSM was in the process of stopping, initiated by -* bnad. When this happens, no one can be waiting for -* start or filter update -*/ +case RXF_E_FW_RESP : +bna_rxf_cfg_reset (rxf);bfa_fsm_set_state (rxf, bna_rxf_sm_stopped);break ; -case RXF_E_STARTED : -/** -* This event is received due to abrupt transition from -* bna_rxf_sm_start_wait state on receiving -* RXF_E_STOP event -*/ -rxf_disable (rxf); -break ; - -case RXF_E_STOPPED : -/** -* FSM was in the process of stopping, initiated by -* bnad. When this happens, no one can be waiting for -* start or filter update -*/ -bfa_fsm_set_state (rxf, bna_rxf_sm_stat_clr_wait); -break ; - -case RXF_E_PAUSE : - rxf->rxf_oper_state =BNA_RXF_OPER_STATE_PAUSED ; -break ; - -case RXF_E_RESUME : - rxf->rxf_oper_state =BNA_RXF_OPER_STATE_RUNNING ; -break ; -default :bfa_sm_fault (event); } }static void -bna_rxf_sm_pause_wait_entry (struct bna_rxf *rxf) +bna_bfi_ucast_req (struct bna_rxf *rxf,struct bna_mac *mac, +enum bfi_enet_h2i_msgs req_type) { - rxf->rxf_flags &= - ~(BNA_RXF_FL_OPERSTATE_CHANGED |BNA_RXF_FL_RXF_ENABLED ); -__rxf_disable (rxf); -} - -static void -bna_rxf_sm_pause_wait (struct bna_rxf *rxf,enum bna_rxf_event event) -{ -switch (event) { -case RXF_E_FAIL : -/** -* FSM was in the process of disabling rxf, initiated by -* bnad. -*/ -call_rxf_pause_cbfn (rxf,BNA_CB_FAIL ); -bfa_fsm_set_state (rxf, bna_rxf_sm_stopped); -break ; - -case RXF_E_STOPPED : - rxf->rxf_oper_state =BNA_RXF_OPER_STATE_PAUSED ; -call_rxf_pause_cbfn (rxf,BNA_CB_SUCCESS ); -bfa_fsm_set_state (rxf, bna_rxf_sm_started); -break ; +struct bfi_enet_ucast_req *req = &rxf->bfi_enet_cmd.ucast_req; -/* -* Since PAUSE/RESUME can only be sent by bnad, we don't expect -* any other event during these states -*/ -default : -bfa_sm_fault (event); - } -} - -static void -bna_rxf_sm_resume_wait_entry (struct bna_rxf *rxf) -{ - rxf->rxf_flags &= ~(BNA_RXF_FL_OPERSTATE_CHANGED ); - rxf->rxf_flags |=BNA_RXF_FL_RXF_ENABLED ; -__rxf_enable (rxf); +bfi_msgq_mhdr_set (req->mh,BFI_MC_ENET , req_type,0 , rxf->rx->rid); + req->mh.num_entries =htons ( +bfi_msgq_num_cmd_entries (sizeof (struct bfi_enet_ucast_req ))); +memcpy (&req->mac_addr, &mac->addr,sizeof (mac_t)); +bfa_msgq_cmd_set (&rxf->msgq_cmd,NULL ,NULL , +sizeof (struct bfi_enet_ucast_req ), &req->mh); +bfa_msgq_cmd_post (&rxf->rx->bna->msgq, &rxf->msgq_cmd); }static void -bna_rxf_sm_resume_wait (struct bna_rxf *rxf,enum bna_rxf_event event) +bna_bfi_mcast_add_req (struct bna_rxf *rxf,struct bna_mac *mac) { -switch (event) { -case RXF_E_FAIL : -/** -* FSM was in the process of disabling rxf, initiated by -* bnad. -*/ -call_rxf_resume_cbfn (rxf,BNA_CB_FAIL ); -bfa_fsm_set_state (rxf, bna_rxf_sm_stopped); -break ; - -case RXF_E_STARTED : - rxf->rxf_oper_state =BNA_RXF_OPER_STATE_RUNNING ; -call_rxf_resume_cbfn (rxf,BNA_CB_SUCCESS ); -bfa_fsm_set_state (rxf, bna_rxf_sm_started); -break ; +struct bfi_enet_mcast_add_req *req = + &rxf->bfi_enet_cmd.mcast_add_req; -/* -* Since PAUSE/RESUME can only be sent by bnad, we don't expect -* any other event during these states -*/ -default : -bfa_sm_fault (event); - } +bfi_msgq_mhdr_set (req->mh,BFI_MC_ENET ,BFI_ENET_H2I_MAC_MCAST_ADD_REQ , +0 , rxf->rx->rid); + req->mh.num_entries =htons ( +bfi_msgq_num_cmd_entries (sizeof (struct bfi_enet_mcast_add_req ))); +memcpy (&req->mac_addr, &mac->addr,sizeof (mac_t)); +bfa_msgq_cmd_set (&rxf->msgq_cmd,NULL ,NULL , +sizeof (struct bfi_enet_mcast_add_req ), &req->mh); +bfa_msgq_cmd_post (&rxf->rx->bna->msgq, &rxf->msgq_cmd); }static void -bna_rxf_sm_stat_clr_wait_entry (struct bna_rxf *rxf) +bna_bfi_mcast_del_req (struct bna_rxf *rxf,u16 handle) { -__bna_rxf_stat_clr (rxf); -} +struct bfi_enet_mcast_del_req *req = + &rxf->bfi_enet_cmd.mcast_del_req; -static void -bna_rxf_sm_stat_clr_wait (struct bna_rxf *rxf,enum bna_rxf_event event) -{ -switch (event) { -case RXF_E_FAIL : -case RXF_E_STAT_CLEARED : -bfa_fsm_set_state (rxf, bna_rxf_sm_stopped); -break ; - -default : -bfa_sm_fault (event); - } +bfi_msgq_mhdr_set (req->mh,BFI_MC_ENET ,BFI_ENET_H2I_MAC_MCAST_DEL_REQ , +0 , rxf->rx->rid); + req->mh.num_entries =htons ( +bfi_msgq_num_cmd_entries (sizeof (struct bfi_enet_mcast_del_req ))); + req->handle =htons (handle); +bfa_msgq_cmd_set (&rxf->msgq_cmd,NULL ,NULL , +sizeof (struct bfi_enet_mcast_del_req ), &req->mh); +bfa_msgq_cmd_post (&rxf->rx->bna->msgq, &rxf->msgq_cmd); }static void -__rxf_enable (struct bna_rxf *rxf) +bna_bfi_mcast_filter_req (struct bna_rxf *rxf,enum bna_status status) { -struct bfi_ll_rxf_multi_req ll_req; -u32 bm[2 ] = {0 ,0 }; - -if (rxf->rxf_id <32 ) - bm[0 ] =1 << rxf->rxf_id; -else - bm[1 ] =1 << (rxf->rxf_id -32 ); +struct bfi_enet_enable_req *req = &rxf->bfi_enet_cmd.req; -bfi_h2i_set (ll_req.mh,BFI_MC_LL ,BFI_LL_H2I_RX_REQ ,0 ); - ll_req.rxf_id_mask[0 ] =htonl (bm[0 ]); - ll_req.rxf_id_mask[1 ] =htonl (bm[1 ]); - ll_req.enable =1 ; - -bna_mbox_qe_fill (&rxf->mbox_qe, &ll_req,sizeof (ll_req), - rxf_cb_enabled, rxf); - -bna_mbox_send (rxf->rx->bna, &rxf->mbox_qe); +bfi_msgq_mhdr_set (req->mh,BFI_MC_ENET , +BFI_ENET_H2I_MAC_MCAST_FILTER_REQ ,0 , rxf->rx->rid); + req->mh.num_entries =htons ( +bfi_msgq_num_cmd_entries (sizeof (struct bfi_enet_enable_req ))); + req->enable = status; +bfa_msgq_cmd_set (&rxf->msgq_cmd,NULL ,NULL , +sizeof (struct bfi_enet_enable_req ), &req->mh); +bfa_msgq_cmd_post (&rxf->rx->bna->msgq, &rxf->msgq_cmd); }static void -__rxf_disable (struct bna_rxf *rxf) +bna_bfi_rx_promisc_req (struct bna_rxf *rxf,enum bna_status status) { -struct bfi_ll_rxf_multi_req ll_req; -u32 bm[2 ] = {0 ,0 }; - -if (rxf->rxf_id <32 ) - bm[0 ] =1 << rxf->rxf_id; -else - bm[1 ] =1 << (rxf->rxf_id -32 ); - -bfi_h2i_set (ll_req.mh,BFI_MC_LL ,BFI_LL_H2I_RX_REQ ,0 ); - ll_req.rxf_id_mask[0 ] =htonl (bm[0 ]); - ll_req.rxf_id_mask[1 ] =htonl (bm[1 ]); - ll_req.enable =0 ; - -bna_mbox_qe_fill (&rxf->mbox_qe, &ll_req,sizeof (ll_req), - rxf_cb_disabled, rxf); +struct bfi_enet_enable_req *req = &rxf->bfi_enet_cmd.req; -bna_mbox_send (rxf->rx->bna, &rxf->mbox_qe); +bfi_msgq_mhdr_set (req->mh,BFI_MC_ENET , +BFI_ENET_H2I_RX_PROMISCUOUS_REQ ,0 , rxf->rx->rid); + req->mh.num_entries =htons ( +bfi_msgq_num_cmd_entries (sizeof (struct bfi_enet_enable_req ))); + req->enable = status; +bfa_msgq_cmd_set (&rxf->msgq_cmd,NULL ,NULL , +sizeof (struct bfi_enet_enable_req ), &req->mh); +bfa_msgq_cmd_post (&rxf->rx->bna->msgq, &rxf->msgq_cmd); }static void -__rxf_config_set (struct bna_rxf *rxf) -{ -u32 i; -struct bna_rss_mem *rss_mem; -struct bna_rx_fndb_ram *rx_fndb_ram; -struct bna *bna = rxf->rx->bna; -void __iomem *base_addr; -unsigned long off; - - base_addr =BNA_GET_MEM_BASE_ADDR (bna->pcidev.pci_bar_kva, -RSS_TABLE_BASE_OFFSET ); - - rss_mem = (struct bna_rss_mem *)0 ; - -/* Configure RSS if required */ -if (rxf->ctrl_flags &BNA_RXF_CF_RSS_ENABLE ) { -/* configure RSS Table */ -writel (BNA_GET_PAGE_NUM (RAD0_MEM_BLK_BASE_PG_NUM + - bna->port_num,RSS_TABLE_BASE_OFFSET ), - bna->regs.page_addr); - -/* temporarily disable RSS, while hash value is written */ - off = (unsigned long )&rss_mem[0 ].type_n_hash; -writel (0 , base_addr + off); - -for (i =0 ; i <BFI_RSS_HASH_KEY_LEN ; i++) { - off = (unsigned long ) - &rss_mem[0 ].hash_key[(BFI_RSS_HASH_KEY_LEN -1 ) - i]; -writel (htonl (rxf->rss_cfg.toeplitz_hash_key[i]), - base_addr + off); - } - - off = (unsigned long )&rss_mem[0 ].type_n_hash; -writel (rxf->rss_cfg.hash_type | rxf->rss_cfg.hash_mask, - base_addr + off); - } - -/* Configure RxF */ -writel (BNA_GET_PAGE_NUM ( -LUT0_MEM_BLK_BASE_PG_NUM + (bna->port_num *2 ), -RX_FNDB_RAM_BASE_OFFSET ), - bna->regs.page_addr); - - base_addr =BNA_GET_MEM_BASE_ADDR (bna->pcidev.pci_bar_kva, -RX_FNDB_RAM_BASE_OFFSET ); - - rx_fndb_ram = (struct bna_rx_fndb_ram *)0 ; - -/* We always use RSS table 0 */ - off = (unsigned long )&rx_fndb_ram[rxf->rxf_id].rss_prop; -writel (rxf->ctrl_flags &BNA_RXF_CF_RSS_ENABLE , - base_addr + off); - -/* small large buffer enable/disable */ - off = (unsigned long )&rx_fndb_ram[rxf->rxf_id].size_routing_props; -writel ((rxf->ctrl_flags &BNA_RXF_CF_SM_LG_RXQ ) |0x80 , - base_addr + off); - -/* RIT offset, HDS forced offset, multicast RxQ Id */ - off = (unsigned long )&rx_fndb_ram[rxf->rxf_id].rit_hds_mcastq; -writel ((rxf->rit_segment->rit_offset <<16 ) | - (rxf->forced_offset <<8 ) | - (rxf->hds_cfg.hdr_type &BNA_HDS_FORCED ) | rxf->mcast_rxq_id, - base_addr + off); - -/* -* default vlan tag, default function enable, strip vlan bytes, -* HDS type, header size -*/ - - off = (unsigned long )&rx_fndb_ram[rxf->rxf_id].control_flags; -writel (((u32 )rxf->default_vlan_tag <<16 ) | - (rxf->ctrl_flags & - (BNA_RXF_CF_DEFAULT_VLAN | -BNA_RXF_CF_DEFAULT_FUNCTION_ENABLE | -BNA_RXF_CF_VLAN_STRIP )) | - (rxf->hds_cfg.hdr_type & ~BNA_HDS_FORCED ) | - rxf->hds_cfg.header_size, - base_addr + off); -} - -void -__rxf_vlan_filter_set (struct bna_rxf *rxf,enum bna_status status) +bna_bfi_rx_vlan_filter_set (struct bna_rxf *rxf,u8 block_idx) { -struct bna *bna = rxf->rx->bna; +struct bfi_enet_rx_vlan_req *req = &rxf->bfi_enet_cmd.vlan_req;int i; +int j; -writel (BNA_GET_PAGE_NUM (LUT0_MEM_BLK_BASE_PG_NUM + - (bna->port_num *2 ),VLAN_RAM_BASE_OFFSET ), - bna->regs.page_addr); - -if (status ==BNA_STATUS_T_ENABLED ) { -/* enable VLAN filtering on this function */ -for (i =0 ; i <=BFI_MAX_VLAN /32 ; i++) { -writel (rxf->vlan_filter_table[i], -BNA_GET_VLAN_MEM_ENTRY_ADDR - (bna->pcidev.pci_bar_kva, rxf->rxf_id, - i *32 )); - } - }else { -/* disable VLAN filtering on this function */ -for (i =0 ; i <=BFI_MAX_VLAN /32 ; i++) { -writel (0xffffffff , -BNA_GET_VLAN_MEM_ENTRY_ADDR - (bna->pcidev.pci_bar_kva, rxf->rxf_id, - i *32 )); - } +bfi_msgq_mhdr_set (req->mh,BFI_MC_ENET , +BFI_ENET_H2I_RX_VLAN_SET_REQ ,0 , rxf->rx->rid); + req->mh.num_entries =htons ( +bfi_msgq_num_cmd_entries (sizeof (struct bfi_enet_rx_vlan_req ))); + req->block_idx = block_idx; +for (i =0 ; i < (BFI_ENET_VLAN_BLOCK_SIZE /32 ); i++) { + j = (block_idx * (BFI_ENET_VLAN_BLOCK_SIZE /32 )) + i; +if (rxf->vlan_filter_status ==BNA_STATUS_T_ENABLED ) + req->bit_mask[i] = +htonl (rxf->vlan_filter_table[j]); +else + req->bit_mask[i] =0xFFFFFFFF ; } +bfa_msgq_cmd_set (&rxf->msgq_cmd,NULL ,NULL , +sizeof (struct bfi_enet_rx_vlan_req ), &req->mh); +bfa_msgq_cmd_post (&rxf->rx->bna->msgq, &rxf->msgq_cmd); }static void -__rxf_rit_set (struct bna_rxf *rxf) +bna_bfi_vlan_strip_enable (struct bna_rxf *rxf) { -struct bna *bna = rxf->rx->bna; -struct bna_rit_mem *rit_mem; -int i; -void __iomem *base_addr; -unsigned long off; - - base_addr =BNA_GET_MEM_BASE_ADDR (bna->pcidev.pci_bar_kva, -FUNCTION_TO_RXQ_TRANSLATE ); - - rit_mem = (struct bna_rit_mem *)0 ; - -writel (BNA_GET_PAGE_NUM (RXA0_MEM_BLK_BASE_PG_NUM + bna->port_num, -FUNCTION_TO_RXQ_TRANSLATE ), - bna->regs.page_addr); +struct bfi_enet_enable_req *req = &rxf->bfi_enet_cmd.req; -for (i =0 ; i < rxf->rit_segment->rit_size; i++) { - off = (unsigned long )&rit_mem[i + rxf->rit_segment->rit_offset]; -writel (rxf->rit_segment->rit[i].large_rxq_id <<6 | - rxf->rit_segment->rit[i].small_rxq_id, - base_addr + off); - } +bfi_msgq_mhdr_set (req->mh,BFI_MC_ENET , +BFI_ENET_H2I_RX_VLAN_STRIP_ENABLE_REQ ,0 , rxf->rx->rid); + req->mh.num_entries =htons ( +bfi_msgq_num_cmd_entries (sizeof (struct bfi_enet_enable_req ))); + req->enable = rxf->vlan_strip_status; +bfa_msgq_cmd_set (&rxf->msgq_cmd,NULL ,NULL , +sizeof (struct bfi_enet_enable_req ), &req->mh); +bfa_msgq_cmd_post (&rxf->rx->bna->msgq, &rxf->msgq_cmd); }static void -__bna_rxf_stat_clr (struct bna_rxf *rxf) +bna_bfi_rit_cfg (struct bna_rxf *rxf) { -struct bfi_ll_stats_req ll_req; -u32 bm[2 ] = {0 ,0 }; - -if (rxf->rxf_id <32 ) - bm[0 ] =1 << rxf->rxf_id; -else - bm[1 ] =1 << (rxf->rxf_id -32 ); +struct bfi_enet_rit_req *req = &rxf->bfi_enet_cmd.rit_req; -bfi_h2i_set (ll_req.mh,BFI_MC_LL ,BFI_LL_H2I_STATS_CLEAR_REQ ,0 ); - ll_req.stats_mask =0 ; - ll_req.txf_id_mask[0 ] =0 ; - ll_req.txf_id_mask[1 ] =0 ; - - ll_req.rxf_id_mask[0 ] =htonl (bm[0 ]); - ll_req.rxf_id_mask[1 ] =htonl (bm[1 ]); - -bna_mbox_qe_fill (&rxf->mbox_qe, &ll_req,sizeof (ll_req), - bna_rxf_cb_stats_cleared, rxf); -bna_mbox_send (rxf->rx->bna, &rxf->mbox_qe); +bfi_msgq_mhdr_set (req->mh,BFI_MC_ENET , +BFI_ENET_H2I_RIT_CFG_REQ ,0 , rxf->rx->rid); + req->mh.num_entries =htons ( +bfi_msgq_num_cmd_entries (sizeof (struct bfi_enet_rit_req ))); + req->size =htons (rxf->rit_size); +memcpy (&req->table[0 ], rxf->rit, rxf->rit_size); +bfa_msgq_cmd_set (&rxf->msgq_cmd,NULL ,NULL , +sizeof (struct bfi_enet_rit_req ), &req->mh); +bfa_msgq_cmd_post (&rxf->rx->bna->msgq, &rxf->msgq_cmd); }static void -rxf_enable (struct bna_rxf *rxf) +bna_bfi_rss_cfg (struct bna_rxf *rxf) { -if (rxf->rxf_oper_state ==BNA_RXF_OPER_STATE_PAUSED ) -bfa_fsm_send_event (rxf,RXF_E_STARTED ); -else { - rxf->rxf_flags |=BNA_RXF_FL_RXF_ENABLED ; -__rxf_enable (rxf); - } +struct bfi_enet_rss_cfg_req *req = &rxf->bfi_enet_cmd.rss_req; +int i; + +bfi_msgq_mhdr_set (req->mh,BFI_MC_ENET , +BFI_ENET_H2I_RSS_CFG_REQ ,0 , rxf->rx->rid); + req->mh.num_entries =htons ( +bfi_msgq_num_cmd_entries (sizeof (struct bfi_enet_rss_cfg_req ))); + req->cfg.type = rxf->rss_cfg.hash_type; + req->cfg.mask = rxf->rss_cfg.hash_mask; +for (i =0 ; i <BFI_ENET_RSS_KEY_LEN ; i++) + req->cfg.key[i] = +htonl (rxf->rss_cfg.toeplitz_hash_key[i]); +bfa_msgq_cmd_set (&rxf->msgq_cmd,NULL ,NULL , +sizeof (struct bfi_enet_rss_cfg_req ), &req->mh); +bfa_msgq_cmd_post (&rxf->rx->bna->msgq, &rxf->msgq_cmd); }static void -rxf_cb_enabled (void *arg,int status) +bna_bfi_rss_enable (struct bna_rxf *rxf) { -struct bna_rxf *rxf = (struct bna_rxf *)arg; +struct bfi_enet_enable_req *req = &rxf->bfi_enet_cmd.req; -bfa_q_qe_init (&rxf->mbox_qe.qe); -bfa_fsm_send_event (rxf,RXF_E_STARTED ); +bfi_msgq_mhdr_set (req->mh,BFI_MC_ENET , +BFI_ENET_H2I_RSS_ENABLE_REQ ,0 , rxf->rx->rid); + req->mh.num_entries =htons ( +bfi_msgq_num_cmd_entries (sizeof (struct bfi_enet_enable_req ))); + req->enable = rxf->rss_status; +bfa_msgq_cmd_set (&rxf->msgq_cmd,NULL ,NULL , +sizeof (struct bfi_enet_enable_req ), &req->mh); +bfa_msgq_cmd_post (&rxf->rx->bna->msgq, &rxf->msgq_cmd); } -static void -rxf_disable (struct bna_rxf *rxf) +/* This function gets the multicast MAC that has already been added to CAM */ +static struct bna_mac * +bna_rxf_mcmac_get (struct bna_rxf *rxf,u8 *mac_addr) { -if (rxf->rxf_oper_state ==BNA_RXF_OPER_STATE_PAUSED ) -bfa_fsm_send_event (rxf,RXF_E_STOPPED ); -else - rxf->rxf_flags &= ~BNA_RXF_FL_RXF_ENABLED ; -__rxf_disable (rxf); -} +struct bna_mac *mac; +struct list_head *qe; -static void -rxf_cb_disabled (void *arg,int status) -{ -struct bna_rxf *rxf = (struct bna_rxf *)arg; +list_for_each (qe, &rxf->mcast_active_q) { + mac = (struct bna_mac *)qe; +if (BNA_MAC_IS_EQUAL (&mac->addr, mac_addr)) +return mac; + } -bfa_q_qe_init (&rxf->mbox_qe.qe); -bfa_fsm_send_event (rxf,RXF_E_STOPPED ); +list_for_each (qe, &rxf->mcast_pending_del_q) { + mac = (struct bna_mac *)qe; +if (BNA_MAC_IS_EQUAL (&mac->addr, mac_addr)) +return mac; + } + +return NULL ; } -void -rxf_cb_cam_fltr_mbox_cmd (void *arg,int status) +static struct bna_mcam_handle * +bna_rxf_mchandle_get (struct bna_rxf *rxf,int handle) { -struct bna_rxf *rxf = (struct bna_rxf *)arg; +struct bna_mcam_handle *mchandle; +struct list_head *qe; -bfa_q_qe_init (&rxf->mbox_qe.qe); +list_for_each (qe, &rxf->mcast_handle_q) { + mchandle = (struct bna_mcam_handle *)qe; +if (mchandle->handle == handle) +return mchandle; + } -bfa_fsm_send_event (rxf,RXF_E_CAM_FLTR_RESP ); +return NULL ; }static void -bna_rxf_cb_stats_cleared (void *arg,int status) +bna_rxf_mchandle_attach (struct bna_rxf *rxf,u8 *mac_addr,int handle) { -struct bna_rxf *rxf = (struct bna_rxf *)arg; +struct bna_mac *mcmac; +struct bna_mcam_handle *mchandle; -bfa_q_qe_init (&rxf->mbox_qe.qe); -bfa_fsm_send_event (rxf,RXF_E_STAT_CLEARED ); + mcmac =bna_rxf_mcmac_get (rxf, mac_addr); + mchandle =bna_rxf_mchandle_get (rxf, handle); +if (mchandle ==NULL ) { + mchandle =bna_mcam_mod_handle_get (&rxf->rx->bna->mcam_mod); + mchandle->handle = handle; + mchandle->refcnt =0 ; +list_add_tail (&mchandle->qe, &rxf->mcast_handle_q); + } + mchandle->refcnt++; + mcmac->handle = mchandle; } -void -rxf_cam_mbox_cmd (struct bna_rxf *rxf,u8 cmd, -const struct bna_mac *mac_addr) +static int +bna_rxf_mcast_del (struct bna_rxf *rxf,struct bna_mac *mac, +enum bna_cleanup_type cleanup) { -struct bfi_ll_mac_addr_req req; - -bfi_h2i_set (req.mh,BFI_MC_LL , cmd,0 ); +struct bna_mcam_handle *mchandle; +int ret =0 ; - req.rxf_id = rxf->rxf_id; -memcpy (&req.mac_addr, (void *)&mac_addr->addr,ETH_ALEN ); + mchandle = mac->handle; +if (mchandle ==NULL ) +return ret; -bna_mbox_qe_fill (&rxf->mbox_qe, &req,sizeof (req), - rxf_cb_cam_fltr_mbox_cmd, rxf); + mchandle->refcnt--; +if (mchandle->refcnt ==0 ) { +if (cleanup ==BNA_HARD_CLEANUP ) { +bna_bfi_mcast_del_req (rxf, mchandle->handle); + ret =1 ; + } +list_del (&mchandle->qe); +bfa_q_qe_init (&mchandle->qe); +bna_mcam_mod_handle_put (&rxf->rx->bna->mcam_mod, mchandle); + } + mac->handle =NULL ; -bna_mbox_send (rxf->rx->bna, &rxf->mbox_qe); +return ret; }static int -rxf_process_packet_filter_mcast (struct bna_rxf *rxf) +bna_rxf_mcast_cfg_apply (struct bna_rxf *rxf) {struct bna_mac *mac =NULL ;struct list_head *qe; +int ret; + +/* Delete multicast entries previousely added */ +while (!list_empty (&rxf->mcast_pending_del_q)) { +bfa_q_deq (&rxf->mcast_pending_del_q, &qe); +bfa_q_qe_init (qe); + mac = (struct bna_mac *)qe; + ret =bna_rxf_mcast_del (rxf, mac,BNA_HARD_CLEANUP ); +bna_mcam_mod_mac_put (&rxf->rx->bna->mcam_mod, mac); +if (ret) +return ret; + }/* Add multicast entries */ if (!list_empty (&rxf->mcast_pending_add_q)) {bfa_q_deq (&rxf->mcast_pending_add_q, &qe);bfa_q_qe_init (qe); mac = (struct bna_mac *)qe; -rxf_cam_mbox_cmd (rxf,BFI_LL_H2I_MAC_MCAST_ADD_REQ , mac);list_add_tail (&mac->qe, &rxf->mcast_active_q); +bna_bfi_mcast_add_req (rxf, mac);return 1 ; } -/* Delete multicast entries previousely added */ -if (!list_empty (&rxf->mcast_pending_del_q)) { +return 0 ; +} + +static int +bna_rxf_vlan_cfg_apply (struct bna_rxf *rxf) +{ +u8 vlan_pending_bitmask; +int block_idx =0 ; + +if (rxf->vlan_pending_bitmask) { + vlan_pending_bitmask = rxf->vlan_pending_bitmask; +while (!(vlan_pending_bitmask &0x1 )) { + block_idx++; + vlan_pending_bitmask >>=1 ; + } + rxf->vlan_pending_bitmask &= ~(1 << block_idx); +bna_bfi_rx_vlan_filter_set (rxf, block_idx); +return 1 ; + } + +return 0 ; +} + +static int +bna_rxf_mcast_cfg_reset (struct bna_rxf *rxf,enum bna_cleanup_type cleanup) +{ +struct list_head *qe; +struct bna_mac *mac; +int ret; + +/* Throw away delete pending mcast entries */ +while (!list_empty (&rxf->mcast_pending_del_q)) {bfa_q_deq (&rxf->mcast_pending_del_q, &qe);bfa_q_qe_init (qe); mac = (struct bna_mac *)qe; -rxf_cam_mbox_cmd (rxf,BFI_LL_H2I_MAC_MCAST_DEL_REQ , mac); + ret =bna_rxf_mcast_del (rxf, mac, cleanup);bna_mcam_mod_mac_put (&rxf->rx->bna->mcam_mod, mac); -return 1 ; +if (ret) +return ret; + } + +/* Move active mcast entries to pending_add_q */ +while (!list_empty (&rxf->mcast_active_q)) { +bfa_q_deq (&rxf->mcast_active_q, &qe); +bfa_q_qe_init (qe); +list_add_tail (qe, &rxf->mcast_pending_add_q); + mac = (struct bna_mac *)qe; +if (bna_rxf_mcast_del (rxf, mac, cleanup)) +return 1 ; }return 0 ; }static int -rxf_process_packet_filter_vlan (struct bna_rxf *rxf) +bna_rxf_rss_cfg_apply (struct bna_rxf *rxf) { -/* Apply the VLAN filter */ -if (rxf->rxf_flags &BNA_RXF_FL_VLAN_CONFIG_PENDING ) { - rxf->rxf_flags &= ~BNA_RXF_FL_VLAN_CONFIG_PENDING ; -if (!(rxf->rxmode_active &BNA_RXMODE_PROMISC )) -__rxf_vlan_filter_set (rxf, rxf->vlan_filter_status); - } +if (rxf->rss_pending) { +if (rxf->rss_pending &BNA_RSS_F_RIT_PENDING ) { + rxf->rss_pending &= ~BNA_RSS_F_RIT_PENDING ; +bna_bfi_rit_cfg (rxf); +return 1 ; + } + +if (rxf->rss_pending &BNA_RSS_F_CFG_PENDING ) { + rxf->rss_pending &= ~BNA_RSS_F_CFG_PENDING ; +bna_bfi_rss_cfg (rxf); +return 1 ; + } -/* Apply RSS configuration */ -if (rxf->rxf_flags &BNA_RXF_FL_RSS_CONFIG_PENDING ) { - rxf->rxf_flags &= ~BNA_RXF_FL_RSS_CONFIG_PENDING ; -if (rxf->rss_status ==BNA_STATUS_T_DISABLED ) { -/* RSS is being disabled */ - rxf->ctrl_flags &= ~BNA_RXF_CF_RSS_ENABLE ; -__rxf_rit_set (rxf); -__rxf_config_set (rxf); - }else { -/* RSS is being enabled or reconfigured */ - rxf->ctrl_flags |=BNA_RXF_CF_RSS_ENABLE ; -__rxf_rit_set (rxf); -__rxf_config_set (rxf); +if (rxf->rss_pending &BNA_RSS_F_STATUS_PENDING ) { + rxf->rss_pending &= ~BNA_RSS_F_STATUS_PENDING ; +bna_bfi_rss_enable (rxf); +return 1 ; } }return 0 ; } -/** -* Processes pending ucast, mcast entry addition/deletion and issues mailbox -* command. Also processes pending filter configuration - promiscuous mode, -* default mode, allmutli mode and issues mailbox command or directly applies -* to h/w -*/ static int -rxf_process_packet_filter (struct bna_rxf *rxf) +bna_rxf_cfg_apply (struct bna_rxf *rxf) { -/* Set the default MAC first */ -if (rxf->ucast_pending_set >0 ) { -rxf_cam_mbox_cmd (rxf,BFI_LL_H2I_MAC_UCAST_SET_REQ , - rxf->ucast_active_mac); - rxf->ucast_pending_set--; +if (bna_rxf_ucast_cfg_apply (rxf))return 1 ; - } -if (rxf_process_packet_filter_ucast (rxf)) +if (bna_rxf_mcast_cfg_apply (rxf))return 1 ; -if (rxf_process_packet_filter_mcast (rxf)) +if (bna_rxf_promisc_cfg_apply (rxf))return 1 ; -if (rxf_process_packet_filter_promisc (rxf)) +if (bna_rxf_allmulti_cfg_apply (rxf))return 1 ; -if (rxf_process_packet_filter_allmulti (rxf)) +if (bna_rxf_vlan_cfg_apply (rxf))return 1 ; -if (rxf_process_packet_filter_vlan (rxf)) +if (bna_rxf_vlan_strip_cfg_apply (rxf))return 1 ; -return 0 ; -} - -static int -rxf_clear_packet_filter_mcast (struct bna_rxf *rxf) -{ -struct bna_mac *mac =NULL ; -struct list_head *qe; - -/* 3. delete pending mcast entries */ -if (!list_empty (&rxf->mcast_pending_del_q)) { -bfa_q_deq (&rxf->mcast_pending_del_q, &qe); -bfa_q_qe_init (qe); - mac = (struct bna_mac *)qe; -rxf_cam_mbox_cmd (rxf,BFI_LL_H2I_MAC_MCAST_DEL_REQ , mac); -bna_mcam_mod_mac_put (&rxf->rx->bna->mcam_mod, mac); +if (bna_rxf_rss_cfg_apply (rxf))return 1 ; - } - -/* 4. clear active mcast entries; move them to pending_add_q */ -if (!list_empty (&rxf->mcast_active_q)) { -bfa_q_deq (&rxf->mcast_active_q, &qe); -bfa_q_qe_init (qe); - mac = (struct bna_mac *)qe; -rxf_cam_mbox_cmd (rxf,BFI_LL_H2I_MAC_MCAST_DEL_REQ , mac); -list_add_tail (&mac->qe, &rxf->mcast_pending_add_q); -return 1 ; - }return 0 ; } -/** -* In the rxf stop path, processes pending ucast/mcast delete queue and issues -* the mailbox command. Moves the active ucast/mcast entries to pending add q, -* so that they are added to CAM again in the rxf start path. Moves the current -* filter settings - promiscuous, default, allmutli - to pending filter -* configuration -*/ +/* Only software reset */ static int -rxf_clear_packet_filter (struct bna_rxf *rxf) +bna_rxf_fltr_clear (struct bna_rxf *rxf) { -if (rxf_clear_packet_filter_ucast (rxf)) +if (bna_rxf_ucast_cfg_reset (rxf,BNA_HARD_CLEANUP ))return 1 ; -if (rxf_clear_packet_filter_mcast (rxf)) +if (bna_rxf_mcast_cfg_reset (rxf,BNA_HARD_CLEANUP ))return 1 ; -/* 5. clear active default MAC in the CAM */ -if (rxf->ucast_pending_set >0 ) - rxf->ucast_pending_set =0 ; - -if (rxf_clear_packet_filter_promisc (rxf)) +if (bna_rxf_promisc_cfg_reset (rxf,BNA_HARD_CLEANUP ))return 1 ; -if (rxf_clear_packet_filter_allmulti (rxf)) +if (bna_rxf_allmulti_cfg_reset (rxf,BNA_HARD_CLEANUP ))return 1 ;return 0 ; }static void -rxf_reset_packet_filter_mcast (struct bna_rxf *rxf) +bna_rxf_cfg_reset (struct bna_rxf *rxf) { +bna_rxf_ucast_cfg_reset (rxf,BNA_SOFT_CLEANUP ); +bna_rxf_mcast_cfg_reset (rxf,BNA_SOFT_CLEANUP ); +bna_rxf_promisc_cfg_reset (rxf,BNA_SOFT_CLEANUP ); +bna_rxf_allmulti_cfg_reset (rxf,BNA_SOFT_CLEANUP ); +bna_rxf_vlan_cfg_soft_reset (rxf); +bna_rxf_rss_cfg_soft_reset (rxf); +} + +static void +bna_rit_init (struct bna_rxf *rxf,int rit_size) +{ +struct bna_rx *rx = rxf->rx; +struct bna_rxp *rxp;struct list_head *qe; -struct bna_mac *mac; +int offset =0 ; -/* 3. Move active mcast entries to pending_add_q */ -while (!list_empty (&rxf->mcast_active_q)) { -bfa_q_deq (&rxf->mcast_active_q, &qe); -bfa_q_qe_init (qe); -list_add_tail (qe, &rxf->mcast_pending_add_q); + rxf->rit_size = rit_size; +list_for_each (qe, &rx->rxp_q) { + rxp = (struct bna_rxp *)qe; + rxf->rit[offset] = rxp->cq.ccb->id; + offset++; } -/* 4. Throw away delete pending mcast entries */ -while (!list_empty (&rxf->mcast_pending_del_q)) { -bfa_q_deq (&rxf->mcast_pending_del_q, &qe); -bfa_q_qe_init (qe); - mac = (struct bna_mac *)qe; -bna_mcam_mod_mac_put (&rxf->rx->bna->mcam_mod, mac); - } } -/** -* In the rxf fail path, throws away the ucast/mcast entries pending for -* deletion, moves all active ucast/mcast entries to pending queue so that -* they are added back to CAM in the rxf start path. Also moves the current -* filter configuration to pending filter configuration. -*/ -static void -rxf_reset_packet_filter (struct bna_rxf *rxf) +void +bna_bfi_rxf_cfg_rsp (struct bna_rxf *rxf,struct bfi_msgq_mhdr *msghdr) { -rxf_reset_packet_filter_ucast (rxf); - -rxf_reset_packet_filter_mcast (rxf); - -/* 5. Turn off ucast set flag */ - rxf->ucast_pending_set =0 ; +bfa_fsm_send_event (rxf,RXF_E_FW_RESP ); +} -rxf_reset_packet_filter_promisc (rxf); +void +bna_bfi_rxf_mcast_add_rsp (struct bna_rxf *rxf, +struct bfi_msgq_mhdr *msghdr) +{ +struct bfi_enet_mcast_add_req *req = + &rxf->bfi_enet_cmd.mcast_add_req; +struct bfi_enet_mcast_add_rsp *rsp = + (struct bfi_enet_mcast_add_rsp *)msghdr; -rxf_reset_packet_filter_allmulti (rxf); +bna_rxf_mchandle_attach (rxf, (u8 *)&req->mac_addr, +ntohs (rsp->handle)); +bfa_fsm_send_event (rxf,RXF_E_FW_RESP ); }static void bna_rxf_init (struct bna_rxf *rxf,struct bna_rx *rx, -struct bna_rx_config *q_config) +struct bna_rx_config *q_config, +struct bna_res_info *res_info) { -struct list_head *qe; -struct bna_rxp *rxp; - -/* rxf_id is initialized during rx_mod init */ rxf->rx = rx;INIT_LIST_HEAD (&rxf->ucast_pending_add_q);INIT_LIST_HEAD (&rxf->ucast_pending_del_q); rxf->ucast_pending_set =0 ; + rxf->ucast_active_set =0 ;INIT_LIST_HEAD (&rxf->ucast_active_q); - rxf->ucast_active_mac =NULL ; + rxf->ucast_pending_mac =NULL ;INIT_LIST_HEAD (&rxf->mcast_pending_add_q);INIT_LIST_HEAD (&rxf->mcast_pending_del_q);INIT_LIST_HEAD (&rxf->mcast_active_q); +INIT_LIST_HEAD (&rxf->mcast_handle_q); -bfa_q_qe_init (&rxf->mbox_qe.qe); - -if (q_config->vlan_strip_status ==BNA_STATUS_T_ENABLED ) - rxf->ctrl_flags |=BNA_RXF_CF_VLAN_STRIP ; - - rxf->rxf_oper_state = (q_config->paused) ? -BNA_RXF_OPER_STATE_PAUSED :BNA_RXF_OPER_STATE_RUNNING ; +if (q_config->paused) + rxf->flags |=BNA_RXF_F_PAUSED ; -bna_rxf_adv_init (rxf, rx, q_config); + rxf->rit = (u8 *) + res_info[BNA_RX_RES_MEM_T_RIT ].res_u.mem_info.mdl[0 ].kva; +bna_rit_init (rxf, q_config->num_paths); - rxf->rit_segment =bna_rit_mod_seg_get (&rxf->rx->bna->rit_mod, - q_config->num_paths); - -list_for_each (qe, &rx->rxp_q) { - rxp = (struct bna_rxp *)qe; -if (q_config->rxp_type ==BNA_RXP_SINGLE ) - rxf->mcast_rxq_id = rxp->rxq.single.only->rxq_id; -else - rxf->mcast_rxq_id = rxp->rxq.slr.large->rxq_id; -break ; + rxf->rss_status = q_config->rss_status; +if (rxf->rss_status ==BNA_STATUS_T_ENABLED ) { + rxf->rss_cfg = q_config->rss_config; + rxf->rss_pending |=BNA_RSS_F_CFG_PENDING ; + rxf->rss_pending |=BNA_RSS_F_RIT_PENDING ; + rxf->rss_pending |=BNA_RSS_F_STATUS_PENDING ; } rxf->vlan_filter_status =BNA_STATUS_T_DISABLED ;memset (rxf->vlan_filter_table,0 , - (sizeof (u32) * ((BFI_MAX_VLAN +1 ) /32 ))); + (sizeof (u32) * ((BFI_ENET_VLAN_ID_MAX +1 ) /32 ))); + rxf->vlan_filter_table[0 ] |=1 ;/* for pure priority tagged frames */ + rxf->vlan_pending_bitmask = (u8 )BFI_VLAN_BMASK_ALL ; -/* Set up VLAN 0 for pure priority tagged packets */ - rxf->vlan_filter_table[0 ] |=1 ; + rxf->vlan_strip_status = q_config->vlan_strip_status;bfa_fsm_set_state (rxf, bna_rxf_sm_stopped); }
@@ -1441,13 +777,10 @@ bna_rxf_init(struct bna_rxf *rxf,static void bna_rxf_uninit (struct bna_rxf *rxf) { -struct bna *bna = rxf->rx->bna;struct bna_mac *mac; -bna_rit_mod_seg_put (&rxf->rx->bna->rit_mod, rxf->rit_segment); - rxf->rit_segment =NULL ; - rxf->ucast_pending_set =0 ; + rxf->ucast_active_set =0 ;while (!list_empty (&rxf->ucast_pending_add_q)) {bfa_q_deq (&rxf->ucast_pending_add_q, &mac);
@@ -1455,11 +788,11 @@ bna_rxf_uninit(struct bna_rxf *rxf)bna_ucam_mod_mac_put (&rxf->rx->bna->ucam_mod, mac); } -if (rxf->ucast_active_mac) { -bfa_q_qe_init (&rxf->ucast_active_mac->qe); +if (rxf->ucast_pending_mac) { +bfa_q_qe_init (&rxf->ucast_pending_mac->qe);bna_ucam_mod_mac_put (&rxf->rx->bna->ucam_mod, - rxf->ucast_active_mac); - rxf->ucast_active_mac =NULL ; + rxf->ucast_pending_mac); + rxf->ucast_pending_mac =NULL ; }while (!list_empty (&rxf->mcast_pending_add_q)) {
@@ -1468,39 +801,25 @@ bna_rxf_uninit(struct bna_rxf *rxf)bna_mcam_mod_mac_put (&rxf->rx->bna->mcam_mod, mac); } -/* Turn off pending promisc mode */ -if (is_promisc_enable (rxf->rxmode_pending, - rxf->rxmode_pending_bitmask)) { -/* system promisc state should be pending */ -BUG_ON (!(bna->rxf_promisc_id == rxf->rxf_id)); -promisc_inactive (rxf->rxmode_pending, - rxf->rxmode_pending_bitmask); - bna->rxf_promisc_id =BFI_MAX_RXF ; - } -/* Promisc mode should not be active */ -BUG_ON (rxf->rxmode_active &BNA_RXMODE_PROMISC ); + rxf->rxmode_pending =0 ; + rxf->rxmode_pending_bitmask =0 ; +if (rxf->rx->bna->promisc_rid == rxf->rx->rid) + rxf->rx->bna->promisc_rid =BFI_INVALID_RID ; +if (rxf->rx->bna->default_mode_rid == rxf->rx->rid) + rxf->rx->bna->default_mode_rid =BFI_INVALID_RID ; -/* Turn off pending all-multi mode */ -if (is_allmulti_enable (rxf->rxmode_pending, - rxf->rxmode_pending_bitmask)) { -allmulti_inactive (rxf->rxmode_pending, - rxf->rxmode_pending_bitmask); - } -/* Allmulti mode should not be active */ -BUG_ON (rxf->rxmode_active &BNA_RXMODE_ALLMULTI ); + rxf->rss_pending =0 ; + rxf->vlan_strip_pending = false; + + rxf->flags =0 ; rxf->rx =NULL ; }static void -bna_rx_cb_rxf_started (struct bna_rx *rx,enum bna_cb_status status) +bna_rx_cb_rxf_started (struct bna_rx *rx) {bfa_fsm_send_event (rx,RX_E_RXF_STARTED ); -if (rx->rxf.rxf_id <32 ) - rx->bna->rx_mod.rxf_bmap[0 ] |= ((u32 )1 << rx->rxf.rxf_id); -else - rx->bna->rx_mod.rxf_bmap[1 ] |= ((u32 ) -1 << (rx->rxf.rxf_id -32 )); } static void
@@ -1508,19 +827,13 @@ bna_rxf_start(struct bna_rxf *rxf) { rxf->start_cbfn = bna_rx_cb_rxf_started; rxf->start_cbarg = rxf->rx; - rxf->rxf_flags &= ~BNA_RXF_FL_FAILED ;bfa_fsm_send_event (rxf,RXF_E_START ); }static void -bna_rx_cb_rxf_stopped (struct bna_rx *rx,enum bna_cb_status status) +bna_rx_cb_rxf_stopped (struct bna_rx *rx) {bfa_fsm_send_event (rx,RX_E_RXF_STOPPED ); -if (rx->rxf.rxf_id <32 ) - rx->bna->rx_mod.rxf_bmap[0 ] &= ~(u32 )1 << rx->rxf.rxf_id; -else - rx->bna->rx_mod.rxf_bmap[1 ] &= ~(u32 ) -1 << (rx->rxf.rxf_id -32 ); } static void
@@ -1534,68 +847,46 @@ bna_rxf_stop(struct bna_rxf *rxf)static void bna_rxf_fail (struct bna_rxf *rxf) { - rxf->rxf_flags |=BNA_RXF_FL_FAILED ;bfa_fsm_send_event (rxf,RXF_E_FAIL ); } -int -bna_rxf_state_get (struct bna_rxf *rxf) -{ -return bfa_sm_to_state (rxf_sm_table, rxf->fsm); -} -enum bna_cb_status bna_rx_ucast_set (struct bna_rx *rx,u8 *ucmac, -void (*cbfn)(struct bnad *,struct bna_rx *, -enum bna_cb_status )) +void (*cbfn)(struct bnad *,struct bna_rx *)) {struct bna_rxf *rxf = &rx->rxf; -if (rxf->ucast_active_mac ==NULL ) { - rxf->ucast_active_mac = +if (rxf->ucast_pending_mac ==NULL ) { + rxf->ucast_pending_mac =bna_ucam_mod_mac_get (&rxf->rx->bna->ucam_mod); -if (rxf->ucast_active_mac ==NULL ) +if (rxf->ucast_pending_mac ==NULL )return BNA_CB_UCAST_CAM_FULL ; -bfa_q_qe_init (&rxf->ucast_active_mac->qe); +bfa_q_qe_init (&rxf->ucast_pending_mac->qe); } -memcpy (rxf->ucast_active_mac->addr, ucmac,ETH_ALEN ); - rxf->ucast_pending_set++; +memcpy (rxf->ucast_pending_mac->addr, ucmac,ETH_ALEN ); + rxf->ucast_pending_set =1 ; rxf->cam_fltr_cbfn = cbfn; rxf->cam_fltr_cbarg = rx->bna->bnad; -bfa_fsm_send_event (rxf,RXF_E_CAM_FLTR_MOD ); +bfa_fsm_send_event (rxf,RXF_E_CONFIG );return BNA_CB_SUCCESS ; }enum bna_cb_status bna_rx_mcast_add (struct bna_rx *rx,u8 *addr, -void (*cbfn)(struct bnad *,struct bna_rx *, -enum bna_cb_status )) +void (*cbfn)(struct bnad *,struct bna_rx *)) {struct bna_rxf *rxf = &rx->rxf; -struct list_head *qe;struct bna_mac *mac; -/* Check if already added */ -list_for_each (qe, &rxf->mcast_active_q) { - mac = (struct bna_mac *)qe; -if (BNA_MAC_IS_EQUAL (mac->addr, addr)) { -if (cbfn) - (*cbfn)(rx->bna->bnad, rx,BNA_CB_SUCCESS ); -return BNA_CB_SUCCESS ; - } - } - -/* Check if pending addition */ -list_for_each (qe, &rxf->mcast_pending_add_q) { - mac = (struct bna_mac *)qe; -if (BNA_MAC_IS_EQUAL (mac->addr, addr)) { -if (cbfn) - (*cbfn)(rx->bna->bnad, rx,BNA_CB_SUCCESS ); -return BNA_CB_SUCCESS ; - } +/* Check if already added or pending addition */ +if (bna_mac_find (&rxf->mcast_active_q, addr) || +bna_mac_find (&rxf->mcast_pending_add_q, addr)) { +if (cbfn) +cbfn (rx->bna->bnad, rx); +return BNA_CB_SUCCESS ; } mac =bna_mcam_mod_mac_get (&rxf->rx->bna->mcam_mod);
@@ -1608,25 +899,20 @@ bna_rx_mcast_add(struct bna_rx *rx, u8 *addr, rxf->cam_fltr_cbfn = cbfn; rxf->cam_fltr_cbarg = rx->bna->bnad; -bfa_fsm_send_event (rxf,RXF_E_CAM_FLTR_MOD ); +bfa_fsm_send_event (rxf,RXF_E_CONFIG );return BNA_CB_SUCCESS ; }enum bna_cb_status bna_rx_mcast_listset (struct bna_rx *rx,int count,u8 *mclist, -void (*cbfn)(struct bnad *,struct bna_rx *, -enum bna_cb_status )) +void (*cbfn)(struct bnad *,struct bna_rx *)) {struct bna_rxf *rxf = &rx->rxf;struct list_head list_head;struct list_head *qe;u8 *mcaddr;struct bna_mac *mac; -struct bna_mac *mac1; -int skip; -int delete; -int need_hw_config =0 ;int i;/* Allocate nodes */
@@ -1642,108 +928,33 @@ bna_rx_mcast_listset(struct bna_rx *rx, int count, u8 *mclist, mcaddr +=ETH_ALEN ; } -/* Schedule for addition */ -while (!list_empty (&list_head)) { -bfa_q_deq (&list_head, &qe); - mac = (struct bna_mac *)qe; -bfa_q_qe_init (&mac->qe); - - skip =0 ; - -/* Skip if already added */ -list_for_each (qe, &rxf->mcast_active_q) { - mac1 = (struct bna_mac *)qe; -if (BNA_MAC_IS_EQUAL (mac1->addr, mac->addr)) { -bna_mcam_mod_mac_put (&rxf->rx->bna->mcam_mod, - mac); - skip =1 ; -break ; - } - } - -if (skip) -continue ; - -/* Skip if pending addition */ -list_for_each (qe, &rxf->mcast_pending_add_q) { - mac1 = (struct bna_mac *)qe; -if (BNA_MAC_IS_EQUAL (mac1->addr, mac->addr)) { -bna_mcam_mod_mac_put (&rxf->rx->bna->mcam_mod, - mac); - skip =1 ; -break ; - } - } - -if (skip) -continue ; - - need_hw_config =1 ; -list_add_tail (&mac->qe, &rxf->mcast_pending_add_q); - } - -/** -* Delete the entries that are in the pending_add_q but not -* in the new list -*/ +/* Purge the pending_add_q */ while (!list_empty (&rxf->mcast_pending_add_q)) {bfa_q_deq (&rxf->mcast_pending_add_q, &qe); +bfa_q_qe_init (qe); mac = (struct bna_mac *)qe; -bfa_q_qe_init (&mac->qe); -for (i =0 , mcaddr = mclist, delete =1 ; i < count; i++) { -if (BNA_MAC_IS_EQUAL (mcaddr, mac->addr)) { - delete =0 ; -break ; - } - mcaddr +=ETH_ALEN ; - } -if (delete) -bna_mcam_mod_mac_put (&rxf->rx->bna->mcam_mod, mac); -else -list_add_tail (&mac->qe, &list_head); - } -while (!list_empty (&list_head)) { -bfa_q_deq (&list_head, &qe); - mac = (struct bna_mac *)qe; -bfa_q_qe_init (&mac->qe); -list_add_tail (&mac->qe, &rxf->mcast_pending_add_q); +bna_mcam_mod_mac_put (&rxf->rx->bna->mcam_mod, mac); } -/** -* Schedule entries for deletion that are in the active_q but not -* in the new list -*/ +/* Schedule active_q entries for deletion */ while (!list_empty (&rxf->mcast_active_q)) {bfa_q_deq (&rxf->mcast_active_q, &qe); mac = (struct bna_mac *)qe;bfa_q_qe_init (&mac->qe); -for (i =0 , mcaddr = mclist, delete =1 ; i < count; i++) { -if (BNA_MAC_IS_EQUAL (mcaddr, mac->addr)) { - delete =0 ; -break ; - } - mcaddr +=ETH_ALEN ; - } -if (delete) { -list_add_tail (&mac->qe, &rxf->mcast_pending_del_q); - need_hw_config =1 ; - }else { -list_add_tail (&mac->qe, &list_head); - } +list_add_tail (&mac->qe, &rxf->mcast_pending_del_q); } + +/* Add the new entries */ while (!list_empty (&list_head)) {bfa_q_deq (&list_head, &qe); mac = (struct bna_mac *)qe;bfa_q_qe_init (&mac->qe); -list_add_tail (&mac->qe, &rxf->mcast_active_q); +list_add_tail (&mac->qe, &rxf->mcast_pending_add_q); } -if (need_hw_config) { - rxf->cam_fltr_cbfn = cbfn; - rxf->cam_fltr_cbarg = rx->bna->bnad; -bfa_fsm_send_event (rxf,RXF_E_CAM_FLTR_MOD ); - }else if (cbfn) - (*cbfn)(rx->bna->bnad, rx,BNA_CB_SUCCESS ); + rxf->cam_fltr_cbfn = cbfn; + rxf->cam_fltr_cbarg = rx->bna->bnad; +bfa_fsm_send_event (rxf,RXF_E_CONFIG );return BNA_CB_SUCCESS ;
@@ -1762,13 +973,14 @@ void bna_rx_vlan_add(struct bna_rx *rx, int vlan_id) {struct bna_rxf *rxf = &rx->rxf; -int index = (vlan_id >>5 ); -int bit = (1 << (vlan_id &0x1F )); +int index = (vlan_id >>BFI_VLAN_WORD_SHIFT ); +int bit = (1 << (vlan_id &BFI_VLAN_WORD_MASK )); +int group_id = (vlan_id >>BFI_VLAN_BLOCK_SHIFT ); rxf->vlan_filter_table[index] |= bit;if (rxf->vlan_filter_status ==BNA_STATUS_T_ENABLED ) { - rxf->rxf_flags |=BNA_RXF_FL_VLAN_CONFIG_PENDING ; -bfa_fsm_send_event (rxf,RXF_E_CAM_FLTR_MOD ); + rxf->vlan_pending_bitmask |= (1 << group_id); +bfa_fsm_send_event (rxf,RXF_E_CONFIG ); } }
@@ -1776,34 +988,403 @@ void bna_rx_vlan_del(struct bna_rx *rx, int vlan_id) {struct bna_rxf *rxf = &rx->rxf; -int index = (vlan_id >>5 ); -int bit = (1 << (vlan_id &0x1F )); +int index = (vlan_id >>BFI_VLAN_WORD_SHIFT ); +int bit = (1 << (vlan_id &BFI_VLAN_WORD_MASK )); +int group_id = (vlan_id >>BFI_VLAN_BLOCK_SHIFT ); rxf->vlan_filter_table[index] &= ~bit;if (rxf->vlan_filter_status ==BNA_STATUS_T_ENABLED ) { - rxf->rxf_flags |=BNA_RXF_FL_VLAN_CONFIG_PENDING ; -bfa_fsm_send_event (rxf,RXF_E_CAM_FLTR_MOD ); + rxf->vlan_pending_bitmask |= (1 << group_id); +bfa_fsm_send_event (rxf,RXF_E_CONFIG ); + } +} + +static int +bna_rxf_ucast_cfg_apply (struct bna_rxf *rxf) +{ +struct bna_mac *mac =NULL ; +struct list_head *qe; + +/* Delete MAC addresses previousely added */ +if (!list_empty (&rxf->ucast_pending_del_q)) { +bfa_q_deq (&rxf->ucast_pending_del_q, &qe); +bfa_q_qe_init (qe); + mac = (struct bna_mac *)qe; +bna_bfi_ucast_req (rxf, mac,BFI_ENET_H2I_MAC_UCAST_DEL_REQ ); +bna_ucam_mod_mac_put (&rxf->rx->bna->ucam_mod, mac); +return 1 ; + } + +/* Set default unicast MAC */ +if (rxf->ucast_pending_set) { + rxf->ucast_pending_set =0 ; +memcpy (rxf->ucast_active_mac.addr, + rxf->ucast_pending_mac->addr,ETH_ALEN ); + rxf->ucast_active_set =1 ; +bna_bfi_ucast_req (rxf, &rxf->ucast_active_mac, +BFI_ENET_H2I_MAC_UCAST_SET_REQ ); +return 1 ; + } + +/* Add additional MAC entries */ +if (!list_empty (&rxf->ucast_pending_add_q)) { +bfa_q_deq (&rxf->ucast_pending_add_q, &qe); +bfa_q_qe_init (qe); + mac = (struct bna_mac *)qe; +list_add_tail (&mac->qe, &rxf->ucast_active_q); +bna_bfi_ucast_req (rxf, mac,BFI_ENET_H2I_MAC_UCAST_ADD_REQ ); +return 1 ; + } + +return 0 ; +} + +static int +bna_rxf_ucast_cfg_reset (struct bna_rxf *rxf,enum bna_cleanup_type cleanup) +{ +struct list_head *qe; +struct bna_mac *mac; + +/* Throw away delete pending ucast entries */ +while (!list_empty (&rxf->ucast_pending_del_q)) { +bfa_q_deq (&rxf->ucast_pending_del_q, &qe); +bfa_q_qe_init (qe); + mac = (struct bna_mac *)qe; +if (cleanup ==BNA_SOFT_CLEANUP ) +bna_ucam_mod_mac_put (&rxf->rx->bna->ucam_mod, mac); +else { +bna_bfi_ucast_req (rxf, mac, +BFI_ENET_H2I_MAC_UCAST_DEL_REQ ); +bna_ucam_mod_mac_put (&rxf->rx->bna->ucam_mod, mac); +return 1 ; + } + } + +/* Move active ucast entries to pending_add_q */ +while (!list_empty (&rxf->ucast_active_q)) { +bfa_q_deq (&rxf->ucast_active_q, &qe); +bfa_q_qe_init (qe); +list_add_tail (qe, &rxf->ucast_pending_add_q); +if (cleanup ==BNA_HARD_CLEANUP ) { + mac = (struct bna_mac *)qe; +bna_bfi_ucast_req (rxf, mac, +BFI_ENET_H2I_MAC_UCAST_DEL_REQ ); +return 1 ; + } + } + +if (rxf->ucast_active_set) { + rxf->ucast_pending_set =1 ; + rxf->ucast_active_set =0 ; +if (cleanup ==BNA_HARD_CLEANUP ) { +bna_bfi_ucast_req (rxf, &rxf->ucast_active_mac, +BFI_ENET_H2I_MAC_UCAST_CLR_REQ ); +return 1 ; + } } + +return 0 ; +} + +static int +bna_rxf_promisc_cfg_apply (struct bna_rxf *rxf) +{ +struct bna *bna = rxf->rx->bna; + +/* Enable/disable promiscuous mode */ +if (is_promisc_enable (rxf->rxmode_pending, + rxf->rxmode_pending_bitmask)) { +/* move promisc configuration from pending -> active */ +promisc_inactive (rxf->rxmode_pending, + rxf->rxmode_pending_bitmask); + rxf->rxmode_active |=BNA_RXMODE_PROMISC ; +bna_bfi_rx_promisc_req (rxf,BNA_STATUS_T_ENABLED ); +return 1 ; + }else if (is_promisc_disable (rxf->rxmode_pending, + rxf->rxmode_pending_bitmask)) { +/* move promisc configuration from pending -> active */ +promisc_inactive (rxf->rxmode_pending, + rxf->rxmode_pending_bitmask); + rxf->rxmode_active &= ~BNA_RXMODE_PROMISC ; + bna->promisc_rid =BFI_INVALID_RID ; +bna_bfi_rx_promisc_req (rxf,BNA_STATUS_T_DISABLED ); +return 1 ; + } + +return 0 ; +} + +static int +bna_rxf_promisc_cfg_reset (struct bna_rxf *rxf,enum bna_cleanup_type cleanup) +{ +struct bna *bna = rxf->rx->bna; + +/* Clear pending promisc mode disable */ +if (is_promisc_disable (rxf->rxmode_pending, + rxf->rxmode_pending_bitmask)) { +promisc_inactive (rxf->rxmode_pending, + rxf->rxmode_pending_bitmask); + rxf->rxmode_active &= ~BNA_RXMODE_PROMISC ; + bna->promisc_rid =BFI_INVALID_RID ; +if (cleanup ==BNA_HARD_CLEANUP ) { +bna_bfi_rx_promisc_req (rxf,BNA_STATUS_T_DISABLED ); +return 1 ; + } + } + +/* Move promisc mode config from active -> pending */ +if (rxf->rxmode_active &BNA_RXMODE_PROMISC ) { +promisc_enable (rxf->rxmode_pending, + rxf->rxmode_pending_bitmask); + rxf->rxmode_active &= ~BNA_RXMODE_PROMISC ; +if (cleanup ==BNA_HARD_CLEANUP ) { +bna_bfi_rx_promisc_req (rxf,BNA_STATUS_T_DISABLED ); +return 1 ; + } + } + +return 0 ; +} + +static int +bna_rxf_allmulti_cfg_apply (struct bna_rxf *rxf) +{ +/* Enable/disable allmulti mode */ +if (is_allmulti_enable (rxf->rxmode_pending, + rxf->rxmode_pending_bitmask)) { +/* move allmulti configuration from pending -> active */ +allmulti_inactive (rxf->rxmode_pending, + rxf->rxmode_pending_bitmask); + rxf->rxmode_active |=BNA_RXMODE_ALLMULTI ; +bna_bfi_mcast_filter_req (rxf,BNA_STATUS_T_DISABLED ); +return 1 ; + }else if (is_allmulti_disable (rxf->rxmode_pending, + rxf->rxmode_pending_bitmask)) { +/* move allmulti configuration from pending -> active */ +allmulti_inactive (rxf->rxmode_pending, + rxf->rxmode_pending_bitmask); + rxf->rxmode_active &= ~BNA_RXMODE_ALLMULTI ; +bna_bfi_mcast_filter_req (rxf,BNA_STATUS_T_ENABLED ); +return 1 ; + } + +return 0 ; +} + +static int +bna_rxf_allmulti_cfg_reset (struct bna_rxf *rxf,enum bna_cleanup_type cleanup) +{ +/* Clear pending allmulti mode disable */ +if (is_allmulti_disable (rxf->rxmode_pending, + rxf->rxmode_pending_bitmask)) { +allmulti_inactive (rxf->rxmode_pending, + rxf->rxmode_pending_bitmask); + rxf->rxmode_active &= ~BNA_RXMODE_ALLMULTI ; +if (cleanup ==BNA_HARD_CLEANUP ) { +bna_bfi_mcast_filter_req (rxf,BNA_STATUS_T_ENABLED ); +return 1 ; + } + } + +/* Move allmulti mode config from active -> pending */ +if (rxf->rxmode_active &BNA_RXMODE_ALLMULTI ) { +allmulti_enable (rxf->rxmode_pending, + rxf->rxmode_pending_bitmask); + rxf->rxmode_active &= ~BNA_RXMODE_ALLMULTI ; +if (cleanup ==BNA_HARD_CLEANUP ) { +bna_bfi_mcast_filter_req (rxf,BNA_STATUS_T_ENABLED ); +return 1 ; + } + } + +return 0 ; +} + +static int +bna_rxf_promisc_enable (struct bna_rxf *rxf) +{ +struct bna *bna = rxf->rx->bna; +int ret =0 ; + +if (is_promisc_enable (rxf->rxmode_pending, + rxf->rxmode_pending_bitmask) || + (rxf->rxmode_active &BNA_RXMODE_PROMISC )) { +/* Do nothing if pending enable or already enabled */ + }else if (is_promisc_disable (rxf->rxmode_pending, + rxf->rxmode_pending_bitmask)) { +/* Turn off pending disable command */ +promisc_inactive (rxf->rxmode_pending, + rxf->rxmode_pending_bitmask); + }else { +/* Schedule enable */ +promisc_enable (rxf->rxmode_pending, + rxf->rxmode_pending_bitmask); + bna->promisc_rid = rxf->rx->rid; + ret =1 ; + } + +return ret; +} + +static int +bna_rxf_promisc_disable (struct bna_rxf *rxf) +{ +struct bna *bna = rxf->rx->bna; +int ret =0 ; + +if (is_promisc_disable (rxf->rxmode_pending, + rxf->rxmode_pending_bitmask) || + (!(rxf->rxmode_active &BNA_RXMODE_PROMISC ))) { +/* Do nothing if pending disable or already disabled */ + }else if (is_promisc_enable (rxf->rxmode_pending, + rxf->rxmode_pending_bitmask)) { +/* Turn off pending enable command */ +promisc_inactive (rxf->rxmode_pending, + rxf->rxmode_pending_bitmask); + bna->promisc_rid =BFI_INVALID_RID ; + }else if (rxf->rxmode_active &BNA_RXMODE_PROMISC ) { +/* Schedule disable */ +promisc_disable (rxf->rxmode_pending, + rxf->rxmode_pending_bitmask); + ret =1 ; + } + +return ret; +} + +static int +bna_rxf_allmulti_enable (struct bna_rxf *rxf) +{ +int ret =0 ; + +if (is_allmulti_enable (rxf->rxmode_pending, + rxf->rxmode_pending_bitmask) || + (rxf->rxmode_active &BNA_RXMODE_ALLMULTI )) { +/* Do nothing if pending enable or already enabled */ + }else if (is_allmulti_disable (rxf->rxmode_pending, + rxf->rxmode_pending_bitmask)) { +/* Turn off pending disable command */ +allmulti_inactive (rxf->rxmode_pending, + rxf->rxmode_pending_bitmask); + }else { +/* Schedule enable */ +allmulti_enable (rxf->rxmode_pending, + rxf->rxmode_pending_bitmask); + ret =1 ; + } + +return ret; +} + +static int +bna_rxf_allmulti_disable (struct bna_rxf *rxf) +{ +int ret =0 ; + +if (is_allmulti_disable (rxf->rxmode_pending, + rxf->rxmode_pending_bitmask) || + (!(rxf->rxmode_active &BNA_RXMODE_ALLMULTI ))) { +/* Do nothing if pending disable or already disabled */ + }else if (is_allmulti_enable (rxf->rxmode_pending, + rxf->rxmode_pending_bitmask)) { +/* Turn off pending enable command */ +allmulti_inactive (rxf->rxmode_pending, + rxf->rxmode_pending_bitmask); + }else if (rxf->rxmode_active &BNA_RXMODE_ALLMULTI ) { +/* Schedule disable */ +allmulti_disable (rxf->rxmode_pending, + rxf->rxmode_pending_bitmask); + ret =1 ; + } + +return ret; +} + +static int +bna_rxf_vlan_strip_cfg_apply (struct bna_rxf *rxf) +{ +if (rxf->vlan_strip_pending) { + rxf->vlan_strip_pending = false; +bna_bfi_vlan_strip_enable (rxf); +return 1 ; + } + +return 0 ; +} + +enum bna_cb_status +bna_rx_mcast_del (struct bna_rx *rx,u8 *addr, +void (*cbfn)(struct bnad *,struct bna_rx *)) +{ +struct bna_rxf *rxf = &rx->rxf; +struct bna_mac *mac; + + + mac =bna_mac_find (&rxf->mcast_pending_add_q, addr); +if (mac) { +list_del (&mac->qe); +bfa_q_qe_init (&mac->qe); +bna_mcam_mod_mac_put (&rxf->rx->bna->mcam_mod, mac); +if (cbfn) + (*cbfn)(rx->bna->bnad, rx); +return BNA_CB_SUCCESS ; + } + + mac =bna_mac_find (&rxf->mcast_active_q, addr); +if (mac) { +list_del (&mac->qe); +bfa_q_qe_init (&mac->qe); +list_add_tail (&mac->qe, &rxf->mcast_pending_del_q); + rxf->cam_fltr_cbfn = cbfn; + rxf->cam_fltr_cbarg = rx->bna->bnad; +bfa_fsm_send_event (rxf,RXF_E_CONFIG ); +return BNA_CB_SUCCESS ; + } + +return BNA_CB_INVALID_MAC ; +} + +void +bna_rx_mcast_delall (struct bna_rx *rx, +void (*cbfn)(struct bnad *,struct bna_rx *)) +{ +struct bna_rxf *rxf = &rx->rxf; +struct list_head *qe; +struct bna_mac *mac; +int need_hw_config =0 ; + + +/* Purge all entries from pending_add_q */ +while (!list_empty (&rxf->mcast_pending_add_q)) { +bfa_q_deq (&rxf->mcast_pending_add_q, &qe); + mac = (struct bna_mac *)qe; +bfa_q_qe_init (&mac->qe); +bna_mcam_mod_mac_put (&rxf->rx->bna->mcam_mod, mac); + } + +/* Schedule all entries in active_q for deletion */ +while (!list_empty (&rxf->mcast_active_q)) { +bfa_q_deq (&rxf->mcast_active_q, &qe); + mac = (struct bna_mac *)qe; +bfa_q_qe_init (&mac->qe); +list_add_tail (&mac->qe, &rxf->mcast_pending_del_q); + need_hw_config =1 ; + } + +if (need_hw_config) { + rxf->cam_fltr_cbfn = cbfn; + rxf->cam_fltr_cbarg = rx->bna->bnad; +bfa_fsm_send_event (rxf,RXF_E_CONFIG ); +return ; + } + +if (cbfn) + (*cbfn)(rx->bna->bnad, rx); }/** * RX */ -#define RXQ_RCB_INIT (q, rxp, qdepth, bna, _id, unmapq_mem) do { \ - struct bna_doorbell_qset *_qset; \ - unsigned long off; \ - (q)->rcb->producer_index = (q)->rcb->consumer_index = 0; \ - (q)->rcb->q_depth = (qdepth); \ - (q)->rcb->unmap_q = unmapq_mem; \ - (q)->rcb->rxq = (q); \ - (q)->rcb->cq = &(rxp)->cq; \ - (q)->rcb->bnad = (bna)->bnad; \ - _qset = (struct bna_doorbell_qset *)0; \ - off = (unsigned long)&_qset[(q)->rxq_id].rxq[0]; \ - (q)->rcb->q_dbell = off + \ - BNA_GET_DOORBELL_BASE_ADDR((bna)->pcidev.pci_bar_kva); \ - (q)->rcb->id = _id; \ -} while (0)#define BNA_GET_RXQS (qcfg) (((qcfg)->rxp_type == BNA_RXP_SINGLE) ? \ (qcfg)->num_paths : ((qcfg)->num_paths * 2))
@@ -1811,77 +1392,57 @@ bna_rx_vlan_del(struct bna_rx *rx, int vlan_id)#define SIZE_TO_PAGES (size) (((size) >> PAGE_SHIFT) + ((((size) &\ (PAGE_SIZE - 1)) + (PAGE_SIZE - 1)) >> PAGE_SHIFT)) -#define call_rx_stop_callback (rx, status) \ +#define call_rx_stop_cbfn (rx) \ +do { \ if ((rx)->stop_cbfn) { \ - (*(rx)->stop_cbfn)((rx)->stop_cbarg, rx, (status)); \ + void (*cbfn)(void *, struct bna_rx *); \ + void *cbarg; \ + cbfn = (rx)->stop_cbfn; \ + cbarg = (rx)->stop_cbarg; \ (rx)->stop_cbfn = NULL; \ (rx)->stop_cbarg = NULL; \ - } - -/* -* Since rx_enable is synchronous callback, there is no start_cbfn required. -* Instead, we'll call bnad_rx_post(rxp) so that bnad can post the buffers -* for each rxpath. -*/ + cbfn(cbarg, rx); \ + } \ +} while (0) -#define call_rx_disable_cbfn (rx, status) \ - if ((rx)->disable_cbfn) { \ - (*(rx)->disable_cbfn)((rx)->disable_cbarg, \ - status); \ - (rx)->disable_cbfn = NULL; \ - (rx)->disable_cbarg = NULL; \ - } \ - -#define rxqs_reqd (type, num_rxqs) \ - (((type) == BNA_RXP_SINGLE) ? (num_rxqs) : ((num_rxqs) * 2)) - -#define rx_ib_fail (rx) \ -do { \ - struct bna_rxp *rxp; \ - struct list_head *qe; \ - list_for_each(qe, &(rx)->rxp_q) { \ - rxp = (struct bna_rxp *)qe; \ - bna_ib_fail(rxp->cq.ib); \ - } \ +#define bfi_enet_datapath_q_init (bfi_q, bna_qpt) \ +do { \ + struct bna_dma_addr cur_q_addr = \ + *((struct bna_dma_addr *)((bna_qpt)->kv_qpt_ptr)); \ + (bfi_q)->pg_tbl.a32.addr_lo = (bna_qpt)->hw_qpt_ptr.lsb; \ + (bfi_q)->pg_tbl.a32.addr_hi = (bna_qpt)->hw_qpt_ptr.msb; \ + (bfi_q)->first_entry.a32.addr_lo = cur_q_addr.lsb; \ + (bfi_q)->first_entry.a32.addr_hi = cur_q_addr.msb; \ + (bfi_q)->pages = htons((u16)(bna_qpt)->page_count); \ + (bfi_q)->page_sz = htons((u16)(bna_qpt)->page_size);\ } while (0) -static void __bna_multi_rxq_stop (struct bna_rxp *,u32 *); -static void __bna_rxq_start (struct bna_rxq *rxq); -static void __bna_cq_start (struct bna_cq *cq); -static void bna_rit_create (struct bna_rx *rx); -static void bna_rx_cb_multi_rxq_stopped (void *arg,int status); -static void bna_rx_cb_rxq_stopped_all (void *arg); +static void bna_bfi_rx_enet_start (struct bna_rx *rx); +static void bna_rx_enet_stop (struct bna_rx *rx); +static void bna_rx_mod_cb_rx_stopped (void *arg,struct bna_rx *rx);bfa_fsm_state_decl (bna_rx, stopped, struct bna_rx, enum bna_rx_event); +bfa_fsm_state_decl (bna_rx, start_wait, + struct bna_rx, enum bna_rx_event);bfa_fsm_state_decl (bna_rx, rxf_start_wait, struct bna_rx, enum bna_rx_event);bfa_fsm_state_decl (bna_rx, started, struct bna_rx, enum bna_rx_event);bfa_fsm_state_decl (bna_rx, rxf_stop_wait, struct bna_rx, enum bna_rx_event); -bfa_fsm_state_decl (bna_rx, rxq_stop_wait, +bfa_fsm_state_decl (bna_rx, stop_wait, + struct bna_rx, enum bna_rx_event); +bfa_fsm_state_decl (bna_rx, cleanup_wait, + struct bna_rx, enum bna_rx_event); +bfa_fsm_state_decl (bna_rx, failed, + struct bna_rx, enum bna_rx_event); +bfa_fsm_state_decl (bna_rx, quiesce_wait, struct bna_rx, enum bna_rx_event); - -static const struct bfa_sm_table rx_sm_table[] = { - {BFA_SM (bna_rx_sm_stopped),BNA_RX_STOPPED }, - {BFA_SM (bna_rx_sm_rxf_start_wait),BNA_RX_RXF_START_WAIT }, - {BFA_SM (bna_rx_sm_started),BNA_RX_STARTED }, - {BFA_SM (bna_rx_sm_rxf_stop_wait),BNA_RX_RXF_STOP_WAIT }, - {BFA_SM (bna_rx_sm_rxq_stop_wait),BNA_RX_RXQ_STOP_WAIT }, -};static void bna_rx_sm_stopped_entry (struct bna_rx *rx) { -struct bna_rxp *rxp; -struct list_head *qe_rxp; - -list_for_each (qe_rxp, &rx->rxp_q) { - rxp = (struct bna_rxp *)qe_rxp; - rx->rx_cleanup_cbfn (rx->bna->bnad, rxp->cq.ccb); - } - -call_rx_stop_callback (rx,BNA_CB_SUCCESS ); +call_rx_stop_cbfn (rx); } static void bna_rx_sm_stopped(struct bna_rx *rx,
@@ -1889,44 +1450,53 @@ static void bna_rx_sm_stopped(struct bna_rx *rx, {switch (event) {case RX_E_START : -bfa_fsm_set_state (rx, bna_rx_sm_rxf_start_wait); +bfa_fsm_set_state (rx, bna_rx_sm_start_wait);break ; +case RX_E_STOP : -call_rx_stop_callback (rx,BNA_CB_SUCCESS ); +call_rx_stop_cbfn (rx);break ; +case RX_E_FAIL :/* no-op */ break ; +default :bfa_sm_fault (event);break ; } +} +static void bna_rx_sm_start_wait_entry (struct bna_rx *rx) +{ +bna_bfi_rx_enet_start (rx); } -static void bna_rx_sm_rxf_start_wait_entry (struct bna_rx *rx) +static void bna_rx_sm_start_wait (struct bna_rx *rx, +enum bna_rx_event event) { -struct bna_rxp *rxp; -struct list_head *qe_rxp; -struct bna_rxq *q0 =NULL , *q1 =NULL ; +switch (event) { +case RX_E_STOP : +bfa_fsm_set_state (rx, bna_rx_sm_stop_wait); +break ; + +case RX_E_FAIL : +bfa_fsm_set_state (rx, bna_rx_sm_stopped); +break ; -/* Setup the RIT */ -bna_rit_create (rx); +case RX_E_STARTED : +bfa_fsm_set_state (rx, bna_rx_sm_rxf_start_wait); +break ; -list_for_each (qe_rxp, &rx->rxp_q) { - rxp = (struct bna_rxp *)qe_rxp; -bna_ib_start (rxp->cq.ib); -GET_RXQS (rxp, q0, q1); - q0->buffer_size =bna_port_mtu_get (&rx->bna->port); -__bna_rxq_start (q0); - rx->rx_post_cbfn (rx->bna->bnad, q0->rcb); -if (q1) { -__bna_rxq_start (q1); - rx->rx_post_cbfn (rx->bna->bnad, q1->rcb); - } -__bna_cq_start (&rxp->cq); +default : +bfa_sm_fault (event); +break ; } +} +static void bna_rx_sm_rxf_start_wait_entry (struct bna_rx *rx) +{ + rx->rx_post_cbfn (rx->bna->bnad, rx);bna_rxf_start (&rx->rxf); }
@@ -1937,14 +1507,17 @@ static void bna_rx_sm_rxf_start_wait(struct bna_rx *rx,case RX_E_STOP :bfa_fsm_set_state (rx, bna_rx_sm_rxf_stop_wait);break ; +case RX_E_FAIL : -bfa_fsm_set_state (rx, bna_rx_sm_stopped); -rx_ib_fail (rx); +bfa_fsm_set_state (rx, bna_rx_sm_failed);bna_rxf_fail (&rx->rxf); + rx->rx_cleanup_cbfn (rx->bna->bnad, rx);break ; +case RX_E_RXF_STARTED :bfa_fsm_set_state (rx, bna_rx_sm_started);break ; +default :bfa_sm_fault (event);break ;
@@ -1956,30 +1529,34 @@ bna_rx_sm_started_entry(struct bna_rx *rx) {struct bna_rxp *rxp;struct list_head *qe_rxp; +int is_regular = (rx->type ==BNA_RX_T_REGULAR );/* Start IB */ list_for_each (qe_rxp, &rx->rxp_q) { rxp = (struct bna_rxp *)qe_rxp; -bna_ib_ack (&rxp->cq.ib->door_bell,0 ); +bna_ib_start (rx->bna, &rxp->cq.ib, is_regular); } -bna_llport_rx_started (&rx->bna->port.llport); +bna_ethport_cb_rx_started (&rx->bna->ethport); }void bna_rx_sm_started (struct bna_rx *rx,enum bna_rx_event event) {switch (event) { -case RX_E_FAIL : -bna_llport_rx_stopped (&rx->bna->port.llport); -bfa_fsm_set_state (rx, bna_rx_sm_stopped); -rx_ib_fail (rx); -bna_rxf_fail (&rx->rxf); -break ;case RX_E_STOP : -bna_llport_rx_stopped (&rx->bna->port.llport);bfa_fsm_set_state (rx, bna_rx_sm_rxf_stop_wait); +bna_ethport_cb_rx_stopped (&rx->bna->ethport); +bna_rxf_stop (&rx->rxf);break ; + +case RX_E_FAIL : +bfa_fsm_set_state (rx, bna_rx_sm_failed); +bna_ethport_cb_rx_stopped (&rx->bna->ethport); +bna_rxf_fail (&rx->rxf); + rx->rx_cleanup_cbfn (rx->bna->bnad, rx); +break ; +default :bfa_sm_fault (event);break ;
@@ -1989,27 +1566,27 @@ bna_rx_sm_started(struct bna_rx *rx, enum bna_rx_event event)void bna_rx_sm_rxf_stop_wait_entry (struct bna_rx *rx) { -bna_rxf_stop (&rx->rxf); }void bna_rx_sm_rxf_stop_wait (struct bna_rx *rx,enum bna_rx_event event) {switch (event) { -case RX_E_RXF_STOPPED : -bfa_fsm_set_state (rx, bna_rx_sm_rxq_stop_wait); +case RX_E_FAIL : +bfa_fsm_set_state (rx, bna_rx_sm_cleanup_wait); +bna_rxf_fail (&rx->rxf); + rx->rx_cleanup_cbfn (rx->bna->bnad, rx);break ; +case RX_E_RXF_STARTED : -/** -* RxF was in the process of starting up when -* RXF_E_STOP was issued. Ignore this event -*/ +bna_rxf_stop (&rx->rxf);break ; -case RX_E_FAIL : -bfa_fsm_set_state (rx, bna_rx_sm_stopped); -rx_ib_fail (rx); -bna_rxf_fail (&rx->rxf); + +case RX_E_RXF_STOPPED : +bfa_fsm_set_state (rx, bna_rx_sm_stop_wait); +bna_rx_enet_stop (rx);break ; +default :bfa_sm_fault (event);break ;
@@ -2018,51 +1595,24 @@ bna_rx_sm_rxf_stop_wait(struct bna_rx *rx, enum bna_rx_event event) }void -bna_rx_sm_rxq_stop_wait_entry (struct bna_rx *rx) +bna_rx_sm_stop_wait_entry (struct bna_rx *rx) { -struct bna_rxp *rxp =NULL ; -struct bna_rxq *q0 =NULL ; -struct bna_rxq *q1 =NULL ; -struct list_head *qe; -u32 rxq_mask[2 ] = {0 ,0 }; - -/* Only one call to multi-rxq-stop for all RXPs in this RX */ -bfa_wc_up (&rx->rxq_stop_wc); -list_for_each (qe, &rx->rxp_q) { - rxp = (struct bna_rxp *)qe; -GET_RXQS (rxp, q0, q1); -if (q0->rxq_id <32 ) - rxq_mask[0 ] |= ((u32 )1 << q0->rxq_id); -else - rxq_mask[1 ] |= ((u32 )1 << (q0->rxq_id -32 )); -if (q1) { -if (q1->rxq_id <32 ) - rxq_mask[0 ] |= ((u32 )1 << q1->rxq_id); -else - rxq_mask[1 ] |= ((u32 ) -1 << (q1->rxq_id -32 )); - } - } - -__bna_multi_rxq_stop (rxp, rxq_mask); }void -bna_rx_sm_rxq_stop_wait (struct bna_rx *rx,enum bna_rx_event event) +bna_rx_sm_stop_wait (struct bna_rx *rx,enum bna_rx_event event) { -struct bna_rxp *rxp =NULL ; -struct list_head *qe; -switch (event) { -case RX_E_RXQ_STOPPED : -list_for_each (qe, &rx->rxp_q) { - rxp = (struct bna_rxp *)qe; -bna_ib_stop (rxp->cq.ib); - } -/* Fall through */ case RX_E_FAIL : -bfa_fsm_set_state (rx, bna_rx_sm_stopped); +case RX_E_STOPPED : +bfa_fsm_set_state (rx, bna_rx_sm_cleanup_wait); + rx->rx_cleanup_cbfn (rx->bna->bnad, rx); +break ; + +case RX_E_STARTED : +bna_rx_enet_stop (rx);break ; +default :bfa_sm_fault (event);break ;
@@ -2070,184 +1620,214 @@ bna_rx_sm_rxq_stop_wait(struct bna_rx *rx, enum bna_rx_event event) }void -__bna_multi_rxq_stop (struct bna_rxp *rxp,u32 * rxq_id_mask) +bna_rx_sm_cleanup_wait_entry (struct bna_rx *rx) { -struct bfi_ll_q_stop_req ll_req; - -bfi_h2i_set (ll_req.mh,BFI_MC_LL ,BFI_LL_H2I_RXQ_STOP_REQ ,0 ); - ll_req.q_id_mask[0 ] =htonl (rxq_id_mask[0 ]); - ll_req.q_id_mask[1 ] =htonl (rxq_id_mask[1 ]); -bna_mbox_qe_fill (&rxp->mbox_qe, &ll_req,sizeof (ll_req), - bna_rx_cb_multi_rxq_stopped, rxp); -bna_mbox_send (rxp->rx->bna, &rxp->mbox_qe); }void -__bna_rxq_start (struct bna_rxq *rxq) +bna_rx_sm_cleanup_wait (struct bna_rx *rx,enum bna_rx_event event) { -struct bna_rxtx_q_mem *q_mem; -struct bna_rxq_mem rxq_cfg, *rxq_mem; -struct bna_dma_addr cur_q_addr; -/* struct bna_doorbell_qset *qset; */ -struct bna_qpt *qpt; -u32 pg_num; -struct bna *bna = rxq->rx->bna; -void __iomem *base_addr; -unsigned long off; - - qpt = &rxq->qpt; - cur_q_addr = *((struct bna_dma_addr *)(qpt->kv_qpt_ptr)); - - rxq_cfg.pg_tbl_addr_lo = qpt->hw_qpt_ptr.lsb; - rxq_cfg.pg_tbl_addr_hi = qpt->hw_qpt_ptr.msb; - rxq_cfg.cur_q_entry_lo = cur_q_addr.lsb; - rxq_cfg.cur_q_entry_hi = cur_q_addr.msb; - - rxq_cfg.pg_cnt_n_prd_ptr = ((u32 )qpt->page_count <<16 ) |0x0 ; - rxq_cfg.entry_n_pg_size = ((u32)(BFI_RXQ_WI_SIZE >>2 ) <<16 ) | - (qpt->page_size >>2 ); - rxq_cfg.sg_n_cq_n_cns_ptr = - ((u32)(rxq->rxp->cq.cq_id &0xff ) <<16 ) |0x0 ; - rxq_cfg.buf_sz_n_q_state = ((u32 )rxq->buffer_size <<16 ) | -BNA_Q_IDLE_STATE ; - rxq_cfg.next_qid =0x0 | (0x3 <<8 ); - -/* Write the page number register */ - pg_num =BNA_GET_PAGE_NUM (HQM0_BLK_PG_NUM + bna->port_num, -HQM_RXTX_Q_RAM_BASE_OFFSET ); -writel (pg_num, bna->regs.page_addr); - -/* Write to h/w */ - base_addr =BNA_GET_MEM_BASE_ADDR (bna->pcidev.pci_bar_kva, -HQM_RXTX_Q_RAM_BASE_OFFSET ); - - q_mem = (struct bna_rxtx_q_mem *)0 ; - rxq_mem = &q_mem[rxq->rxq_id].rxq; - - off = (unsigned long )&rxq_mem->pg_tbl_addr_lo; -writel (htonl (rxq_cfg.pg_tbl_addr_lo), base_addr + off); +switch (event) {
Lines of this file are not shown. View the raw message.
The rest of this diff is not shown. View the raw message.
Signature · 1 line
1.7.1
Part of the diff is not shown here. View the raw message.
PATCH 9/45 bna: ENET and Tx Rx Redesign Update
In reply to Rasesh ModyChange details:
- This patch contains the structure and function definition changes to bna.h, bna_types.has a result of Ethport, Enet, IOCEth, Tx, Rx redesign. It removes all unused HW register definition from bna_hw.h. It contains structure name change for stats collection, removal of get_regs support in bnad_ethtool.c
--- drivers/net/bna/Makefile | 2 +- drivers/net/bna/bfa_ioc.c | 2 +- drivers/net/bna/bfi.h | 8 + drivers/net/bna/bfi_ll.h | 13 - drivers/net/bna/bna.h | 419 +++++++----- drivers/net/bna/bna_hw.h | 1463 ++++++---------------------------------- drivers/net/bna/bna_types.h | 653 +++++++----------- drivers/net/bna/bnad.c | 428 ++++++++----- drivers/net/bna/bnad.h | 32 +- drivers/net/bna/bnad_ethtool.c | 384 +---------- drivers/net/bna/cna.h | 31 +- include/linux/pci_ids.h | 1 + 12 files changed, 1070 insertions(+), 2366 deletions(-)
drivers/net/bna/Makefile +1 -1
@@ -5,7 +5,7 @@ obj-$(CONFIG_BNA) += bna.o -bna-objs := bnad.o bnad_ethtool.o bna_ctrl.o bna_txrx.o +bna-objs := bnad.o bnad_ethtool.o bna_enet.o bna_txrx.o bna-objs += bfa_msgq.o bfa_ioc.o bfa_ioc_ct.o bfa_cee.o bna-objs += cna_fwimg.o
drivers/net/bna/bfa_ioc.c +1 -1
@@ -19,7 +19,7 @@#include "bfa_ioc.h" #include "cna.h" #include "bfi.h" -#include "bfi_ctreg.h" +#include "bfi_reg.h" #include "bfa_defs.h" /**
drivers/net/bna/bfi.h +8 -0
@@ -149,6 +149,14 @@ struct bfi_mbmsg { };/** +* Supported PCI function class codes (personality) +*/ +enum bfi_pcifn_class { +BFI_PCIFN_CLASS_FC =0x0c04 , +BFI_PCIFN_CLASS_ETH =0x0200 , +}; + +/** * Message Classes */ enum bfi_mclass {
drivers/net/bna/bfi_ll.h +0 -13
@@ -233,19 +233,6 @@ struct bfi_ll_rsp { };/** -* @brief bfi_ll_cee_aen is used by: -* BFI_LL_I2H_LINK_DOWN_AEN -* BFI_LL_I2H_LINK_UP_AEN -*/ -struct bfi_ll_aen { -struct bfi_mhdr mh;/*!< common msg header */ -u32 reason; -u8 cee_linkup; -u8 prio_map;/*!< LL priority bit-map */ -u8 rsvd[2 ]; -}; - -/** * @brief * The following error codes can be returned * by the mbox commands
drivers/net/bna/bna.h +259 -160
556 lines not on this page · raw message
drivers/net/bna/bna_hw.h +195 -1268
1,582 lines not on this page · raw message
drivers/net/bna/bna_types.h +255 -398
813 lines not on this page · raw message
drivers/net/bna/bnad.c +269 -159
428 lines not on this page · raw message
drivers/net/bna/bnad_ethtool.c +30 -354
384 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
1.7.1
Part of the diff is not shown here. View the raw message.
PATCH 10/45 bna: Remove Obsolete Files
In reply to Rasesh ModyChange details:
- Removec bfi_ctreg.h bna_ctrl.c and bfi_ll.h due to ENET, MSGQ and TXRX changes for new FW Driver interface.
--- drivers/net/bna/bfi_ctreg.h | 646 --------- drivers/net/bna/bfi_ll.h | 425 ------ drivers/net/bna/bna_ctrl.c | 3079 ------------------------------------------- 3 files changed, 0 insertions(+), 4150 deletions(-) delete mode 100644 drivers/net/bna/bfi_ctreg.h delete mode 100644 drivers/net/bna/bfi_ll.h delete mode 100644 drivers/net/bna/bna_ctrl.c
drivers/net/bna/bfi_ctreg.h deleted +0 -646
@@ -1,646 +0,0 @@ -/* -* Linux network driver for Brocade Converged Network Adapter. -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of the GNU General Public License (GPL) Version 2 as -* published by the Free Software Foundation -* -* This program is distributed in the hope that it will be useful, but -* WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* General Public License for more details. -*/ -/* -* Copyright (c) 2005-2010 Brocade Communications Systems, Inc. -* All rights reserved -* www.brocade.com -*/ - -/* -* bfi_ctreg.h catapult host block register definitions -* -* !!! Do not edit. Auto generated. !!! -*/ - -#ifndef __BFI_CTREG_H__ -#define __BFI_CTREG_H__ - -#define HOSTFN0_LPU_MBOX0_0 0x00019200 -#define HOSTFN1_LPU_MBOX0_8 0x00019260 -#define LPU_HOSTFN0_MBOX0_0 0x00019280 -#define LPU_HOSTFN1_MBOX0_8 0x000192e0 -#define HOSTFN2_LPU_MBOX0_0 0x00019400 -#define HOSTFN3_LPU_MBOX0_8 0x00019460 -#define LPU_HOSTFN2_MBOX0_0 0x00019480 -#define LPU_HOSTFN3_MBOX0_8 0x000194e0 -#define HOSTFN0_INT_STATUS 0x00014000 -#define __HOSTFN0_HALT_OCCURRED 0x01000000 -#define __HOSTFN0_INT_STATUS_LVL_MK 0x00f00000 -#define __HOSTFN0_INT_STATUS_LVL_SH 20 -#define __HOSTFN0_INT_STATUS_LVL (_v) ((_v) << __HOSTFN0_INT_STATUS_LVL_SH) -#define __HOSTFN0_INT_STATUS_P_MK 0x000f0000 -#define __HOSTFN0_INT_STATUS_P_SH 16 -#define __HOSTFN0_INT_STATUS_P (_v) ((_v) << __HOSTFN0_INT_STATUS_P_SH) -#define __HOSTFN0_INT_STATUS_F 0x0000ffff -#define HOSTFN0_INT_MSK 0x00014004 -#define HOST_PAGE_NUM_FN0 0x00014008 -#define __HOST_PAGE_NUM_FN 0x000001ff -#define HOST_MSIX_ERR_INDEX_FN0 0x0001400c -#define __MSIX_ERR_INDEX_FN 0x000001ff -#define HOSTFN1_INT_STATUS 0x00014100 -#define __HOSTFN1_HALT_OCCURRED 0x01000000 -#define __HOSTFN1_INT_STATUS_LVL_MK 0x00f00000 -#define __HOSTFN1_INT_STATUS_LVL_SH 20 -#define __HOSTFN1_INT_STATUS_LVL (_v) ((_v) << __HOSTFN1_INT_STATUS_LVL_SH) -#define __HOSTFN1_INT_STATUS_P_MK 0x000f0000 -#define __HOSTFN1_INT_STATUS_P_SH 16 -#define __HOSTFN1_INT_STATUS_P (_v) ((_v) << __HOSTFN1_INT_STATUS_P_SH) -#define __HOSTFN1_INT_STATUS_F 0x0000ffff -#define HOSTFN1_INT_MSK 0x00014104 -#define HOST_PAGE_NUM_FN1 0x00014108 -#define HOST_MSIX_ERR_INDEX_FN1 0x0001410c -#define APP_PLL_425_CTL_REG 0x00014204 -#define __P_425_PLL_LOCK 0x80000000 -#define __APP_PLL_425_SRAM_USE_100MHZ 0x00100000 -#define __APP_PLL_425_RESET_TIMER_MK 0x000e0000 -#define __APP_PLL_425_RESET_TIMER_SH 17 -#define __APP_PLL_425_RESET_TIMER (_v) ((_v) << __APP_PLL_425_RESET_TIMER_SH) -#define __APP_PLL_425_LOGIC_SOFT_RESET 0x00010000 -#define __APP_PLL_425_CNTLMT0_1_MK 0x0000c000 -#define __APP_PLL_425_CNTLMT0_1_SH 14 -#define __APP_PLL_425_CNTLMT0_1 (_v) ((_v) << __APP_PLL_425_CNTLMT0_1_SH) -#define __APP_PLL_425_JITLMT0_1_MK 0x00003000 -#define __APP_PLL_425_JITLMT0_1_SH 12 -#define __APP_PLL_425_JITLMT0_1 (_v) ((_v) << __APP_PLL_425_JITLMT0_1_SH) -#define __APP_PLL_425_HREF 0x00000800 -#define __APP_PLL_425_HDIV 0x00000400 -#define __APP_PLL_425_P0_1_MK 0x00000300 -#define __APP_PLL_425_P0_1_SH 8 -#define __APP_PLL_425_P0_1 (_v) ((_v) << __APP_PLL_425_P0_1_SH) -#define __APP_PLL_425_Z0_2_MK 0x000000e0 -#define __APP_PLL_425_Z0_2_SH 5 -#define __APP_PLL_425_Z0_2 (_v) ((_v) << __APP_PLL_425_Z0_2_SH) -#define __APP_PLL_425_RSEL200500 0x00000010 -#define __APP_PLL_425_ENARST 0x00000008 -#define __APP_PLL_425_BYPASS 0x00000004 -#define __APP_PLL_425_LRESETN 0x00000002 -#define __APP_PLL_425_ENABLE 0x00000001 -#define APP_PLL_312_CTL_REG 0x00014208 -#define __P_312_PLL_LOCK 0x80000000 -#define __ENABLE_MAC_AHB_1 0x00800000 -#define __ENABLE_MAC_AHB_0 0x00400000 -#define __ENABLE_MAC_1 0x00200000 -#define __ENABLE_MAC_0 0x00100000 -#define __APP_PLL_312_RESET_TIMER_MK 0x000e0000 -#define __APP_PLL_312_RESET_TIMER_SH 17 -#define __APP_PLL_312_RESET_TIMER (_v) ((_v) << __APP_PLL_312_RESET_TIMER_SH) -#define __APP_PLL_312_LOGIC_SOFT_RESET 0x00010000 -#define __APP_PLL_312_CNTLMT0_1_MK 0x0000c000 -#define __APP_PLL_312_CNTLMT0_1_SH 14 -#define __APP_PLL_312_CNTLMT0_1 (_v) ((_v) << __APP_PLL_312_CNTLMT0_1_SH) -#define __APP_PLL_312_JITLMT0_1_MK 0x00003000 -#define __APP_PLL_312_JITLMT0_1_SH 12 -#define __APP_PLL_312_JITLMT0_1 (_v) ((_v) << __APP_PLL_312_JITLMT0_1_SH) -#define __APP_PLL_312_HREF 0x00000800 -#define __APP_PLL_312_HDIV 0x00000400 -#define __APP_PLL_312_P0_1_MK 0x00000300 -#define __APP_PLL_312_P0_1_SH 8 -#define __APP_PLL_312_P0_1 (_v) ((_v) << __APP_PLL_312_P0_1_SH) -#define __APP_PLL_312_Z0_2_MK 0x000000e0 -#define __APP_PLL_312_Z0_2_SH 5 -#define __APP_PLL_312_Z0_2 (_v) ((_v) << __APP_PLL_312_Z0_2_SH) -#define __APP_PLL_312_RSEL200500 0x00000010 -#define __APP_PLL_312_ENARST 0x00000008 -#define __APP_PLL_312_BYPASS 0x00000004 -#define __APP_PLL_312_LRESETN 0x00000002 -#define __APP_PLL_312_ENABLE 0x00000001 -#define MBIST_CTL_REG 0x00014220 -#define __EDRAM_BISTR_START 0x00000004 -#define __MBIST_RESET 0x00000002 -#define __MBIST_START 0x00000001 -#define MBIST_STAT_REG 0x00014224 -#define __EDRAM_BISTR_STATUS 0x00000008 -#define __EDRAM_BISTR_DONE 0x00000004 -#define __MEM_BIT_STATUS 0x00000002 -#define __MBIST_DONE 0x00000001 -#define HOST_SEM0_REG 0x00014230 -#define __HOST_SEMAPHORE 0x00000001 -#define HOST_SEM1_REG 0x00014234 -#define HOST_SEM2_REG 0x00014238 -#define HOST_SEM3_REG 0x0001423c -#define HOST_SEM0_INFO_REG 0x00014240 -#define HOST_SEM1_INFO_REG 0x00014244 -#define HOST_SEM2_INFO_REG 0x00014248 -#define HOST_SEM3_INFO_REG 0x0001424c -#define ETH_MAC_SER_REG 0x00014288 -#define __APP_EMS_CKBUFAMPIN 0x00000020 -#define __APP_EMS_REFCLKSEL 0x00000010 -#define __APP_EMS_CMLCKSEL 0x00000008 -#define __APP_EMS_REFCKBUFEN2 0x00000004 -#define __APP_EMS_REFCKBUFEN1 0x00000002 -#define __APP_EMS_CHANNEL_SEL 0x00000001 -#define HOSTFN2_INT_STATUS 0x00014300 -#define __HOSTFN2_HALT_OCCURRED 0x01000000 -#define __HOSTFN2_INT_STATUS_LVL_MK 0x00f00000 -#define __HOSTFN2_INT_STATUS_LVL_SH 20 -#define __HOSTFN2_INT_STATUS_LVL (_v) ((_v) << __HOSTFN2_INT_STATUS_LVL_SH) -#define __HOSTFN2_INT_STATUS_P_MK 0x000f0000 -#define __HOSTFN2_INT_STATUS_P_SH 16 -#define __HOSTFN2_INT_STATUS_P (_v) ((_v) << __HOSTFN2_INT_STATUS_P_SH) -#define __HOSTFN2_INT_STATUS_F 0x0000ffff -#define HOSTFN2_INT_MSK 0x00014304 -#define HOST_PAGE_NUM_FN2 0x00014308 -#define HOST_MSIX_ERR_INDEX_FN2 0x0001430c -#define HOSTFN3_INT_STATUS 0x00014400 -#define __HALT_OCCURRED 0x01000000 -#define __HOSTFN3_INT_STATUS_LVL_MK 0x00f00000 -#define __HOSTFN3_INT_STATUS_LVL_SH 20 -#define __HOSTFN3_INT_STATUS_LVL (_v) ((_v) << __HOSTFN3_INT_STATUS_LVL_SH) -#define __HOSTFN3_INT_STATUS_P_MK 0x000f0000 -#define __HOSTFN3_INT_STATUS_P_SH 16 -#define __HOSTFN3_INT_STATUS_P (_v) ((_v) << __HOSTFN3_INT_STATUS_P_SH) -#define __HOSTFN3_INT_STATUS_F 0x0000ffff -#define HOSTFN3_INT_MSK 0x00014404 -#define HOST_PAGE_NUM_FN3 0x00014408 -#define HOST_MSIX_ERR_INDEX_FN3 0x0001440c -#define FNC_ID_REG 0x00014600 -#define __FUNCTION_NUMBER 0x00000007 -#define FNC_PERS_REG 0x00014604 -#define __F3_FUNCTION_ACTIVE 0x80000000 -#define __F3_FUNCTION_MODE 0x40000000 -#define __F3_PORT_MAP_MK 0x30000000 -#define __F3_PORT_MAP_SH 28 -#define __F3_PORT_MAP (_v) ((_v) << __F3_PORT_MAP_SH) -#define __F3_VM_MODE 0x08000000 -#define __F3_INTX_STATUS_MK 0x07000000 -#define __F3_INTX_STATUS_SH 24 -#define __F3_INTX_STATUS (_v) ((_v) << __F3_INTX_STATUS_SH) -#define __F2_FUNCTION_ACTIVE 0x00800000 -#define __F2_FUNCTION_MODE 0x00400000 -#define __F2_PORT_MAP_MK 0x00300000 -#define __F2_PORT_MAP_SH 20 -#define __F2_PORT_MAP (_v) ((_v) << __F2_PORT_MAP_SH) -#define __F2_VM_MODE 0x00080000 -#define __F2_INTX_STATUS_MK 0x00070000 -#define __F2_INTX_STATUS_SH 16 -#define __F2_INTX_STATUS (_v) ((_v) << __F2_INTX_STATUS_SH) -#define __F1_FUNCTION_ACTIVE 0x00008000 -#define __F1_FUNCTION_MODE 0x00004000 -#define __F1_PORT_MAP_MK 0x00003000 -#define __F1_PORT_MAP_SH 12 -#define __F1_PORT_MAP (_v) ((_v) << __F1_PORT_MAP_SH) -#define __F1_VM_MODE 0x00000800 -#define __F1_INTX_STATUS_MK 0x00000700 -#define __F1_INTX_STATUS_SH 8 -#define __F1_INTX_STATUS (_v) ((_v) << __F1_INTX_STATUS_SH) -#define __F0_FUNCTION_ACTIVE 0x00000080 -#define __F0_FUNCTION_MODE 0x00000040 -#define __F0_PORT_MAP_MK 0x00000030 -#define __F0_PORT_MAP_SH 4 -#define __F0_PORT_MAP (_v) ((_v) << __F0_PORT_MAP_SH) -#define __F0_VM_MODE 0x00000008 -#define __F0_INTX_STATUS 0x00000007 -enum { - __F0_INTX_STATUS_MSIX =0x0 , - __F0_INTX_STATUS_INTA =0x1 , - __F0_INTX_STATUS_INTB =0x2 , - __F0_INTX_STATUS_INTC =0x3 , - __F0_INTX_STATUS_INTD =0x4 , -}; -#define OP_MODE 0x0001460c -#define __APP_ETH_CLK_LOWSPEED 0x00000004 -#define __GLOBAL_CORECLK_HALFSPEED 0x00000002 -#define __GLOBAL_FCOE_MODE 0x00000001 -#define HOST_SEM4_REG 0x00014610 -#define HOST_SEM5_REG 0x00014614 -#define HOST_SEM6_REG 0x00014618 -#define HOST_SEM7_REG 0x0001461c -#define HOST_SEM4_INFO_REG 0x00014620 -#define HOST_SEM5_INFO_REG 0x00014624 -#define HOST_SEM6_INFO_REG 0x00014628 -#define HOST_SEM7_INFO_REG 0x0001462c -#define HOSTFN0_LPU0_MBOX0_CMD_STAT 0x00019000 -#define __HOSTFN0_LPU0_MBOX0_INFO_MK 0xfffffffe -#define __HOSTFN0_LPU0_MBOX0_INFO_SH 1 -#define __HOSTFN0_LPU0_MBOX0_INFO (_v) ((_v) << __HOSTFN0_LPU0_MBOX0_INFO_SH) -#define __HOSTFN0_LPU0_MBOX0_CMD_STATUS 0x00000001 -#define HOSTFN0_LPU1_MBOX0_CMD_STAT 0x00019004 -#define __HOSTFN0_LPU1_MBOX0_INFO_MK 0xfffffffe -#define __HOSTFN0_LPU1_MBOX0_INFO_SH 1 -#define __HOSTFN0_LPU1_MBOX0_INFO (_v) ((_v) << __HOSTFN0_LPU1_MBOX0_INFO_SH) -#define __HOSTFN0_LPU1_MBOX0_CMD_STATUS 0x00000001 -#define LPU0_HOSTFN0_MBOX0_CMD_STAT 0x00019008 -#define __LPU0_HOSTFN0_MBOX0_INFO_MK 0xfffffffe -#define __LPU0_HOSTFN0_MBOX0_INFO_SH 1 -#define __LPU0_HOSTFN0_MBOX0_INFO (_v) ((_v) << __LPU0_HOSTFN0_MBOX0_INFO_SH) -#define __LPU0_HOSTFN0_MBOX0_CMD_STATUS 0x00000001 -#define LPU1_HOSTFN0_MBOX0_CMD_STAT 0x0001900c -#define __LPU1_HOSTFN0_MBOX0_INFO_MK 0xfffffffe -#define __LPU1_HOSTFN0_MBOX0_INFO_SH 1 -#define __LPU1_HOSTFN0_MBOX0_INFO (_v) ((_v) << __LPU1_HOSTFN0_MBOX0_INFO_SH) -#define __LPU1_HOSTFN0_MBOX0_CMD_STATUS 0x00000001 -#define HOSTFN1_LPU0_MBOX0_CMD_STAT 0x00019010 -#define __HOSTFN1_LPU0_MBOX0_INFO_MK 0xfffffffe -#define __HOSTFN1_LPU0_MBOX0_INFO_SH 1 -#define __HOSTFN1_LPU0_MBOX0_INFO (_v) ((_v) << __HOSTFN1_LPU0_MBOX0_INFO_SH) -#define __HOSTFN1_LPU0_MBOX0_CMD_STATUS 0x00000001 -#define HOSTFN1_LPU1_MBOX0_CMD_STAT 0x00019014 -#define __HOSTFN1_LPU1_MBOX0_INFO_MK 0xfffffffe -#define __HOSTFN1_LPU1_MBOX0_INFO_SH 1 -#define __HOSTFN1_LPU1_MBOX0_INFO (_v) ((_v) << __HOSTFN1_LPU1_MBOX0_INFO_SH) -#define __HOSTFN1_LPU1_MBOX0_CMD_STATUS 0x00000001 -#define LPU0_HOSTFN1_MBOX0_CMD_STAT 0x00019018 -#define __LPU0_HOSTFN1_MBOX0_INFO_MK 0xfffffffe -#define __LPU0_HOSTFN1_MBOX0_INFO_SH 1 -#define __LPU0_HOSTFN1_MBOX0_INFO (_v) ((_v) << __LPU0_HOSTFN1_MBOX0_INFO_SH) -#define __LPU0_HOSTFN1_MBOX0_CMD_STATUS 0x00000001 -#define LPU1_HOSTFN1_MBOX0_CMD_STAT 0x0001901c -#define __LPU1_HOSTFN1_MBOX0_INFO_MK 0xfffffffe -#define __LPU1_HOSTFN1_MBOX0_INFO_SH 1 -#define __LPU1_HOSTFN1_MBOX0_INFO (_v) ((_v) << __LPU1_HOSTFN1_MBOX0_INFO_SH) -#define __LPU1_HOSTFN1_MBOX0_CMD_STATUS 0x00000001 -#define HOSTFN2_LPU0_MBOX0_CMD_STAT 0x00019150 -#define __HOSTFN2_LPU0_MBOX0_INFO_MK 0xfffffffe -#define __HOSTFN2_LPU0_MBOX0_INFO_SH 1 -#define __HOSTFN2_LPU0_MBOX0_INFO (_v) ((_v) << __HOSTFN2_LPU0_MBOX0_INFO_SH) -#define __HOSTFN2_LPU0_MBOX0_CMD_STATUS 0x00000001 -#define HOSTFN2_LPU1_MBOX0_CMD_STAT 0x00019154 -#define __HOSTFN2_LPU1_MBOX0_INFO_MK 0xfffffffe -#define __HOSTFN2_LPU1_MBOX0_INFO_SH 1 -#define __HOSTFN2_LPU1_MBOX0_INFO (_v) ((_v) << __HOSTFN2_LPU1_MBOX0_INFO_SH) -#define __HOSTFN2_LPU1_MBOX0BOX0_CMD_STATUS 0x00000001 -#define LPU0_HOSTFN2_MBOX0_CMD_STAT 0x00019158 -#define __LPU0_HOSTFN2_MBOX0_INFO_MK 0xfffffffe -#define __LPU0_HOSTFN2_MBOX0_INFO_SH 1 -#define __LPU0_HOSTFN2_MBOX0_INFO (_v) ((_v) << __LPU0_HOSTFN2_MBOX0_INFO_SH) -#define __LPU0_HOSTFN2_MBOX0_CMD_STATUS 0x00000001 -#define LPU1_HOSTFN2_MBOX0_CMD_STAT 0x0001915c -#define __LPU1_HOSTFN2_MBOX0_INFO_MK 0xfffffffe -#define __LPU1_HOSTFN2_MBOX0_INFO_SH 1 -#define __LPU1_HOSTFN2_MBOX0_INFO (_v) ((_v) << __LPU1_HOSTFN2_MBOX0_INFO_SH) -#define __LPU1_HOSTFN2_MBOX0_CMD_STATUS 0x00000001 -#define HOSTFN3_LPU0_MBOX0_CMD_STAT 0x00019160 -#define __HOSTFN3_LPU0_MBOX0_INFO_MK 0xfffffffe -#define __HOSTFN3_LPU0_MBOX0_INFO_SH 1 -#define __HOSTFN3_LPU0_MBOX0_INFO (_v) ((_v) << __HOSTFN3_LPU0_MBOX0_INFO_SH) -#define __HOSTFN3_LPU0_MBOX0_CMD_STATUS 0x00000001 -#define HOSTFN3_LPU1_MBOX0_CMD_STAT 0x00019164 -#define __HOSTFN3_LPU1_MBOX0_INFO_MK 0xfffffffe -#define __HOSTFN3_LPU1_MBOX0_INFO_SH 1 -#define __HOSTFN3_LPU1_MBOX0_INFO (_v) ((_v) << __HOSTFN3_LPU1_MBOX0_INFO_SH) -#define __HOSTFN3_LPU1_MBOX0_CMD_STATUS 0x00000001 -#define LPU0_HOSTFN3_MBOX0_CMD_STAT 0x00019168 -#define __LPU0_HOSTFN3_MBOX0_INFO_MK 0xfffffffe -#define __LPU0_HOSTFN3_MBOX0_INFO_SH 1 -#define __LPU0_HOSTFN3_MBOX0_INFO (_v) ((_v) << __LPU0_HOSTFN3_MBOX0_INFO_SH) -#define __LPU0_HOSTFN3_MBOX0_CMD_STATUS 0x00000001 -#define LPU1_HOSTFN3_MBOX0_CMD_STAT 0x0001916c -#define __LPU1_HOSTFN3_MBOX0_INFO_MK 0xfffffffe -#define __LPU1_HOSTFN3_MBOX0_INFO_SH 1 -#define __LPU1_HOSTFN3_MBOX0_INFO (_v) ((_v) << __LPU1_HOSTFN3_MBOX0_INFO_SH) -#define __LPU1_HOSTFN3_MBOX0_CMD_STATUS 0x00000001 -#define FW_INIT_HALT_P0 0x000191ac -#define __FW_INIT_HALT_P 0x00000001 -#define FW_INIT_HALT_P1 0x000191bc -#define CPE_PI_PTR_Q0 0x00038000 -#define __CPE_PI_UNUSED_MK 0xffff0000 -#define __CPE_PI_UNUSED_SH 16 -#define __CPE_PI_UNUSED (_v) ((_v) << __CPE_PI_UNUSED_SH) -#define __CPE_PI_PTR 0x0000ffff -#define CPE_PI_PTR_Q1 0x00038040 -#define CPE_CI_PTR_Q0 0x00038004 -#define __CPE_CI_UNUSED_MK 0xffff0000 -#define __CPE_CI_UNUSED_SH 16 -#define __CPE_CI_UNUSED (_v) ((_v) << __CPE_CI_UNUSED_SH) -#define __CPE_CI_PTR 0x0000ffff -#define CPE_CI_PTR_Q1 0x00038044 -#define CPE_DEPTH_Q0 0x00038008 -#define __CPE_DEPTH_UNUSED_MK 0xf8000000 -#define __CPE_DEPTH_UNUSED_SH 27 -#define __CPE_DEPTH_UNUSED (_v) ((_v) << __CPE_DEPTH_UNUSED_SH) -#define __CPE_MSIX_VEC_INDEX_MK 0x07ff0000 -#define __CPE_MSIX_VEC_INDEX_SH 16 -#define __CPE_MSIX_VEC_INDEX (_v) ((_v) << __CPE_MSIX_VEC_INDEX_SH) -#define __CPE_DEPTH 0x0000ffff -#define CPE_DEPTH_Q1 0x00038048 -#define CPE_QCTRL_Q0 0x0003800c -#define __CPE_CTRL_UNUSED30_MK 0xfc000000 -#define __CPE_CTRL_UNUSED30_SH 26 -#define __CPE_CTRL_UNUSED30 (_v) ((_v) << __CPE_CTRL_UNUSED30_SH) -#define __CPE_FUNC_INT_CTRL_MK 0x03000000 -#define __CPE_FUNC_INT_CTRL_SH 24 -#define __CPE_FUNC_INT_CTRL (_v) ((_v) << __CPE_FUNC_INT_CTRL_SH) -enum { - __CPE_FUNC_INT_CTRL_DISABLE =0x0 , - __CPE_FUNC_INT_CTRL_F2NF =0x1 , - __CPE_FUNC_INT_CTRL_3QUART =0x2 , - __CPE_FUNC_INT_CTRL_HALF =0x3 , -}; -#define __CPE_CTRL_UNUSED20_MK 0x00f00000 -#define __CPE_CTRL_UNUSED20_SH 20 -#define __CPE_CTRL_UNUSED20 (_v) ((_v) << __CPE_CTRL_UNUSED20_SH) -#define __CPE_SCI_TH_MK 0x000f0000 -#define __CPE_SCI_TH_SH 16 -#define __CPE_SCI_TH (_v) ((_v) << __CPE_SCI_TH_SH) -#define __CPE_CTRL_UNUSED10_MK 0x0000c000 -#define __CPE_CTRL_UNUSED10_SH 14 -#define __CPE_CTRL_UNUSED10 (_v) ((_v) << __CPE_CTRL_UNUSED10_SH) -#define __CPE_ACK_PENDING 0x00002000 -#define __CPE_CTRL_UNUSED40_MK 0x00001c00 -#define __CPE_CTRL_UNUSED40_SH 10 -#define __CPE_CTRL_UNUSED40 (_v) ((_v) << __CPE_CTRL_UNUSED40_SH) -#define __CPE_PCIEID_MK 0x00000300 -#define __CPE_PCIEID_SH 8 -#define __CPE_PCIEID (_v) ((_v) << __CPE_PCIEID_SH) -#define __CPE_CTRL_UNUSED00_MK 0x000000fe -#define __CPE_CTRL_UNUSED00_SH 1 -#define __CPE_CTRL_UNUSED00 (_v) ((_v) << __CPE_CTRL_UNUSED00_SH) -#define __CPE_ESIZE 0x00000001 -#define CPE_QCTRL_Q1 0x0003804c -#define __CPE_CTRL_UNUSED31_MK 0xfc000000 -#define __CPE_CTRL_UNUSED31_SH 26 -#define __CPE_CTRL_UNUSED31 (_v) ((_v) << __CPE_CTRL_UNUSED31_SH) -#define __CPE_CTRL_UNUSED21_MK 0x00f00000 -#define __CPE_CTRL_UNUSED21_SH 20 -#define __CPE_CTRL_UNUSED21 (_v) ((_v) << __CPE_CTRL_UNUSED21_SH) -#define __CPE_CTRL_UNUSED11_MK 0x0000c000 -#define __CPE_CTRL_UNUSED11_SH 14 -#define __CPE_CTRL_UNUSED11 (_v) ((_v) << __CPE_CTRL_UNUSED11_SH) -#define __CPE_CTRL_UNUSED41_MK 0x00001c00 -#define __CPE_CTRL_UNUSED41_SH 10 -#define __CPE_CTRL_UNUSED41 (_v) ((_v) << __CPE_CTRL_UNUSED41_SH) -#define __CPE_CTRL_UNUSED01_MK 0x000000fe -#define __CPE_CTRL_UNUSED01_SH 1 -#define __CPE_CTRL_UNUSED01 (_v) ((_v) << __CPE_CTRL_UNUSED01_SH) -#define RME_PI_PTR_Q0 0x00038020 -#define __LATENCY_TIME_STAMP_MK 0xffff0000 -#define __LATENCY_TIME_STAMP_SH 16 -#define __LATENCY_TIME_STAMP (_v) ((_v) << __LATENCY_TIME_STAMP_SH) -#define __RME_PI_PTR 0x0000ffff -#define RME_PI_PTR_Q1 0x00038060 -#define RME_CI_PTR_Q0 0x00038024 -#define __DELAY_TIME_STAMP_MK 0xffff0000 -#define __DELAY_TIME_STAMP_SH 16 -#define __DELAY_TIME_STAMP (_v) ((_v) << __DELAY_TIME_STAMP_SH) -#define __RME_CI_PTR 0x0000ffff -#define RME_CI_PTR_Q1 0x00038064 -#define RME_DEPTH_Q0 0x00038028 -#define __RME_DEPTH_UNUSED_MK 0xf8000000 -#define __RME_DEPTH_UNUSED_SH 27 -#define __RME_DEPTH_UNUSED (_v) ((_v) << __RME_DEPTH_UNUSED_SH) -#define __RME_MSIX_VEC_INDEX_MK 0x07ff0000 -#define __RME_MSIX_VEC_INDEX_SH 16 -#define __RME_MSIX_VEC_INDEX (_v) ((_v) << __RME_MSIX_VEC_INDEX_SH) -#define __RME_DEPTH 0x0000ffff -#define RME_DEPTH_Q1 0x00038068 -#define RME_QCTRL_Q0 0x0003802c -#define __RME_INT_LATENCY_TIMER_MK 0xff000000 -#define __RME_INT_LATENCY_TIMER_SH 24 -#define __RME_INT_LATENCY_TIMER (_v) ((_v) << __RME_INT_LATENCY_TIMER_SH) -#define __RME_INT_DELAY_TIMER_MK 0x00ff0000 -#define __RME_INT_DELAY_TIMER_SH 16 -#define __RME_INT_DELAY_TIMER (_v) ((_v) << __RME_INT_DELAY_TIMER_SH) -#define __RME_INT_DELAY_DISABLE 0x00008000 -#define __RME_DLY_DELAY_DISABLE 0x00004000 -#define __RME_ACK_PENDING 0x00002000 -#define __RME_FULL_INTERRUPT_DISABLE 0x00001000 -#define __RME_CTRL_UNUSED10_MK 0x00000c00 -#define __RME_CTRL_UNUSED10_SH 10 -#define __RME_CTRL_UNUSED10 (_v) ((_v) << __RME_CTRL_UNUSED10_SH) -#define __RME_PCIEID_MK 0x00000300 -#define __RME_PCIEID_SH 8 -#define __RME_PCIEID (_v) ((_v) << __RME_PCIEID_SH) -#define __RME_CTRL_UNUSED00_MK 0x000000fe -#define __RME_CTRL_UNUSED00_SH 1 -#define __RME_CTRL_UNUSED00 (_v) ((_v) << __RME_CTRL_UNUSED00_SH) -#define __RME_ESIZE 0x00000001 -#define RME_QCTRL_Q1 0x0003806c -#define __RME_CTRL_UNUSED11_MK 0x00000c00 -#define __RME_CTRL_UNUSED11_SH 10 -#define __RME_CTRL_UNUSED11 (_v) ((_v) << __RME_CTRL_UNUSED11_SH) -#define __RME_CTRL_UNUSED01_MK 0x000000fe -#define __RME_CTRL_UNUSED01_SH 1 -#define __RME_CTRL_UNUSED01 (_v) ((_v) << __RME_CTRL_UNUSED01_SH) -#define PSS_CTL_REG 0x00018800 -#define __PSS_I2C_CLK_DIV_MK 0x007f0000 -#define __PSS_I2C_CLK_DIV_SH 16 -#define __PSS_I2C_CLK_DIV (_v) ((_v) << __PSS_I2C_CLK_DIV_SH) -#define __PSS_LMEM_INIT_DONE 0x00001000 -#define __PSS_LMEM_RESET 0x00000200 -#define __PSS_LMEM_INIT_EN 0x00000100 -#define __PSS_LPU1_RESET 0x00000002 -#define __PSS_LPU0_RESET 0x00000001 -#define PSS_ERR_STATUS_REG 0x00018810 -#define __PSS_LPU1_TCM_READ_ERR 0x00200000 -#define __PSS_LPU0_TCM_READ_ERR 0x00100000 -#define __PSS_LMEM5_CORR_ERR 0x00080000 -#define __PSS_LMEM4_CORR_ERR 0x00040000 -#define __PSS_LMEM3_CORR_ERR 0x00020000 -#define __PSS_LMEM2_CORR_ERR 0x00010000 -#define __PSS_LMEM1_CORR_ERR 0x00008000 -#define __PSS_LMEM0_CORR_ERR 0x00004000 -#define __PSS_LMEM5_UNCORR_ERR 0x00002000 -#define __PSS_LMEM4_UNCORR_ERR 0x00001000 -#define __PSS_LMEM3_UNCORR_ERR 0x00000800 -#define __PSS_LMEM2_UNCORR_ERR 0x00000400 -#define __PSS_LMEM1_UNCORR_ERR 0x00000200 -#define __PSS_LMEM0_UNCORR_ERR 0x00000100 -#define __PSS_BAL_PERR 0x00000080 -#define __PSS_DIP_IF_ERR 0x00000040 -#define __PSS_IOH_IF_ERR 0x00000020 -#define __PSS_TDS_IF_ERR 0x00000010 -#define __PSS_RDS_IF_ERR 0x00000008 -#define __PSS_SGM_IF_ERR 0x00000004 -#define __PSS_LPU1_RAM_ERR 0x00000002 -#define __PSS_LPU0_RAM_ERR 0x00000001 -#define ERR_SET_REG 0x00018818 -#define __PSS_ERR_STATUS_SET 0x003fffff -#define PMM_1T_RESET_REG_P0 0x0002381c -#define __PMM_1T_RESET_P 0x00000001 -#define PMM_1T_RESET_REG_P1 0x00023c1c -#define HQM_QSET0_RXQ_DRBL_P0 0x00038000 -#define __RXQ0_ADD_VECTORS_P 0x80000000 -#define __RXQ0_STOP_P 0x40000000 -#define __RXQ0_PRD_PTR_P 0x0000ffff -#define HQM_QSET1_RXQ_DRBL_P0 0x00038080 -#define __RXQ1_ADD_VECTORS_P 0x80000000 -#define __RXQ1_STOP_P 0x40000000 -#define __RXQ1_PRD_PTR_P 0x0000ffff -#define HQM_QSET0_RXQ_DRBL_P1 0x0003c000 -#define HQM_QSET1_RXQ_DRBL_P1 0x0003c080 -#define HQM_QSET0_TXQ_DRBL_P0 0x00038020 -#define __TXQ0_ADD_VECTORS_P 0x80000000 -#define __TXQ0_STOP_P 0x40000000 -#define __TXQ0_PRD_PTR_P 0x0000ffff -#define HQM_QSET1_TXQ_DRBL_P0 0x000380a0 -#define __TXQ1_ADD_VECTORS_P 0x80000000 -#define __TXQ1_STOP_P 0x40000000 -#define __TXQ1_PRD_PTR_P 0x0000ffff -#define HQM_QSET0_TXQ_DRBL_P1 0x0003c020 -#define HQM_QSET1_TXQ_DRBL_P1 0x0003c0a0 -#define HQM_QSET0_IB_DRBL_1_P0 0x00038040 -#define __IB1_0_ACK_P 0x80000000 -#define __IB1_0_DISABLE_P 0x40000000 -#define __IB1_0_COALESCING_CFG_P_MK 0x00ff0000 -#define __IB1_0_COALESCING_CFG_P_SH 16 -#define __IB1_0_COALESCING_CFG_P (_v) ((_v) << __IB1_0_COALESCING_CFG_P_SH) -#define __IB1_0_NUM_OF_ACKED_EVENTS_P 0x0000ffff -#define HQM_QSET1_IB_DRBL_1_P0 0x000380c0 -#define __IB1_1_ACK_P 0x80000000 -#define __IB1_1_DISABLE_P 0x40000000 -#define __IB1_1_COALESCING_CFG_P_MK 0x00ff0000 -#define __IB1_1_COALESCING_CFG_P_SH 16 -#define __IB1_1_COALESCING_CFG_P (_v) ((_v) << __IB1_1_COALESCING_CFG_P_SH) -#define __IB1_1_NUM_OF_ACKED_EVENTS_P 0x0000ffff -#define HQM_QSET0_IB_DRBL_1_P1 0x0003c040 -#define HQM_QSET1_IB_DRBL_1_P1 0x0003c0c0 -#define HQM_QSET0_IB_DRBL_2_P0 0x00038060 -#define __IB2_0_ACK_P 0x80000000 -#define __IB2_0_DISABLE_P 0x40000000 -#define __IB2_0_COALESCING_CFG_P_MK 0x00ff0000 -#define __IB2_0_COALESCING_CFG_P_SH 16 -#define __IB2_0_COALESCING_CFG_P (_v) ((_v) << __IB2_0_COALESCING_CFG_P_SH) -#define __IB2_0_NUM_OF_ACKED_EVENTS_P 0x0000ffff -#define HQM_QSET1_IB_DRBL_2_P0 0x000380e0 -#define __IB2_1_ACK_P 0x80000000 -#define __IB2_1_DISABLE_P 0x40000000 -#define __IB2_1_COALESCING_CFG_P_MK 0x00ff0000 -#define __IB2_1_COALESCING_CFG_P_SH 16 -#define __IB2_1_COALESCING_CFG_P (_v) ((_v) << __IB2_1_COALESCING_CFG_P_SH) -#define __IB2_1_NUM_OF_ACKED_EVENTS_P 0x0000ffff -#define HQM_QSET0_IB_DRBL_2_P1 0x0003c060 -#define HQM_QSET1_IB_DRBL_2_P1 0x0003c0e0 - -/* -* These definitions are either in error/missing in spec. Its auto-generated -* from hard coded values in regparse.pl. -*/ -#define __EMPHPOST_AT_4G_MK_FIX 0x0000001c -#define __EMPHPOST_AT_4G_SH_FIX 0x00000002 -#define __EMPHPRE_AT_4G_FIX 0x00000003 -#define __SFP_TXRATE_EN_FIX 0x00000100 -#define __SFP_RXRATE_EN_FIX 0x00000080 - -/* -* These register definitions are auto-generated from hard coded values -* in regparse.pl. -*/ - -/* -* These register mapping definitions are auto-generated from mapping tables -* in regparse.pl. -*/ -#define BFA_IOC0_HBEAT_REG HOST_SEM0_INFO_REG -#define BFA_IOC0_STATE_REG HOST_SEM1_INFO_REG -#define BFA_IOC1_HBEAT_REG HOST_SEM2_INFO_REG -#define BFA_IOC1_STATE_REG HOST_SEM3_INFO_REG -#define BFA_FW_USE_COUNT HOST_SEM4_INFO_REG -#define BFA_IOC_FAIL_SYNC HOST_SEM5_INFO_REG - -#define CPE_DEPTH_Q (__n) \ - (CPE_DEPTH_Q0 + (__n) * (CPE_DEPTH_Q1 - CPE_DEPTH_Q0)) -#define CPE_QCTRL_Q (__n) \ - (CPE_QCTRL_Q0 + (__n) * (CPE_QCTRL_Q1 - CPE_QCTRL_Q0)) -#define CPE_PI_PTR_Q (__n) \ - (CPE_PI_PTR_Q0 + (__n) * (CPE_PI_PTR_Q1 - CPE_PI_PTR_Q0)) -#define CPE_CI_PTR_Q (__n) \ - (CPE_CI_PTR_Q0 + (__n) * (CPE_CI_PTR_Q1 - CPE_CI_PTR_Q0)) -#define RME_DEPTH_Q (__n) \ - (RME_DEPTH_Q0 + (__n) * (RME_DEPTH_Q1 - RME_DEPTH_Q0)) -#define RME_QCTRL_Q (__n) \ - (RME_QCTRL_Q0 + (__n) * (RME_QCTRL_Q1 - RME_QCTRL_Q0)) -#define RME_PI_PTR_Q (__n) \ - (RME_PI_PTR_Q0 + (__n) * (RME_PI_PTR_Q1 - RME_PI_PTR_Q0)) -#define RME_CI_PTR_Q (__n) \ - (RME_CI_PTR_Q0 + (__n) * (RME_CI_PTR_Q1 - RME_CI_PTR_Q0)) -#define HQM_QSET_RXQ_DRBL_P0 (__n) \ - (HQM_QSET0_RXQ_DRBL_P0 + (__n) * \ - (HQM_QSET1_RXQ_DRBL_P0 - HQM_QSET0_RXQ_DRBL_P0)) -#define HQM_QSET_TXQ_DRBL_P0 (__n) \ - (HQM_QSET0_TXQ_DRBL_P0 + (__n) * \ - (HQM_QSET1_TXQ_DRBL_P0 - HQM_QSET0_TXQ_DRBL_P0)) -#define HQM_QSET_IB_DRBL_1_P0 (__n) \ - (HQM_QSET0_IB_DRBL_1_P0 + (__n) * \ - (HQM_QSET1_IB_DRBL_1_P0 - HQM_QSET0_IB_DRBL_1_P0)) -#define HQM_QSET_IB_DRBL_2_P0 (__n) \ - (HQM_QSET0_IB_DRBL_2_P0 + (__n) * \ - (HQM_QSET1_IB_DRBL_2_P0 - HQM_QSET0_IB_DRBL_2_P0)) -#define HQM_QSET_RXQ_DRBL_P1 (__n) \ - (HQM_QSET0_RXQ_DRBL_P1 + (__n) * \ - (HQM_QSET1_RXQ_DRBL_P1 - HQM_QSET0_RXQ_DRBL_P1)) -#define HQM_QSET_TXQ_DRBL_P1 (__n) \ - (HQM_QSET0_TXQ_DRBL_P1 + (__n) * \ - (HQM_QSET1_TXQ_DRBL_P1 - HQM_QSET0_TXQ_DRBL_P1)) -#define HQM_QSET_IB_DRBL_1_P1 (__n) \ - (HQM_QSET0_IB_DRBL_1_P1 + (__n) * \ - (HQM_QSET1_IB_DRBL_1_P1 - HQM_QSET0_IB_DRBL_1_P1)) -#define HQM_QSET_IB_DRBL_2_P1 (__n) \ - (HQM_QSET0_IB_DRBL_2_P1 + (__n) * \ - (HQM_QSET1_IB_DRBL_2_P1 - HQM_QSET0_IB_DRBL_2_P1)) - -#define CPE_Q_NUM (__fn, __q) (((__fn) << 2) + (__q)) -#define RME_Q_NUM (__fn, __q) (((__fn) << 2) + (__q)) -#define CPE_Q_MASK (__q) ((__q) & 0x3) -#define RME_Q_MASK (__q) ((__q) & 0x3) - -/* -* PCI MSI-X vector defines -*/ -enum { -BFA_MSIX_CPE_Q0 =0 , -BFA_MSIX_CPE_Q1 =1 , -BFA_MSIX_CPE_Q2 =2 , -BFA_MSIX_CPE_Q3 =3 , -BFA_MSIX_RME_Q0 =4 , -BFA_MSIX_RME_Q1 =5 , -BFA_MSIX_RME_Q2 =6 , -BFA_MSIX_RME_Q3 =7 , -BFA_MSIX_LPU_ERR =8 , -BFA_MSIX_CT_MAX =9 , -}; - -/* -* And corresponding host interrupt status bit field defines -*/ -#define __HFN_INT_CPE_Q0 0x00000001U -#define __HFN_INT_CPE_Q1 0x00000002U -#define __HFN_INT_CPE_Q2 0x00000004U -#define __HFN_INT_CPE_Q3 0x00000008U -#define __HFN_INT_CPE_Q4 0x00000010U -#define __HFN_INT_CPE_Q5 0x00000020U -#define __HFN_INT_CPE_Q6 0x00000040U -#define __HFN_INT_CPE_Q7 0x00000080U -#define __HFN_INT_RME_Q0 0x00000100U -#define __HFN_INT_RME_Q1 0x00000200U -#define __HFN_INT_RME_Q2 0x00000400U -#define __HFN_INT_RME_Q3 0x00000800U -#define __HFN_INT_RME_Q4 0x00001000U -#define __HFN_INT_RME_Q5 0x00002000U -#define __HFN_INT_RME_Q6 0x00004000U -#define __HFN_INT_RME_Q7 0x00008000U -#define __HFN_INT_ERR_EMC 0x00010000U -#define __HFN_INT_ERR_LPU0 0x00020000U -#define __HFN_INT_ERR_LPU1 0x00040000U -#define __HFN_INT_ERR_PSS 0x00080000U -#define __HFN_INT_MBOX_LPU0 0x00100000U -#define __HFN_INT_MBOX_LPU1 0x00200000U -#define __HFN_INT_MBOX1_LPU0 0x00400000U -#define __HFN_INT_MBOX1_LPU1 0x00800000U -#define __HFN_INT_LL_HALT 0x01000000U -#define __HFN_INT_CPE_MASK 0x000000ffU -#define __HFN_INT_RME_MASK 0x0000ff00U - -/* -* catapult memory map. -*/ -#define LL_PGN_HQM0 0x0096 -#define LL_PGN_HQM1 0x0097 -#define PSS_SMEM_PAGE_START 0x8000 -#define PSS_SMEM_PGNUM (_pg0, _ma) ((_pg0) + ((_ma) >> 15)) -#define PSS_SMEM_PGOFF (_ma) ((_ma) & 0x7fff) - -/* -* End of catapult memory map -*/ - -#endif /* __BFI_CTREG_H__ */
drivers/net/bna/bfi_ll.h deleted +0 -425
425 lines not on this page · raw message
drivers/net/bna/bna_ctrl.c deleted +0 -3079
1,929 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
1.7.1
Part of the diff is not shown here. View the raw message.
David Miller
maintainerThis is too many patche at once.
You need to submit patches more often, and in significantly smaller sets at a time.
I'm not going to look at these patches at all.
Quoted 7 lines
From: David Miller [mailto:[email protected]]
Sent: Monday, July 18, 2011 1:27 AMThis is too many patche at once.
You need to submit patches more often, and in significantly smaller sets at a time.
David,
This update to the BNA driver (release 3.0) is enabling new hardware with various virtualization and other capabilities e.g. new 1860 SRIOV capable Fabric Adapter (new ASIC), vNIC (PF based virtualization), architectural framework for SR-IOV, Multi-Tx priority queue support and iSCSI over DCB.
The driver had to go through significant changes to enable these capabilities thus resulting in large delta.
We explored options to submit smaller incremental patches in last few months but quickly ran into following issues ...
- The driver was not functional between patches because of large developmental changes
- There were iterative changes to many areas of code and that was resulting in many unnecessary patches.
We wanted to avoid submitting developing code that could break upstream driver due to partial changes. Hence we ended up submitting this driver update patch with consolidated changes after elaborate QA testing.
We understand that it is still big and can think of following options to address the concern:
1. Break this submission into 3 batches and split it into: 2.3 fixes, new features (which is still a big patch set - due to all the code reorganization), and bug fixes and cleanup. OR
2. Submit patches as a new driver and would need your support in replacing the existing upstream BNA driver with this one.
Please suggest on the next steps.
Thanks,
Rasesh
David Miller
maintainerFrom: Rasesh Mody <[email protected]>
Date: Mon, 18 Jul 2011 17:48:03 -0700
Quoted 2 lines
We wanted to avoid submitting developing code that could break upstream driver due to partial changes.
So what you're saying is that if only some of the patches are applied the driver will not work properly?
That's not allowed either, your set of changes must be fully bisectable meaning that at any point in the series the driver must still compile and work properly.
You guys need to sort out how you guys submit your changes.
When you have 4 patches ready to go, post them immediately.
Because if there are fundamental problem with the first 4, everything else that depends upon them will need to change.
Quoted 16 lines
From: David Miller [mailto:[email protected]]
Sent: Monday, July 18, 2011 6:58 PMFrom: Rasesh Mody <[email protected]>
Date: Mon, 18 Jul 2011 17:48:03 -0700Quoted 2 lines
We wanted to avoid submitting developing code that could break upstream driver due to partial changes.
So what you're saying is that if only some of the patches are applied the driver will not work properly?
That's not allowed either, your set of changes must be fully bisectable meaning that at any point in the series the driver must still compile and work properly.
Quoted 6 lines
You guys need to sort out how you guys submit your changes.
When you have 4 patches ready to go, post them immediately.
Because if there are fundamental problem with the first 4, everything else that depends upon them will need to change.
David,
We can further split the submission into multiple smaller submissions (e.g. 4 patches a time as you suggested), but there still will be one big patch set for new hardware and feature enablement, which cannot be split it into small bisectable patches. Is this acceptable? What is the upstream guideline for submitting big changes such as driver re-architecture or re-organization?
Thanks,
--Rasesh
David Miller
maintainerFrom: Rasesh Mody <[email protected]>
Date: Tue, 19 Jul 2011 15:53:06 -0700
Quoted 4 lines
We can further split the submission into multiple smaller submissions (e.g. 4 patches a time as you suggested), but there still will be one big patch set for new hardware and feature enablement
That's fine, just don't add the patch that causes the driver to recognize the new device IDs until all the necessary support code is there.