27 PCI_ROM( 0x14e4, 0x16c0,
"14e4-16C0",
"14e4-16C0", 0 ),
29 PCI_ROM( 0x14e4, 0x16c8,
"14e4-16C8",
"14e4-16C8", 0 ),
30 PCI_ROM( 0x14e4, 0x16c9,
"14e4-16C9",
"14e4-16C9", 0 ),
31 PCI_ROM( 0x14e4, 0x16ca,
"14e4-16CA",
"14e4-16CA", 0 ),
32 PCI_ROM( 0x14e4, 0x16cc,
"14e4-16CC",
"14e4-16CC", 0 ),
33 PCI_ROM( 0x14e4, 0x16cd,
"14e4-16CD",
"14e4-16CD", 0 ),
34 PCI_ROM( 0x14e4, 0x16ce,
"14e4-16CE",
"14e4-16CE", 0 ),
35 PCI_ROM( 0x14e4, 0x16cf,
"14e4-16CF",
"14e4-16CF", 0 ),
36 PCI_ROM( 0x14e4, 0x16d0,
"14e4-16D0",
"14e4-16D0", 0 ),
37 PCI_ROM( 0x14e4, 0x16d1,
"14e4-16D1",
"14e4-16D1", 0 ),
38 PCI_ROM( 0x14e4, 0x16d2,
"14e4-16D2",
"14e4-16D2", 0 ),
39 PCI_ROM( 0x14e4, 0x16d4,
"14e4-16D4",
"14e4-16D4", 0 ),
40 PCI_ROM( 0x14e4, 0x16d5,
"14e4-16D5",
"14e4-16D5", 0 ),
41 PCI_ROM( 0x14e4, 0x16d6,
"14e4-16D6",
"14e4-16D6", 0 ),
42 PCI_ROM( 0x14e4, 0x16d7,
"14e4-16D7",
"14e4-16D7", 0 ),
43 PCI_ROM( 0x14e4, 0x16d8,
"14e4-16D8",
"14e4-16D8", 0 ),
44 PCI_ROM( 0x14e4, 0x16d9,
"14e4-16D9",
"14e4-16D9", 0 ),
45 PCI_ROM( 0x14e4, 0x16da,
"14e4-16DA",
"14e4-16DA", 0 ),
46 PCI_ROM( 0x14e4, 0x16db,
"14e4-16DB",
"14e4-16DB", 0 ),
48 PCI_ROM( 0x14e4, 0x16de,
"14e4-16DE",
"14e4-16DE", 0 ),
49 PCI_ROM( 0x14e4, 0x16df,
"14e4-16DF",
"14e4-16DF", 0 ),
50 PCI_ROM( 0x14e4, 0x16e0,
"14e4-16E0",
"14e4-16E0", 0 ),
51 PCI_ROM( 0x14e4, 0x16e2,
"14e4-16E2",
"14e4-16E2", 0 ),
52 PCI_ROM( 0x14e4, 0x16e3,
"14e4-16E3",
"14e4-16E3", 0 ),
53 PCI_ROM( 0x14e4, 0x16e4,
"14e4-16E4",
"14e4-16E4", 0 ),
54 PCI_ROM( 0x14e4, 0x16e7,
"14e4-16E7",
"14e4-16E7", 0 ),
55 PCI_ROM( 0x14e4, 0x16e8,
"14e4-16E8",
"14e4-16E8", 0 ),
56 PCI_ROM( 0x14e4, 0x16e9,
"14e4-16E9",
"14e4-16E9", 0 ),
57 PCI_ROM( 0x14e4, 0x16ea,
"14e4-16EA",
"14e4-16EA", 0 ),
58 PCI_ROM( 0x14e4, 0x16eb,
"14e4-16EB",
"14e4-16EB", 0 ),
59 PCI_ROM( 0x14e4, 0x16ec,
"14e4-16EC",
"14e4-16EC", 0 ),
60 PCI_ROM( 0x14e4, 0x16ed,
"14e4-16ED",
"14e4-16ED", 0 ),
61 PCI_ROM( 0x14e4, 0x16ee,
"14e4-16EE",
"14e4-16EE", 0 ),
62 PCI_ROM( 0x14e4, 0x16ef,
"14e4-16EF",
"14e4-16EF", 0 ),
63 PCI_ROM( 0x14e4, 0x16f0,
"14e4-16F0",
"14e4-16F0", 0 ),
64 PCI_ROM( 0x14e4, 0x16f1,
"14e4-16F1",
"14e4-16F1", 0 ),
65 PCI_ROM( 0x14e4, 0x1604,
"14e4-1604",
"14e4-1604", 0 ),
66 PCI_ROM( 0x14e4, 0x1605,
"14e4-1605",
"14e4-1605", 0 ),
67 PCI_ROM( 0x14e4, 0x1606,
"14e4-1606",
"14e4-1606", 0 ),
68 PCI_ROM( 0x14e4, 0x1609,
"14e4-1609",
"14e4-1609", 0 ),
69 PCI_ROM( 0x14e4, 0x1614,
"14e4-1614",
"14e4-1614", 0 ),
70 PCI_ROM( 0x14e4, 0xd802,
"14e4-D802",
"14e4-D802", 0 ),
71 PCI_ROM( 0x14e4, 0xd804,
"14e4-D804",
"14e4-D804", 0 ),
72 PCI_ROM( 0x14e4, 0x1750,
"14e4-1750",
"14e4-1750", 0 ),
73 PCI_ROM( 0x14e4, 0x1802,
"14e4-1802",
"14e4-1802", 0 ),
74 PCI_ROM( 0x14e4, 0x1805,
"14e4-1805",
"14e4-1805", 0 ),
75 PCI_ROM( 0x14e4, 0x1751,
"14e4-1751",
"14e4-1751", 0 ),
76 PCI_ROM( 0x14e4, 0x1801,
"14e4-1801",
"14e4-1801", 0 ),
77 PCI_ROM( 0x14e4, 0x1804,
"14e4-1804",
"14e4-1804", 0 ),
78 PCI_ROM( 0x14e4, 0x1752,
"14e4-1752",
"14e4-1752", 0 ),
79 PCI_ROM( 0x14e4, 0x1800,
"14e4-1800",
"14e4-1800", 0 ),
80 PCI_ROM( 0x14e4, 0x1803,
"14e4-1803",
"14e4-1803", 0 ),
100 DBGP (
"%s\n", __func__ );
117 unsigned long reg_base, reg_size;
128 DBGP (
"%s\n", __func__ );
138 &
bp->subsystem_vendor );
143 &
bp->subsystem_device );
166 DBGP (
"%s\n", __func__ );
169 DBGP (
"- %s ( ): Failed\n", __func__ );
237 char *
src = (
char * )iob->
data;
260 if ( rx_vlan ==
bp->vlan_tx )
263 if ( rx_vlan ==
bp->vlan_id )
265 if ( rx_vlan && !
bp->vlan_id )
269 if ( !
bp->vlan_tx && !
bp->vlan_id )
285 return ( avail-use );
296 else if (
len < 1024 )
298 else if (
len < 2048 )
313 iob =
bp->tx.iob[hw_idx];
325 DBGP (
"%s\n", __func__ );
329 for ( i = 0; i <
bp->rx.buf_cnt; i++ ) {
330 if (
bp->rx.iob[i] ) {
360 DBGP (
"- %s ( ): alloc_iob Failed\n", __func__ );
367 bp->rx.iob[iob_idx] = iob;
373 u16 cons_id = (
bp->rx.cons_id %
bp->rx.ring_cnt );
376 while (
bp->rx.iob_cnt <
bp->rx.buf_cnt ) {
377 iob_idx = ( cons_id %
bp->rx.buf_cnt );
378 if ( !
bp->rx.iob[iob_idx] ) {
384 cons_id =
NEXT_IDX ( cons_id,
bp->rx.ring_cnt );
388 if ( cons_id !=
bp->rx.cons_id ) {
390 bp->rx.cons_id = cons_id;
402 u16 err_flags, rx_vlan;
403 u8 ignore_chksum_err = 0;
408 ignore_chksum_err = 1;
410 if ( err_flags && !ignore_chksum_err ) {
415 for ( i = 0; i < 6; i++ ) {
416 if ( rx_buf[6 + i] !=
bp->mac_addr[i] )
451 cons_id =
bp->cq.cons_id + cnt;
454 bp->cq.completion_bit ^= 1;
457 bp->cq.cons_id = cons_id;
477 bp->rx.iob[desc_idx] =
NULL;
489 u8 cmpl_bit =
bp->cq.completion_bit;
491 if (
bp->cq.cons_id == (
bp->cq.ring_cnt - 1 ) ) {
506 DBGP (
"%s\n", __func__ );
527 DBGP (
"%s\n", __func__ );
533 bp->nq.completion_bit = 0x1;
535 bp->cq.completion_bit = 0x1;
554 DBGP (
"%s\n", __func__ );
555 if (
bp->nq.bd_virt ) {
560 if (
bp->cq.bd_virt ) {
565 if (
bp->rx.bd_virt ) {
570 if (
bp->tx.bd_virt ) {
575 if (
bp->hwrm_addr_dma ) {
577 bp->dma_addr_mapping = 0;
581 if (
bp->hwrm_addr_resp ) {
583 bp->resp_addr_mapping = 0;
584 bp->hwrm_addr_resp =
NULL;
587 if (
bp->hwrm_addr_req ) {
589 bp->req_addr_mapping = 0;
592 DBGP (
"- %s ( ): - Done\n", __func__ );
597 DBGP (
"%s\n", __func__ );
607 bp->hwrm_addr_resp &&
617 DBGP (
"- %s ( ): Failed\n", __func__ );
636 for ( i = 0; i < cnt; i++ ) {
660 struct input *req = (
struct input * )
bp->hwrm_addr_req;
662 u8 *ptr = (
u8 * )resp;
668 if (
len >
bp->hwrm_max_req_len )
673 for ( idx = 0; idx < wait_cnt; idx++ ) {
674 resp_len = resp->resp_len;
677 ptr[resp_len - 1] == 1 ) {
678 bp->last_resp_code = resp->error_code;
679 ret = resp->error_code;
695 DBGP (
"%s\n", __func__ );
711 if ( !
bp->hwrm_cmd_timeout )
738 DBGP (
"%s\n", __func__ );
798 DBGP (
"%s\n", __func__ );
806 bp->num_cmpl_rings =
bp->min_cp_rings;
809 bp->num_tx_rings =
bp->min_tx_rings;
812 bp->num_rx_rings =
bp->min_rx_rings;
815 bp->num_hw_ring_grps =
bp->min_hw_ring_grps;
818 bp->num_stat_ctxs =
bp->min_stat_ctxs;
834 DBGP (
"%s\n", __func__ );
854 DBGP (
"%s\n", __func__ );
864 DBGP (
"- %s ( ): Failed\n", __func__ );
884 DBGP (
"%s\n", __func__ );
891 DBGP (
"- %s ( ): Failed\n", __func__ );
902 bp->ordinal_value = (
u8 )resp->
pci_id & 0x0F;
923 DBGP (
"%s\n", __func__ );
937 DBGP (
"%s\n", __func__ );
953 return wait_resp (
bp,
bp->hwrm_cmd_timeout, cmd_len, __func__ );
962 DBGP (
"%s\n", __func__ );
977 DBGP (
"- %s ( ): Failed\n", __func__ );
991 DBGP (
"%s\n", __func__ );
1011 DBGP (
"%s\n", __func__ );
1013 idx =
bp->nq_ring_id;
1015 idx =
bp->cq_ring_id;
1053 DBGP (
"%s\n", __func__ );
1066 memcpy ( (
char * )&req->l2_addr[0], (
char * )&
bp->mac_addr[0],
1074 req->src_id = (
u32 )
bp->port_idx;
1075 req->dst_id =
bp->vnic_id;
1091 DBGP (
"%s\n", __func__ );
1101 DBGP (
"- %s ( ): Failed\n", __func__ );
1140 return wait_resp (
bp,
bp->hwrm_cmd_timeout, cmd_len, __func__ );
1150 DBGP (
"%s\n", __func__ );
1156 DBGP (
"- %s ( ): Failed\n", __func__ );
1179 u16 data_len,
u16 option_num,
u16 dimensions,
u16 index_0 )
1184 DBGP (
"%s\n", __func__ );
1194 cmd_len, __func__ );
1199 u32 *ptr32 = (
u32 * )
bp->hwrm_addr_dma;
1201 DBGP (
"%s\n", __func__ );
1263 u32 *ptr32 = (
u32 * )
bp->hwrm_addr_dma;
1287 DBGP (
"VLAN MBA Enabled ( %d )\n",
1298 DBGP (
"%s\n", __func__ );
1305 return wait_resp (
bp,
bp->hwrm_cmd_timeout, cmd_len, __func__ );
1313 DBGP (
"%s\n", __func__ );
1332 DBGP (
"%s\n", __func__ );
1343 DBGP (
"- %s ( ): Failed\n", __func__ );
1356 DBGP (
"%s\n", __func__ );
1363 return wait_resp (
bp,
bp->hwrm_cmd_timeout, cmd_len, __func__ );
1378 DBGP (
"%s\n", __func__ );
1422 req->port_id =
bp->port_idx;
1429 return wait_resp (
bp,
bp->hwrm_cmd_timeout, cmd_len, __func__ );
1436 DBGP (
"%s\n", __func__ );
1472 DBGP (
"%s\n", __func__ );
1474 for ( i = 0; i < (
bp->wait_link_timeout / 100 ); i++ ) {
1497 DBGP (
"%s\n", __func__ );
1503 DBGP (
"- %s ( ): Failed\n", __func__ );
1518 DBGP (
"%s\n", __func__ );
1527 DBGP (
"- %s ( ): Failed\n", __func__ );
1541 DBGP (
"%s\n", __func__ );
1550 DBGP (
"- %s ( ): Failed\n", __func__ );
1565 DBGP (
"%s\n", __func__ );
1572 req->cr =
bp->cq_ring_id;
1573 req->rr =
bp->rx_ring_id;
1576 req->sc =
bp->stat_ctx_id;
1580 DBGP (
"- %s ( ): Failed\n", __func__ );
1594 DBGP (
"%s\n", __func__ );
1599 return wait_resp (
bp,
bp->hwrm_cmd_timeout, cmd_len, __func__ );
1609 DBGP (
"%s\n", __func__ );
1613 req->ring_type =
type;
1618 req->length = (
u32 )
bp->nq.ring_cnt;
1619 req->logical_id = 0xFFFF;
1625 req->length = (
u32 )
bp->cq.ring_cnt;
1630 req->nq_ring_id =
bp->nq_ring_id;
1631 req->cq_handle = (
u64 )
bp->nq_ring_id;
1636 req->length = (
u32 )
bp->tx.ring_cnt;
1638 req->stat_ctx_id = (
u32 )
bp->stat_ctx_id;
1639 req->cmpl_ring_id =
bp->cq_ring_id;
1645 req->length = (
u32 )
bp->rx.ring_cnt;
1647 req->cmpl_ring_id =
bp->cq_ring_id;
1660 DBGP (
"- %s ( ): Failed, type = %x\n", __func__,
type );
1682 DBGP (
"%s\n", __func__ );
1688 DBGP (
"%s\n", __func__ );
1694 DBGP (
"%s\n", __func__ );
1702 DBGP (
"%s\n", __func__ );
1717 DBGP (
"%s\n", __func__ );
1732 DBGP (
"%s\n", __func__ );
1757 DBGP (
"%s\n", __func__ );
1775 DBGP (
"%s\n", __func__ );
1782 DBGP (
"- %s ( ): Failed\n", __func__ );
1797 DBGP (
"%s\n", __func__ );
1806 DBGP (
"- %s ( ): Failed\n", __func__ );
1819 DBGP (
"%s\n", __func__ );
1837 return wait_resp (
bp,
bp->hwrm_cmd_timeout, cmd_len, __func__ );
1911 for ( ptr = cmds; *ptr; ++ptr ) {
1914 ret = ( *ptr ) (
bp );
1916 DBGP (
"- %s ( ): Failed\n", __func__ );
1923 #define bnxt_down_chip( bp ) bnxt_hwrm_run ( bring_down_chip, bp ) 1924 #define bnxt_up_chip( bp ) bnxt_hwrm_run ( bring_up_chip, bp ) 1925 #define bnxt_down_nic( bp ) bnxt_hwrm_run ( bring_down_nic, bp ) 1926 #define bnxt_up_nic( bp ) bnxt_hwrm_run ( bring_up_nic, bp ) 1932 DBGP (
"%s\n", __func__ );
1942 if ( !
bp->vlan_tx &&
bp->vlan_id )
1946 if (
iob_len ( iob ) != prev_len )
1960 DBGP (
"- %s ( ): Failed no bd's available\n", __func__ );
1985 cons_id =
bp->nq.cons_id + cnt;
1986 if ( cons_id >=
bp->nq.ring_cnt ) {
1988 bp->nq.completion_bit ^= 1;
1989 cons_id = cons_id -
bp->nq.ring_cnt;
1991 bp->nq.cons_id = cons_id;
2015 u16 old_cid =
bp->cq.cons_id;
2031 switch ( cq_type ) {
2054 if (
bp->cq.cons_id != old_cid )
2062 u16 old_cid =
bp->nq.cons_id;
2071 bp->nq.cons_id, sizeof (
struct nq_base ) );
2072 if ( ( nqp->
v &
NQ_CN_V ) ^
bp->nq.completion_bit )
2078 switch ( nq_type ) {
2092 if (
bp->nq.cons_id != old_cid )
2107 DBGP (
"%s\n", __func__ );
2133 DBGP (
"%s\n", __func__ );
2137 DBGP (
"- %s ( ): alloc_etherdev Failed\n", __func__ );
2165 DBGP (
"- %s ( ): bnxt_alloc_mem Failed\n", __func__ );
2171 DBGP (
"- %s ( ): bnxt_up_chip Failed\n", __func__ );
2177 DBGP (
"- %s ( ): register_netdev Failed\n", __func__ );
2202 DBGP (
"%s\n", __func__ );
#define VNIC_CFG_REQ_ENABLES_MRU
#define dump_evt(cq, ty, id, ring)
#define RING_ALLOC_REQ_RING_TYPE_NQ
#define dbg_tx_avail(bp, a, u)
#define IPXE_VERSION_MAJOR
#define EINVAL
Invalid argument.
static u32 bnxt_set_ring_info(struct bnxt *bp)
#define LINK_SPEED_DRV_2_5G
#define HWRM_STAT_CTX_FREE
#define CFA_L2_SET_RX_MASK_REQ_MASK_PROMISCUOUS
struct arbelprm_rc_send_wqe rc
static void netdev_tx_complete(struct net_device *netdev, struct io_buffer *iobuf)
Complete network transmission.
static void bnxt_service_cq(struct net_device *dev)
#define PORT_PHY_CFG_REQ_AUTO_DUPLEX_BOTH
#define iob_put(iobuf, len)
#define PORT_PHY_CFG_REQ_FORCE_LINK_SPEED_100GB
static int bnxt_hwrm_ver_get(struct bnxt *bp)
#define dbg_flags(func, flags)
static void bnxt_db_tx(struct bnxt *bp, u32 idx)
void netdev_rx_err(struct net_device *netdev, struct io_buffer *iobuf, int rc)
Discard received packet.
#define MEDIA_AUTO_DETECT_MASK
#define HWRM_PORT_MAC_CFG
#define HWRM_CFA_L2_FILTER_FREE
#define CFA_L2_SET_RX_MASK_REQ_MASK_BCAST
#define BD_NOW(bd, entry, len)
#define IPXE_VERSION_UPDATE
#define SHORT_CMD_SUPPORTED
#define dbg_hw_cmd(bp, func, cmd_len, resp_len, cmd_tmo, err)
static unsigned int unsigned int reg
#define FUNC_DRV_UNRGTR_REQ_FLAGS_PREPARE_FOR_SHUTDOWN
#define MEDIUM_SPEED_2500MBPS
#define dbg_alloc_rx_iob(iob, id, cid)
#define HWRM_CMD_DEFAULT_MULTIPLAYER(a)
#define DEFAULT_NUMBER_OF_CMPL_RINGS
static int bnxt_hwrm_ring_alloc_tx(struct bnxt *bp)
#define dbg_func_resource_qcaps(bp)
int(* open)(struct net_device *netdev)
Open network device.
#define DEFAULT_NUMBER_OF_RING_GRPS
#define RX_PKT_CMPL_METADATA_VID_MASK
#define SERVICE_NEXT_NQ_BD
#define CQ_DOORBELL_KEY_IDX(a)
int(* hwrm_func_t)(struct bnxt *bp)
#define FUNC_DRV_RGTR_REQ_ENABLES_VER
#define dbg_short_cmd(sreq, func, len)
__le16 vf_reservation_strategy
static int bnxt_get_device_address(struct bnxt *bp)
#define PORT_PHY_CFG_REQ_FORCE_LINK_SPEED_10GB
#define RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN
#define CFA_L2_FILTER_ALLOC_REQ_ENABLES_DST_ID
#define dbg_rxp(iob, rx_len, drop)
#define HWRM_CMD_FLASH_MULTIPLAYER(a)
#define RX_MASK_PROMISCUOUS_MODE
unsigned long driver_data
Arbitrary driver data.
#define LINK_SPEED_DRV_AUTONEG
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
struct pci_device_id * ids
PCI ID table.
static void hwrm_init(struct bnxt *bp, struct input *req, u16 cmd, u16 len)
#define PORT_PHY_CFG_REQ_AUTO_MODE_SPEED_MASK
#define NQ_RING_BUFFER_SIZE
uint32_t type
Operating system type.
int bnxt_hwrm_run(hwrm_func_t cmds[], struct bnxt *bp)
static int bnxt_hwrm_func_cfg_req(struct bnxt *bp)
#define PCI_COMMAND_INTX_DISABLE
Interrupt disable.
static void bnxt_db_nq(struct bnxt *bp)
#define dbg_tx_vlan(bp, src, plen, len)
#define HWRM_VERSION_MINOR
#define RING_FREE(bp, rid, flag)
#define PORT_PHY_CFG_REQ_ENABLES_AUTO_LINK_SPEED_MASK
#define LINK_POLL_WAIT_TIME
static int bnxt_hwrm_ring_free_rx(struct bnxt *bp)
static void * bnxt_pci_base(struct pci_device *pdev, unsigned int reg)
#define RING_FREE_REQ_RING_TYPE_TX
static int bnxt_hwrm_ring_alloc_grp(struct bnxt *bp)
static u32 bnxt_tx_avail(struct bnxt *bp)
#define CFA_L2_FILTER_ALLOC_REQ_FLAGS_PATH_RX
static void *__malloc malloc_phys(size_t size, size_t phys_align)
Allocate memory with specified physical alignment.
#define ASYNC_EVENT_CMPL_EVENT_ID_LINK_STATUS_CHANGE
#define PCI_BASE_ADDRESS_0
#define HWRM_FUNC_BACKING_STORE_CFG
#define D3_LINK_SPEED_FW_NUM
#define D3_SPEED_FW_SHIFT
static int bnxt_hwrm_ring_alloc(struct bnxt *bp, u8 type)
void bnxt_link_evt(struct bnxt *bp, struct hwrm_async_event_cmpl *evt)
void netdev_link_down(struct net_device *netdev)
Mark network device as having link down.
static int bnxt_hwrm_func_drv_rgtr(struct bnxt *bp)
#define BNXT_RX_STD_DMA_SZ
#define FUNC_CFG_REQ_ENABLES_NUM_CMPL_RINGS
#define PCI_COMMAND
PCI command.
void bnxt_mm_nic(struct bnxt *bp)
static int bnxt_hwrm_cfa_l2_filter_alloc(struct bnxt *bp)
#define LINK_SPEED_DRV_NUM
#define BNXT_FLAG_MULTI_HOST
#define MEDIUM_SPEED_10GBPS
static int bnxt_hwrm_func_resource_qcaps(struct bnxt *bp)
#define GET_MEDIUM_SPEED(m)
static int bnxt_hwrm_func_reset_req(struct bnxt *bp)
#define FUNC_CFG_REQ_EVB_MODE_NO_EVB
#define PORT_PHY_QCFG_RESP_LINK_LINK
static int bnxt_init_one(struct pci_device *pci)
static void bnxt_adv_cq_index(struct bnxt *bp, u16 cnt)
static int bnxt_hwrm_nvm_get_variable_req(struct bnxt *bp, u16 data_len, u16 option_num, u16 dimensions, u16 index_0)
void adjust_pci_device(struct pci_device *pci)
Enable PCI device.
struct io_buffer * alloc_iob(size_t len)
Allocate I/O buffer.
#define PORT_PHY_CFG_REQ_FLAGS_RESET_PHY
#define MEDIUM_SPEED_50GBPS
#define PORT_PHY_CFG_REQ_ENABLES_AUTO_MODE
#define PCI_SUBSYSTEM_ID
PCI subsystem ID.
struct device dev
Generic device.
#define FUNC_DRV_RGTR_REQ_OS_TYPE_OTHER
#define BNXT_FLAG_NPAR_MODE
#define CFA_L2_FILTER_ALLOC_REQ_ENABLES_L2_ADDR_MASK
#define FUNC_CFG_REQ_ENABLES_NUM_HW_RING_GRPS
#define RING_ALLOC_REQ_ENABLES_RX_BUF_SIZE_VALID
void bnxt_add_vlan(struct io_buffer *iob, u16 vlan)
static void bnxt_close(struct net_device *dev)
#define MEDIUM_SPEED_200GBPS
#define FUNC_QCFG_RESP_FLAGS_MULTI_HOST
Dynamic memory allocation.
static int bnxt_hwrm_func_qcaps_req(struct bnxt *bp)
#define RX_PROD_PKT_BD_TYPE_RX_PROD_PKT
void bnxt_rx_process(struct net_device *dev, struct bnxt *bp, struct rx_pkt_cmpl *rx_cmp, struct rx_pkt_cmpl_hi *rx_cmp_hi)
static struct pci_device_id bnxt_nics[]
#define RX_MASK_ACCEPT_NONE
#define MEDIUM_SPEED_25GBPS
static void netdev_init(struct net_device *netdev, struct net_device_operations *op)
Initialise a network device.
int bnxt_free_rx_iob(struct bnxt *bp)
#define dbg_pci(bp, func, creg)
static void pci_set_drvdata(struct pci_device *pci, void *priv)
Set PCI driver-private data.
#define DEFAULT_NUMBER_OF_STAT_CTXS
#define STATUS_LINK_ACTIVE
#define HWRM_RING_GRP_ALLOC
#define ENOMEM
Not enough space.
#define LINK_SPEED_FW_NUM
#define LINK_SPEED_DRV_40G
void * memcpy(void *dest, const void *src, size_t len) __nonnull
int bnxt_alloc_mem(struct bnxt *bp)
#define PORT_PHY_CFG_REQ_AUTO_PAUSE_RX
#define NO_MORE_NQ_BD_TO_SERVICE
#define VNIC_CFG_REQ_ENABLES_DEFAULT_CMPL_RING_ID
static __always_inline unsigned long virt_to_bus(volatile const void *addr)
Convert virtual address to a bus address.
static int bnxt_hwrm_set_rx_mask(struct bnxt *bp, u32 rx_mask)
static int wait_resp(struct bnxt *bp, u32 tmo, u16 len, const char *func)
#define PORT_PHY_CFG_REQ_FORCE_LINK_SPEED_40GB
int bnxt_post_rx_buffers(struct bnxt *bp)
#define HWRM_QUEUE_QPORTCFG
#define FUNC_CFG_REQ_ENABLES_ASYNC_EVENT_CR
#define SHORT_CMD_REQUIRED
assert((readw(&hdr->flags) &(GTF_reading|GTF_writing))==0)
#define RX_RING_BUFFER_SIZE
#define HWRM_CFA_L2_SET_RX_MASK
static void netdev_put(struct net_device *netdev)
Drop reference to network device.
#define DEFAULT_NUMBER_OF_RX_RINGS
#define dbg_mem(bp, func)
static int bnxt_hwrm_func_drv_unrgtr(struct bnxt *bp)
#define CMPL_BASE_TYPE_HWRM_ASYNC_EVENT
static void bnxt_tx_adjust_pkt(struct bnxt *bp, struct io_buffer *iob)
#define dbg_func_qcaps(bp)
static int bnxt_reset_rx_mask(struct bnxt *bp)
void * priv
Driver private data.
static int bnxt_hwrm_ring_free_nq(struct bnxt *bp)
#define RING_ALLOC_REQ_ENABLES_NQ_RING_ID_VALID
static int bnxt_hwrm_ring_alloc_rx(struct bnxt *bp)
#define dbg_rx_vlan(bp, metadata, flags2, rx_vid)
static void netdev_link_up(struct net_device *netdev)
Mark network device as having link up.
#define VNIC_CFG_REQ_ENABLES_DFLT_RING_GRP
#define PCI_BASE_ADDRESS_2
static int bnxt_hwrm_cfa_l2_filter_free(struct bnxt *bp)
#define HWRM_CFA_L2_FILTER_ALLOC
#define bnxt_down_nic(bp)
void udelay(unsigned long usecs)
Delay for a fixed number of microseconds.
static int bnxt_hwrm_set_async_event(struct bnxt *bp)
#define BNXT_DMA_ALIGNMENT
static struct net_device * netdev
static int bnxt_hwrm_ring_alloc_cq(struct bnxt *bp)
unsigned long pci_bar_start(struct pci_device *pci, unsigned int reg)
Find the start of a PCI BAR.
#define NQ_CN_TYPE_CQ_NOTIFICATION
static void bnxt_tx_complete(struct net_device *dev, u16 hw_idx)
#define CMPL_BASE_TYPE_RX_L2
static void bnxt_down_pci(struct bnxt *bp)
#define HWRM_NA_SIGNATURE
#define bnxt_down_chip(bp)
#define HWRM_FUNC_DRV_RGTR
void unregister_netdev(struct net_device *netdev)
Unregister network device.
static int bnxt_hwrm_port_phy_qcfg(struct bnxt *bp, u16 idx)
static int bnxt_hwrm_ring_free_tx(struct bnxt *bp)
static int bnxt_get_pci_info(struct bnxt *bp)
hwrm_func_t bring_up_chip[]
static void bnxt_remove_one(struct pci_device *pci)
#define TX_RING_BUFFER_SIZE
#define TX_BD_SHORT_FLAGS_LHINT_LT512
#define HWRM_FUNC_RESOURCE_QCAPS
static __always_inline void off_t userptr_t src
#define VNIC_CFG_REQ_ENABLES_DEFAULT_RX_RING_ID
void bnxt_mm_init(struct bnxt *bp, const char *func)
#define BNXT_CQ_INTR_MODE(vf)
#define PORT_CFG_LINK_SETTINGS_MEDIA_AUTO_DETECT_NUM
#define dbg_rx_cid(idx, cid)
void bnxt_set_txq(struct bnxt *bp, int entry, dma_addr_t mapping, int len)
#define TX_BD_SHORT_FLAGS_LHINT_LT1K
static int bnxt_rx_complete(struct net_device *dev, struct rx_pkt_cmpl *rx)
#define dbg_alloc_rx_iob_fail(iob_idx, cons_id)
#define HWRM_STAT_CTX_ALLOC
static int bnxt_tx(struct net_device *dev, struct io_buffer *iob)
union aes_table_entry entry[256]
Table entries, indexed by S(N)
#define CMPL_BASE_TYPE_TX_L2
#define DBC_DBC_TYPE_CQ_ARMALL
#define FUNC_CFG_REQ_ENABLES_NUM_RX_RINGS
static int bnxt_get_link_speed(struct bnxt *bp)
int register_netdev(struct net_device *netdev)
Register network device.
static size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
#define LINK_SPEED_DRV_MASK
#define MEDIUM_SPEED_1000MBPS
#define RX_PKT_CMPL_ERRORS_BUFFER_ERROR_SFT
static int bnxt_hwrm_vnic_free(struct bnxt *bp)
#define PORT_MAC_CFG_REQ_LPBK_NONE
static void netdev_nullify(struct net_device *netdev)
Stop using a network device.
#define PORT_PHY_CFG_REQ_FORCE_LINK_SPEED_1GB
#define dump_tx_pkt(pkt, len, idx)
#define CQ_RING_BUFFER_SIZE
hwrm_func_t bring_down_nic[]
static void hwrm_write_req(struct bnxt *bp, void *req, u32 cnt)
#define PORT_PHY_CFG_REQ_ENABLES_AUTO_PAUSE
#define CFA_L2_SET_RX_MASK_REQ_MASK_MCAST
static void thor_db(struct bnxt *bp, u32 idx, u32 xid, u32 flag)
static int bnxt_hwrm_ring_free_cq(struct bnxt *bp)
#define PORT_PHY_CFG_REQ_FLAGS_FORCE
#define FUNC_CFG_PRE_BOOT_MBA_VLAN_VALUE_NUM
#define FUNC_DRV_RGTR_REQ_ENABLES_OS_TYPE
#define RX_MASK_ACCEPT_ALL_MULTICAST
static int bnxt_hwrm_port_phy_cfg(struct bnxt *bp)
static int bnxt_hwrm_queue_qportcfg(struct bnxt *bp)
A PCI device ID list entry.
#define PORT_PHY_CFG_REQ_FORCE_LINK_SPEED_200GB
static void bnxt_hwrm_assign_resources(struct bnxt *bp)
#define SHORT_REQ_SIGNATURE_SHORT_CMD
#define TX_BD_SHORT_FLAGS_LHINT_GTE2K
static int bnxt_hwrm_port_mac_cfg(struct bnxt *bp)
#define VF_CFG_ENABLE_FLAGS
#define TX_BD_SHORT_FLAGS_LHINT_LT2K
static int bnxt_hwrm_ring_alloc_nq(struct bnxt *bp)
static int is_valid_ether_addr(const void *addr)
Check if Ethernet address is valid.
void * memmove(void *dest, const void *src, size_t len) __nonnull
static void bnxt_set_link(struct bnxt *bp)
static int bnxt_query_phy_link(struct bnxt *bp)
#define HWRM_FUNC_DRV_UNRGTR
#define CFA_L2_FILTER_ALLOC_REQ_SRC_TYPE_NPORT
#define FUNC_CFG_REQ_ENABLES_NUM_TX_RINGS
#define dbg_chip_info(bp)
u8 bnxt_rx_drop(struct bnxt *bp, struct io_buffer *iob, struct rx_pkt_cmpl_hi *rx_cmp_hi, u16 rx_len)
Network device operations.
void netdev_rx(struct net_device *netdev, struct io_buffer *iobuf)
Add packet to receive queue.
static void bnxt_db_rx(struct bnxt *bp, u32 idx)
#define PORT_PHY_CFG_REQ_AUTO_PAUSE_TX
struct device * dev
Underlying hardware device.
#define HWRM_PORT_PHY_QCFG
#define LINK_SPEED_DRV_10G
#define PORT_PHY_CFG_REQ_FORCE_LINK_SPEED_50GB
#define TX_IN_USE(a, b, c)
static int bnxt_hwrm_stat_ctx_free(struct bnxt *bp)
static int bnxt_hwrm_vnic_cfg(struct bnxt *bp)
#define MEDIUM_SPEED_AUTONEG
Network device management.
#define CMPL_BASE_TYPE_STAT_EJECT
static void * pci_get_drvdata(struct pci_device *pci)
Get PCI driver-private data.
u8 bnxt_is_pci_vf(struct pci_device *pdev)
Check if Virtual Function.
#define dbg_tx_done(pkt, len, idx)
void mdelay(unsigned long msecs)
Delay for a fixed number of milliseconds.
#define PCICFG_ME_REGISTER
#define HWRM_NVM_GET_VARIABLE
#define HWRM_VERSION_UPDATE
#define LINK_DEFAULT_TIMEOUT
#define CMPL_DOORBELL_KEY_CMPL
#define NO_MORE_CQ_BD_TO_SERVICE
#define prn_set_speed(speed)
#define RING_ALLOC_REQ_RING_TYPE_TX
static void short_hwrm_cmd_req(struct bnxt *bp, u16 len)
static int bnxt_hwrm_ring_free_grp(struct bnxt *bp)
#define RX_MASK_ACCEPT_MULTICAST
#define dbg_fw_ver(resp, tmo)
#define ENOBUFS
No buffer space available.
#define MEDIUM_FULL_DUPLEX
static int bnxt_get_vlan(struct bnxt *bp)
Media Independent Interface constants.
void bnxt_free_mem(struct bnxt *bp)
#define FUNC_CFG_REQ_ENABLES_EVB_MODE
#define RING_ALLOC_REQ_RING_TYPE_RX
static void bnxt_adv_nq_index(struct bnxt *bp, u16 cnt)
#define dump_rx_bd(rx_cmp, rx_cmp_hi, desc_idx)
#define RING_FREE_REQ_RING_TYPE_L2_CMPL
static int bnxt_alloc_rx_iob(struct bnxt *bp, u16 cons_id, u16 iob_idx)
#define RING_FREE_REQ_RING_TYPE_RX
void * data
Start of data.
static int bnxt_hwrm_vnic_alloc(struct bnxt *bp)
#define LINK_SPEED_DRV_50G
#define barrier()
Optimisation barrier.
static int bnxt_hwrm_backing_store_qcfg(struct bnxt *bp)
#define FUNC_CFG_REQ_ENABLES_NUM_MSIX
#define HWRM_PORT_PHY_CFG
#define FUNC_DRV_RGTR_REQ_ENABLES_ASYNC_EVENT_FWD
struct net_device * alloc_etherdev(size_t priv_size)
Allocate Ethernet device.
u8 rx[WPA_TKIP_MIC_KEY_LEN]
MIC key for packets from the AP.
#define FUNC_CFG_REQ_ENABLES_NUM_STAT_CTXS
struct pci_device_id * id
Driver device ID.
#define CFA_L2_SET_RX_MASK_REQ_MASK_ALL_MCAST
static int bnxt_open(struct net_device *dev)
#define FUNC_CFG_REQ_ENABLES_NUM_VNICS
void iounmap(volatile const void *io_addr)
Unmap I/O address.
static int bnxt_hwrm_stat_ctx_alloc(struct bnxt *bp)
static void bnxt_poll(struct net_device *dev)
#define MAX_ETHERNET_PACKET_BUFFER_SIZE
#define DEFAULT_NUMBER_OF_TX_RINGS
#define RING_FREE_REQ_RING_TYPE_NQ
static int bnxt_set_rx_mask(struct bnxt *bp)
#define LINK_SPEED_DRV_200G
static int bnxt_hwrm_func_qcfg_req(struct bnxt *bp)
#define SERVICE_NEXT_CQ_BD
#define SET_MEDIUM_DUPLEX(bp, d)
int bnxt_vlan_drop(struct bnxt *bp, u16 rx_vlan)
static void free_phys(void *ptr, size_t size)
Free memory allocated with malloc_phys()
#define LINK_SPEED_DRV_100G
static u16 bnxt_get_pkt_vlan(char *src)
void mb(void)
Memory barrier.
#define dbg_link_status(bp)
#define RX_DOORBELL_KEY_RX
#define RING_ALLOC_REQ_RING_TYPE_L2_CMPL
#define PCI_SUBSYSTEM_VENDOR_ID
PCI subsystem vendor ID.
#define BNXT_FLAG_HWRM_SHORT_CMD_SUPP
#define dbg_num_rings(bp)
#define MEDIUM_SPEED_40GBPS
#define LINK_SPEED_DRV_1G
#define TX_DOORBELL_KEY_TX
#define dbg_link_state(bp, tmo)
#define FUNC_CFG_PRE_BOOT_MBA_VLAN_NUM
#define RING_ALLOC_REQ_INT_MODE_POLL
#define dbg_func_qcfg(bp)
u32 set_rx_mask(u32 rx_mask)
#define PCI_BASE_ADDRESS_4
#define VNIC_CFG_REQ_FLAGS_VLAN_STRIP_MODE
static void bnxt_service_nq(struct net_device *dev)
#define HWRM_VERSION_MAJOR
void * pci_ioremap(struct pci_device *pci, unsigned long bus_addr, size_t len)
Map PCI bus address as an I/O address.
hwrm_func_t bring_down_chip[]
#define MEDIUM_SPEED_100GBPS
hwrm_func_t bring_up_nic[]
#define FUNC_BACKING_STORE_CFG_REQ_FLAGS_PREBOOT_MODE
#define dbg_tx_pad(plen, len)
static void bnxt_set_rx_desc(u8 *buf, struct io_buffer *iob, u16 cid, u32 idx)
#define FUNC_RESET_REQ_FUNC_RESET_LEVEL_RESETME
static struct net_device_operations bnxt_netdev_ops
#define HWRM_FUNC_BACKING_STORE_QCFG
#define CFA_L2_FILTER_ALLOC_REQ_ENABLES_L2_ADDR
#define PORT_PHY_CFG_REQ_FORCE_LINK_SPEED_25GB
#define HWRM_RING_GRP_FREE
#define FUNC_QCFG_RESP_PORT_PARTITION_TYPE_NPAR1_0
#define BNXT_FLAG_RESOURCE_QCAPS_SUPPORT
#define FUNC_CFG_PRE_BOOT_MBA_VLAN_ENABLED
#define NULL
NULL pointer (VOID *)
#define SET_LINK(p, m, s)
#define DBC_DBC_TYPE_NQ_ARM
#define PCI_ROM(_vendor, _device, _name, _description, _data)
#define CMPL_BASE_TYPE_MASK
#define SET_MEDIUM_SPEED(bp, s)
void iob_pad(struct io_buffer *iobuf, size_t min_len)
Pad I/O buffer.
static int bnxt_hwrm_backing_store_cfg(struct bnxt *bp)
#define GRC_COM_CHAN_TRIG
#define CFA_L2_FILTER_ALLOC_REQ_FLAGS_OUTERMOST
struct bofm_section_header done
#define HWRM_CMD_POLL_WAIT_TIME
#define MEDIA_AUTO_DETECT_SHIFT
#define IPXE_VERSION_MINOR
#define GRC_COM_CHAN_BASE
uint16_t flag
Flag number.
u8 tx[WPA_TKIP_MIC_KEY_LEN]
MIC key for packets to the AP.
#define VNIC_ALLOC_REQ_FLAGS_DEFAULT
#define HWRM_CMD_DEFAULT_TIMEOUT
static int bnxt_get_phy_link(struct bnxt *bp)
if(natsemi->flags &NATSEMI_64BIT) return 1
#define PORT_PHY_CFG_REQ_ENABLES_AUTO_DUPLEX
void * memset(void *dest, int character, size_t len) __nonnull
#define DBC_MSG_XID(xid, flg)
struct pci_driver bnxt_pci_driver __pci_driver
int bnxt_hwrm_ring_free(struct bnxt *bp, u16 ring_id, u8 ring_type)
#define LINK_SPEED_DRV_25G
static void bnxt_db_cq(struct bnxt *bp)