bnad.h (251f39fe42dae863bd24e30864e6b66076ba076d) | bnad.h (e1e0918fcaea7b8100ed9f96f3ecd9eb9b867102) |
---|---|
1/* 2 * Linux network driver for Brocade Converged Network Adapter. 3 * 4 * This program is free software; you can redistribute it and/or modify it 5 * under the terms of the GNU General Public License (GPL) Version 2 as 6 * published by the Free Software Foundation 7 * 8 * This program is distributed in the hope that it will be useful, but --- 110 unchanged lines hidden (view full) --- 119 BNAD_INTR_RX = 2 120}; 121 122enum bnad_link_state { 123 BNAD_LS_DOWN = 0, 124 BNAD_LS_UP = 1 125}; 126 | 1/* 2 * Linux network driver for Brocade Converged Network Adapter. 3 * 4 * This program is free software; you can redistribute it and/or modify it 5 * under the terms of the GNU General Public License (GPL) Version 2 as 6 * published by the Free Software Foundation 7 * 8 * This program is distributed in the hope that it will be useful, but --- 110 unchanged lines hidden (view full) --- 119 BNAD_INTR_RX = 2 120}; 121 122enum bnad_link_state { 123 BNAD_LS_DOWN = 0, 124 BNAD_LS_UP = 1 125}; 126 |
127struct bnad_iocmd_comp { 128 struct bnad *bnad; 129 struct completion comp; 130 int comp_status; 131}; 132 |
|
127struct bnad_completion { 128 struct completion ioc_comp; 129 struct completion ucast_comp; 130 struct completion mcast_comp; 131 struct completion tx_comp; 132 struct completion rx_comp; 133 struct completion stats_comp; 134 struct completion enet_comp; --- 111 unchanged lines hidden (view full) --- 246 247 248/* Define for Fast Path flags */ 249/* Defined as bit positions */ 250#define BNAD_FP_IN_RX_PATH 0 251 252struct bnad { 253 struct net_device *netdev; | 133struct bnad_completion { 134 struct completion ioc_comp; 135 struct completion ucast_comp; 136 struct completion mcast_comp; 137 struct completion tx_comp; 138 struct completion rx_comp; 139 struct completion stats_comp; 140 struct completion enet_comp; --- 111 unchanged lines hidden (view full) --- 252 253 254/* Define for Fast Path flags */ 255/* Defined as bit positions */ 256#define BNAD_FP_IN_RX_PATH 0 257 258struct bnad { 259 struct net_device *netdev; |
260 u32 id; 261 struct list_head list_entry; |
|
254 255 /* Data path */ 256 struct bnad_tx_info tx_info[BNAD_MAX_TX]; 257 struct bnad_rx_info rx_info[BNAD_MAX_RX]; 258 259 unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)]; 260 /* 261 * These q numbers are global only because --- 53 unchanged lines hidden (view full) --- 315 /* Statistics */ 316 struct bnad_stats stats; 317 318 struct bnad_diag *diag; 319 320 char adapter_name[BNAD_NAME_LEN]; 321 char port_name[BNAD_NAME_LEN]; 322 char mbox_irq_name[BNAD_NAME_LEN]; | 262 263 /* Data path */ 264 struct bnad_tx_info tx_info[BNAD_MAX_TX]; 265 struct bnad_rx_info rx_info[BNAD_MAX_RX]; 266 267 unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)]; 268 /* 269 * These q numbers are global only because --- 53 unchanged lines hidden (view full) --- 323 /* Statistics */ 324 struct bnad_stats stats; 325 326 struct bnad_diag *diag; 327 328 char adapter_name[BNAD_NAME_LEN]; 329 char port_name[BNAD_NAME_LEN]; 330 char mbox_irq_name[BNAD_NAME_LEN]; |
331 332 /* debugfs specific data */ 333 char *regdata; 334 u32 reglen; 335 struct dentry *bnad_dentry_files[5]; 336 struct dentry *port_debugfs_root; |
|
323}; 324 | 337}; 338 |
339struct bnad_drvinfo { 340 struct bfa_ioc_attr ioc_attr; 341 struct bfa_cee_attr cee_attr; 342 struct bfa_flash_attr flash_attr; 343 u32 cee_status; 344 u32 flash_status; 345}; 346 |
|
325/* 326 * EXTERN VARIABLES 327 */ | 347/* 348 * EXTERN VARIABLES 349 */ |
328extern struct firmware *bfi_fw; | 350extern const struct firmware *bfi_fw; |
329extern u32 bnad_rxqs_per_cq; 330 331/* 332 * EXTERN PROTOTYPES 333 */ 334extern u32 *cna_get_firmware_buf(struct pci_dev *pdev); 335/* Netdev entry point prototypes */ 336extern void bnad_set_rx_mode(struct net_device *netdev); 337extern struct net_device_stats *bnad_get_netdev_stats( 338 struct net_device *netdev); 339extern int bnad_mac_addr_set_locked(struct bnad *bnad, u8 *mac_addr); 340extern int bnad_enable_default_bcast(struct bnad *bnad); 341extern void bnad_restore_vlans(struct bnad *bnad, u32 rx_id); 342extern void bnad_set_ethtool_ops(struct net_device *netdev); | 351extern u32 bnad_rxqs_per_cq; 352 353/* 354 * EXTERN PROTOTYPES 355 */ 356extern u32 *cna_get_firmware_buf(struct pci_dev *pdev); 357/* Netdev entry point prototypes */ 358extern void bnad_set_rx_mode(struct net_device *netdev); 359extern struct net_device_stats *bnad_get_netdev_stats( 360 struct net_device *netdev); 361extern int bnad_mac_addr_set_locked(struct bnad *bnad, u8 *mac_addr); 362extern int bnad_enable_default_bcast(struct bnad *bnad); 363extern void bnad_restore_vlans(struct bnad *bnad, u32 rx_id); 364extern void bnad_set_ethtool_ops(struct net_device *netdev); |
365extern void bnad_cb_completion(void *arg, enum bfa_status status); |
|
343 344/* Configuration & setup */ 345extern void bnad_tx_coalescing_timeo_set(struct bnad *bnad); 346extern void bnad_rx_coalescing_timeo_set(struct bnad *bnad); 347 348extern int bnad_setup_rx(struct bnad *bnad, u32 rx_id); 349extern int bnad_setup_tx(struct bnad *bnad, u32 tx_id); 350extern void bnad_cleanup_tx(struct bnad *bnad, u32 tx_id); 351extern void bnad_cleanup_rx(struct bnad *bnad, u32 rx_id); 352 353/* Timer start/stop protos */ 354extern void bnad_dim_timer_start(struct bnad *bnad); 355 356/* Statistics */ 357extern void bnad_netdev_qstats_fill(struct bnad *bnad, 358 struct rtnl_link_stats64 *stats); 359extern void bnad_netdev_hwstats_fill(struct bnad *bnad, 360 struct rtnl_link_stats64 *stats); 361 | 366 367/* Configuration & setup */ 368extern void bnad_tx_coalescing_timeo_set(struct bnad *bnad); 369extern void bnad_rx_coalescing_timeo_set(struct bnad *bnad); 370 371extern int bnad_setup_rx(struct bnad *bnad, u32 rx_id); 372extern int bnad_setup_tx(struct bnad *bnad, u32 tx_id); 373extern void bnad_cleanup_tx(struct bnad *bnad, u32 tx_id); 374extern void bnad_cleanup_rx(struct bnad *bnad, u32 rx_id); 375 376/* Timer start/stop protos */ 377extern void bnad_dim_timer_start(struct bnad *bnad); 378 379/* Statistics */ 380extern void bnad_netdev_qstats_fill(struct bnad *bnad, 381 struct rtnl_link_stats64 *stats); 382extern void bnad_netdev_hwstats_fill(struct bnad *bnad, 383 struct rtnl_link_stats64 *stats); 384 |
385/* Debugfs */ 386void bnad_debugfs_init(struct bnad *bnad); 387void bnad_debugfs_uninit(struct bnad *bnad); 388 |
|
362/** 363 * MACROS 364 */ 365/* To set & get the stats counters */ 366#define BNAD_UPDATE_CTR(_bnad, _ctr) \ 367 (((_bnad)->stats.drv_stats._ctr)++) 368 369#define BNAD_GET_CTR(_bnad, _ctr) ((_bnad)->stats.drv_stats._ctr) 370 371#define bnad_enable_rx_irq_unsafe(_ccb) \ 372{ \ 373 if (likely(test_bit(BNAD_RXQ_STARTED, &(_ccb)->rcb[0]->flags))) {\ 374 bna_ib_coalescing_timer_set((_ccb)->i_dbell, \ 375 (_ccb)->rx_coalescing_timeo); \ 376 bna_ib_ack((_ccb)->i_dbell, 0); \ 377 } \ 378} 379 380#endif /* __BNAD_H__ */ | 389/** 390 * MACROS 391 */ 392/* To set & get the stats counters */ 393#define BNAD_UPDATE_CTR(_bnad, _ctr) \ 394 (((_bnad)->stats.drv_stats._ctr)++) 395 396#define BNAD_GET_CTR(_bnad, _ctr) ((_bnad)->stats.drv_stats._ctr) 397 398#define bnad_enable_rx_irq_unsafe(_ccb) \ 399{ \ 400 if (likely(test_bit(BNAD_RXQ_STARTED, &(_ccb)->rcb[0]->flags))) {\ 401 bna_ib_coalescing_timer_set((_ccb)->i_dbell, \ 402 (_ccb)->rx_coalescing_timeo); \ 403 bna_ib_ack((_ccb)->i_dbell, 0); \ 404 } \ 405} 406 407#endif /* __BNAD_H__ */ |