Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b7ee31c5 authored by Rasesh Mody's avatar Rasesh Mody Committed by David S. Miller
Browse files

bna: scope and dead code cleanup



As suggested by Stephen Hemminger:
1) Made functions and data structures static wherever possible.
2) Removed unused code.

Signed-off-by: default avatarDebashis Dutt <ddutt@brocade.com>
Signed-off-by: default avatarRasesh Mody <rmody@brocade.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e2fa6f2e
Loading
Loading
Loading
Loading
+1 −7
Original line number Original line Diff line number Diff line
@@ -65,7 +65,7 @@
			(!list_empty(&((__ioc)->mbox_mod.cmd_q)) || \
			(!list_empty(&((__ioc)->mbox_mod.cmd_q)) || \
			readl((__ioc)->ioc_regs.hfn_mbox_cmd))
			readl((__ioc)->ioc_regs.hfn_mbox_cmd))


bool bfa_nw_auto_recover = true;
static bool bfa_nw_auto_recover = true;


/*
/*
 * forward declarations
 * forward declarations
@@ -1276,12 +1276,6 @@ bfa_nw_ioc_auto_recover(bool auto_recover)
	bfa_nw_auto_recover = auto_recover;
	bfa_nw_auto_recover = auto_recover;
}
}


bool
bfa_nw_ioc_is_operational(struct bfa_ioc *ioc)
{
	return bfa_fsm_cmp_state(ioc, bfa_ioc_sm_op);
}

static void
static void
bfa_ioc_msgget(struct bfa_ioc *ioc, void *mbmsg)
bfa_ioc_msgget(struct bfa_ioc *ioc, void *mbmsg)
{
{
+0 −1
Original line number Original line Diff line number Diff line
@@ -271,7 +271,6 @@ void bfa_nw_ioc_enable(struct bfa_ioc *ioc);
void bfa_nw_ioc_disable(struct bfa_ioc *ioc);
void bfa_nw_ioc_disable(struct bfa_ioc *ioc);


void bfa_nw_ioc_error_isr(struct bfa_ioc *ioc);
void bfa_nw_ioc_error_isr(struct bfa_ioc *ioc);
bool bfa_nw_ioc_is_operational(struct bfa_ioc *ioc);


void bfa_nw_ioc_get_attr(struct bfa_ioc *ioc, struct bfa_ioc_attr *ioc_attr);
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,
void bfa_nw_ioc_hbfail_register(struct bfa_ioc *ioc,
+1 −1
Original line number Original line Diff line number Diff line
@@ -34,7 +34,7 @@ static void bfa_ioc_ct_notify_hbfail(struct bfa_ioc *ioc);
static void bfa_ioc_ct_ownership_reset(struct bfa_ioc *ioc);
static void bfa_ioc_ct_ownership_reset(struct bfa_ioc *ioc);
static enum bfa_status bfa_ioc_ct_pll_init(void __iomem *rb, bool fcmode);
static enum bfa_status bfa_ioc_ct_pll_init(void __iomem *rb, bool fcmode);


struct bfa_ioc_hwif nw_hwif_ct;
static struct bfa_ioc_hwif nw_hwif_ct;


/**
/**
 * Called from bfa_ioc_attach() to map asic specific calls.
 * Called from bfa_ioc_attach() to map asic specific calls.
+1 −1
Original line number Original line Diff line number Diff line
@@ -77,7 +77,7 @@ typedef void (*bfa_fsm_t)(void *fsm, int event);
	((_fsm)->fsm == (bfa_fsm_t)(_state))
	((_fsm)->fsm == (bfa_fsm_t)(_state))


static inline int
static inline int
bfa_sm_to_state(struct bfa_sm_table *smt, bfa_sm_t sm)
bfa_sm_to_state(const struct bfa_sm_table *smt, bfa_sm_t sm)
{
{
	int	i = 0;
	int	i = 0;


+2 −106
Original line number Original line Diff line number Diff line
@@ -19,8 +19,7 @@
#include "bfi_ll.h"
#include "bfi_ll.h"
#include "bna_types.h"
#include "bna_types.h"


extern u32 bna_dim_vector[][BNA_BIAS_T_MAX];
extern const u32 bna_napi_dim_vector[][BNA_BIAS_T_MAX];
extern u32 bna_napi_dim_vector[][BNA_BIAS_T_MAX];


/**
/**
 *
 *
@@ -344,9 +343,6 @@ do { \
 * BNA
 * BNA
 */
 */


/* Internal APIs */
void bna_adv_res_req(struct bna_res_info *res_info);

/* APIs for BNAD */
/* APIs for BNAD */
void bna_res_req(struct bna_res_info *res_info);
void bna_res_req(struct bna_res_info *res_info);
void bna_init(struct bna *bna, struct bnad *bnad,
void bna_init(struct bna *bna, struct bnad *bnad,
@@ -354,7 +350,6 @@ void bna_init(struct bna *bna, struct bnad *bnad,
			struct bna_res_info *res_info);
			struct bna_res_info *res_info);
void bna_uninit(struct bna *bna);
void bna_uninit(struct bna *bna);
void bna_stats_get(struct bna *bna);
void bna_stats_get(struct bna *bna);
void bna_stats_clr(struct bna *bna);
void bna_get_perm_mac(struct bna *bna, u8 *mac);
void bna_get_perm_mac(struct bna *bna, u8 *mac);


/* APIs for Rx */
/* APIs for Rx */
@@ -376,18 +371,6 @@ void bna_rit_mod_seg_put(struct bna_rit_mod *rit_mod,
 * DEVICE
 * DEVICE
 */
 */


/* Interanl APIs */
void bna_adv_device_init(struct bna_device *device, struct bna *bna,
			struct bna_res_info *res_info);

/* APIs for BNA */
void bna_device_init(struct bna_device *device, struct bna *bna,
		     struct bna_res_info *res_info);
void bna_device_uninit(struct bna_device *device);
void bna_device_cb_port_stopped(void *arg, enum bna_cb_status status);
int bna_device_status_get(struct bna_device *device);
int bna_device_state_get(struct bna_device *device);

/* APIs for BNAD */
/* APIs for BNAD */
void bna_device_enable(struct bna_device *device);
void bna_device_enable(struct bna_device *device);
void bna_device_disable(struct bna_device *device,
void bna_device_disable(struct bna_device *device,
@@ -397,12 +380,6 @@ void bna_device_disable(struct bna_device *device,
 * MBOX
 * MBOX
 */
 */


/* APIs for DEVICE */
void bna_mbox_mod_init(struct bna_mbox_mod *mbox_mod, struct bna *bna);
void bna_mbox_mod_uninit(struct bna_mbox_mod *mbox_mod);
void bna_mbox_mod_start(struct bna_mbox_mod *mbox_mod);
void bna_mbox_mod_stop(struct bna_mbox_mod *mbox_mod);

/* APIs for PORT, TX, RX */
/* APIs for PORT, TX, RX */
void bna_mbox_handler(struct bna *bna, u32 intr_status);
void bna_mbox_handler(struct bna *bna, u32 intr_status);
void bna_mbox_send(struct bna *bna, struct bna_mbox_qe *mbox_qe);
void bna_mbox_send(struct bna *bna, struct bna_mbox_qe *mbox_qe);
@@ -411,17 +388,6 @@ void bna_mbox_send(struct bna *bna, struct bna_mbox_qe *mbox_qe);
 * PORT
 * PORT
 */
 */


/* APIs for BNA */
void bna_port_init(struct bna_port *port, struct bna *bna);
void bna_port_uninit(struct bna_port *port);
int bna_port_state_get(struct bna_port *port);
int bna_llport_state_get(struct bna_llport *llport);

/* APIs for DEVICE */
void bna_port_start(struct bna_port *port);
void bna_port_stop(struct bna_port *port);
void bna_port_fail(struct bna_port *port);

/* API for RX */
/* API for RX */
int bna_port_mtu_get(struct bna_port *port);
int bna_port_mtu_get(struct bna_port *port);
void bna_llport_admin_up(struct bna_llport *llport);
void bna_llport_admin_up(struct bna_llport *llport);
@@ -437,12 +403,6 @@ void bna_port_pause_config(struct bna_port *port,
void bna_port_mtu_set(struct bna_port *port, int mtu,
void bna_port_mtu_set(struct bna_port *port, int mtu,
		      void (*cbfn)(struct bnad *, enum bna_cb_status));
		      void (*cbfn)(struct bnad *, enum bna_cb_status));
void bna_port_mac_get(struct bna_port *port, mac_t *mac);
void bna_port_mac_get(struct bna_port *port, mac_t *mac);
void bna_port_type_set(struct bna_port *port, enum bna_port_type type);
void bna_port_linkcbfn_set(struct bna_port *port,
			   void (*linkcbfn)(struct bnad *,
					    enum bna_link_status));
void bna_port_admin_up(struct bna_port *port);
void bna_port_admin_down(struct bna_port *port);


/* Callbacks for TX, RX */
/* Callbacks for TX, RX */
void bna_port_cb_tx_stopped(struct bna_port *port,
void bna_port_cb_tx_stopped(struct bna_port *port,
@@ -450,11 +410,6 @@ void bna_port_cb_tx_stopped(struct bna_port *port,
void bna_port_cb_rx_stopped(struct bna_port *port,
void bna_port_cb_rx_stopped(struct bna_port *port,
			    enum bna_cb_status status);
			    enum bna_cb_status status);


/* Callbacks for MBOX */
void bna_port_cb_link_up(struct bna_port *port, struct bfi_ll_aen *aen,
			 int status);
void bna_port_cb_link_down(struct bna_port *port, int status);

/**
/**
 * IB
 * IB
 */
 */
@@ -464,25 +419,10 @@ void bna_ib_mod_init(struct bna_ib_mod *ib_mod, struct bna *bna,
		     struct bna_res_info *res_info);
		     struct bna_res_info *res_info);
void bna_ib_mod_uninit(struct bna_ib_mod *ib_mod);
void bna_ib_mod_uninit(struct bna_ib_mod *ib_mod);


/* APIs for TX, RX */
struct bna_ib *bna_ib_get(struct bna_ib_mod *ib_mod,
			    enum bna_intr_type intr_type, int vector);
void bna_ib_put(struct bna_ib_mod *ib_mod, struct bna_ib *ib);
int bna_ib_reserve_idx(struct bna_ib *ib);
void bna_ib_release_idx(struct bna_ib *ib, int idx);
int bna_ib_config(struct bna_ib *ib, struct bna_ib_config *ib_config);
void bna_ib_start(struct bna_ib *ib);
void bna_ib_stop(struct bna_ib *ib);
void bna_ib_fail(struct bna_ib *ib);
void bna_ib_coalescing_timeo_set(struct bna_ib *ib, u8 coalescing_timeo);

/**
/**
 * TX MODULE AND TX
 * TX MODULE AND TX
 */
 */


/* Internal APIs */
void bna_tx_prio_changed(struct bna_tx *tx, int prio);

/* APIs for BNA */
/* APIs for BNA */
void bna_tx_mod_init(struct bna_tx_mod *tx_mod, struct bna *bna,
void bna_tx_mod_init(struct bna_tx_mod *tx_mod, struct bna *bna,
		     struct bna_res_info *res_info);
		     struct bna_res_info *res_info);
@@ -508,10 +448,6 @@ void bna_tx_enable(struct bna_tx *tx);
void bna_tx_disable(struct bna_tx *tx, enum bna_cleanup_type type,
void bna_tx_disable(struct bna_tx *tx, enum bna_cleanup_type type,
		    void (*cbfn)(void *, struct bna_tx *,
		    void (*cbfn)(void *, struct bna_tx *,
				 enum bna_cb_status));
				 enum bna_cb_status));
enum bna_cb_status
bna_tx_prio_set(struct bna_tx *tx, int prio,
		void (*cbfn)(struct bnad *, struct bna_tx *,
			     enum bna_cb_status));
void bna_tx_coalescing_timeo_set(struct bna_tx *tx, int coalescing_timeo);
void bna_tx_coalescing_timeo_set(struct bna_tx *tx, int coalescing_timeo);


/**
/**
@@ -564,35 +500,20 @@ void bna_rx_disable(struct bna_rx *rx, enum bna_cleanup_type type,
		    void (*cbfn)(void *, struct bna_rx *,
		    void (*cbfn)(void *, struct bna_rx *,
				 enum bna_cb_status));
				 enum bna_cb_status));
void bna_rx_coalescing_timeo_set(struct bna_rx *rx, int coalescing_timeo);
void bna_rx_coalescing_timeo_set(struct bna_rx *rx, int coalescing_timeo);
void bna_rx_dim_reconfig(struct bna *bna, u32 vector[][BNA_BIAS_T_MAX]);
void bna_rx_dim_reconfig(struct bna *bna, const u32 vector[][BNA_BIAS_T_MAX]);
void bna_rx_dim_update(struct bna_ccb *ccb);
void bna_rx_dim_update(struct bna_ccb *ccb);
enum bna_cb_status
enum bna_cb_status
bna_rx_ucast_set(struct bna_rx *rx, u8 *ucmac,
bna_rx_ucast_set(struct bna_rx *rx, u8 *ucmac,
		 void (*cbfn)(struct bnad *, struct bna_rx *,
		 void (*cbfn)(struct bnad *, struct bna_rx *,
			      enum bna_cb_status));
			      enum bna_cb_status));
enum bna_cb_status
enum bna_cb_status
bna_rx_ucast_add(struct bna_rx *rx, u8* ucmac,
		 void (*cbfn)(struct bnad *, struct bna_rx *,
			      enum bna_cb_status));
enum bna_cb_status
bna_rx_ucast_del(struct bna_rx *rx, u8 *ucmac,
		 void (*cbfn)(struct bnad *, struct bna_rx *,
			      enum bna_cb_status));
enum bna_cb_status
bna_rx_mcast_add(struct bna_rx *rx, u8 *mcmac,
bna_rx_mcast_add(struct bna_rx *rx, u8 *mcmac,
		 void (*cbfn)(struct bnad *, struct bna_rx *,
		 void (*cbfn)(struct bnad *, struct bna_rx *,
			      enum bna_cb_status));
			      enum bna_cb_status));
enum bna_cb_status
enum bna_cb_status
bna_rx_mcast_del(struct bna_rx *rx, u8 *mcmac,
		 void (*cbfn)(struct bnad *, struct bna_rx *,
			      enum bna_cb_status));
enum bna_cb_status
bna_rx_mcast_listset(struct bna_rx *rx, int count, u8 *mcmac,
bna_rx_mcast_listset(struct bna_rx *rx, int count, u8 *mcmac,
		     void (*cbfn)(struct bnad *, struct bna_rx *,
		     void (*cbfn)(struct bnad *, struct bna_rx *,
				  enum bna_cb_status));
				  enum bna_cb_status));
void bna_rx_mcast_delall(struct bna_rx *rx,
			 void (*cbfn)(struct bnad *, struct bna_rx *,
				      enum bna_cb_status));
enum bna_cb_status
enum bna_cb_status
bna_rx_mode_set(struct bna_rx *rx, enum bna_rxmode rxmode,
bna_rx_mode_set(struct bna_rx *rx, enum bna_rxmode rxmode,
		enum bna_rxmode bitmask,
		enum bna_rxmode bitmask,
@@ -601,36 +522,12 @@ bna_rx_mode_set(struct bna_rx *rx, enum bna_rxmode rxmode,
void bna_rx_vlan_add(struct bna_rx *rx, int vlan_id);
void bna_rx_vlan_add(struct bna_rx *rx, int vlan_id);
void bna_rx_vlan_del(struct bna_rx *rx, int vlan_id);
void bna_rx_vlan_del(struct bna_rx *rx, int vlan_id);
void bna_rx_vlanfilter_enable(struct bna_rx *rx);
void bna_rx_vlanfilter_enable(struct bna_rx *rx);
void bna_rx_vlanfilter_disable(struct bna_rx *rx);
void bna_rx_rss_enable(struct bna_rx *rx);
void bna_rx_rss_disable(struct bna_rx *rx);
void bna_rx_rss_reconfig(struct bna_rx *rx, struct bna_rxf_rss *rss_config);
void bna_rx_rss_rit_set(struct bna_rx *rx, unsigned int *vectors,
			int nvectors);
void bna_rx_hds_enable(struct bna_rx *rx, struct bna_rxf_hds *hds_config,
void bna_rx_hds_enable(struct bna_rx *rx, struct bna_rxf_hds *hds_config,
		       void (*cbfn)(struct bnad *, struct bna_rx *,
		       void (*cbfn)(struct bnad *, struct bna_rx *,
				    enum bna_cb_status));
				    enum bna_cb_status));
void bna_rx_hds_disable(struct bna_rx *rx,
void bna_rx_hds_disable(struct bna_rx *rx,
			void (*cbfn)(struct bnad *, struct bna_rx *,
			void (*cbfn)(struct bnad *, struct bna_rx *,
				     enum bna_cb_status));
				     enum bna_cb_status));
void bna_rx_receive_pause(struct bna_rx *rx,
			  void (*cbfn)(struct bnad *, struct bna_rx *,
				       enum bna_cb_status));
void bna_rx_receive_resume(struct bna_rx *rx,
			   void (*cbfn)(struct bnad *, struct bna_rx *,
					enum bna_cb_status));

/* RxF APIs for RX */
void bna_rxf_start(struct bna_rxf *rxf);
void bna_rxf_stop(struct bna_rxf *rxf);
void bna_rxf_fail(struct bna_rxf *rxf);
void bna_rxf_init(struct bna_rxf *rxf, struct bna_rx *rx,
		  struct bna_rx_config *q_config);
void bna_rxf_uninit(struct bna_rxf *rxf);

/* Callback from RXF to RX */
void bna_rx_cb_rxf_stopped(struct bna_rx *rx, enum bna_cb_status);
void bna_rx_cb_rxf_started(struct bna_rx *rx, enum bna_cb_status);


/**
/**
 * BNAD
 * BNAD
@@ -639,7 +536,6 @@ void bna_rx_cb_rxf_started(struct bna_rx *rx, enum bna_cb_status);
/* Callbacks for BNA */
/* Callbacks for BNA */
void bnad_cb_stats_get(struct bnad *bnad, enum bna_cb_status status,
void bnad_cb_stats_get(struct bnad *bnad, enum bna_cb_status status,
		       struct bna_stats *stats);
		       struct bna_stats *stats);
void bnad_cb_stats_clr(struct bnad *bnad);


/* Callbacks for DEVICE */
/* Callbacks for DEVICE */
void bnad_cb_device_enabled(struct bnad *bnad, enum bna_cb_status status);
void bnad_cb_device_enabled(struct bnad *bnad, enum bna_cb_status status);
Loading