27 PCI_ROM( 0x14e4, 0x1604,
"14e4-1604",
"14e4-1604", 0 ),
28 PCI_ROM( 0x14e4, 0x1605,
"14e4-1605",
"14e4-1605", 0 ),
29 PCI_ROM( 0x14e4, 0x1606,
"14e4-1606",
"14e4-1606", 0 ),
30 PCI_ROM( 0x14e4, 0x1609,
"14e4-1609",
"14e4-1609", 0 ),
31 PCI_ROM( 0x14e4, 0x1614,
"14e4-1614",
"14e4-1614", 0 ),
32 PCI_ROM( 0x14e4, 0x16c0,
"14e4-16C0",
"14e4-16C0", 0 ),
34 PCI_ROM( 0x14e4, 0x16c8,
"14e4-16C8",
"14e4-16C8", 0 ),
35 PCI_ROM( 0x14e4, 0x16c9,
"14e4-16C9",
"14e4-16C9", 0 ),
36 PCI_ROM( 0x14e4, 0x16ca,
"14e4-16CA",
"14e4-16CA", 0 ),
37 PCI_ROM( 0x14e4, 0x16cc,
"14e4-16CC",
"14e4-16CC", 0 ),
38 PCI_ROM( 0x14e4, 0x16cd,
"14e4-16CD",
"14e4-16CD", 0 ),
39 PCI_ROM( 0x14e4, 0x16ce,
"14e4-16CE",
"14e4-16CE", 0 ),
40 PCI_ROM( 0x14e4, 0x16cf,
"14e4-16CF",
"14e4-16CF", 0 ),
41 PCI_ROM( 0x14e4, 0x16d0,
"14e4-16D0",
"14e4-16D0", 0 ),
42 PCI_ROM( 0x14e4, 0x16d1,
"14e4-16D1",
"14e4-16D1", 0 ),
43 PCI_ROM( 0x14e4, 0x16d2,
"14e4-16D2",
"14e4-16D2", 0 ),
44 PCI_ROM( 0x14e4, 0x16d4,
"14e4-16D4",
"14e4-16D4", 0 ),
45 PCI_ROM( 0x14e4, 0x16d5,
"14e4-16D5",
"14e4-16D5", 0 ),
46 PCI_ROM( 0x14e4, 0x16d6,
"14e4-16D6",
"14e4-16D6", 0 ),
47 PCI_ROM( 0x14e4, 0x16d7,
"14e4-16D7",
"14e4-16D7", 0 ),
48 PCI_ROM( 0x14e4, 0x16d8,
"14e4-16D8",
"14e4-16D8", 0 ),
49 PCI_ROM( 0x14e4, 0x16d9,
"14e4-16D9",
"14e4-16D9", 0 ),
50 PCI_ROM( 0x14e4, 0x16da,
"14e4-16DA",
"14e4-16DA", 0 ),
51 PCI_ROM( 0x14e4, 0x16db,
"14e4-16DB",
"14e4-16DB", 0 ),
53 PCI_ROM( 0x14e4, 0x16de,
"14e4-16DE",
"14e4-16DE", 0 ),
54 PCI_ROM( 0x14e4, 0x16df,
"14e4-16DF",
"14e4-16DF", 0 ),
55 PCI_ROM( 0x14e4, 0x16e0,
"14e4-16E0",
"14e4-16E0", 0 ),
56 PCI_ROM( 0x14e4, 0x16e2,
"14e4-16E2",
"14e4-16E2", 0 ),
57 PCI_ROM( 0x14e4, 0x16e3,
"14e4-16E3",
"14e4-16E3", 0 ),
58 PCI_ROM( 0x14e4, 0x16e4,
"14e4-16E4",
"14e4-16E4", 0 ),
59 PCI_ROM( 0x14e4, 0x16e7,
"14e4-16E7",
"14e4-16E7", 0 ),
60 PCI_ROM( 0x14e4, 0x16e8,
"14e4-16E8",
"14e4-16E8", 0 ),
61 PCI_ROM( 0x14e4, 0x16e9,
"14e4-16E9",
"14e4-16E9", 0 ),
62 PCI_ROM( 0x14e4, 0x16ea,
"14e4-16EA",
"14e4-16EA", 0 ),
63 PCI_ROM( 0x14e4, 0x16eb,
"14e4-16EB",
"14e4-16EB", 0 ),
64 PCI_ROM( 0x14e4, 0x16ec,
"14e4-16EC",
"14e4-16EC", 0 ),
65 PCI_ROM( 0x14e4, 0x16ed,
"14e4-16ED",
"14e4-16ED", 0 ),
66 PCI_ROM( 0x14e4, 0x16ee,
"14e4-16EE",
"14e4-16EE", 0 ),
67 PCI_ROM( 0x14e4, 0x16ef,
"14e4-16EF",
"14e4-16EF", 0 ),
68 PCI_ROM( 0x14e4, 0x16f0,
"14e4-16F0",
"14e4-16F0", 0 ),
69 PCI_ROM( 0x14e4, 0x16f1,
"14e4-16F1",
"14e4-16F1", 0 ),
70 PCI_ROM( 0x14e4, 0x1750,
"14e4-1750",
"14e4-1750", 0 ),
71 PCI_ROM( 0x14e4, 0x1751,
"14e4-1751",
"14e4-1751", 0 ),
72 PCI_ROM( 0x14e4, 0x1752,
"14e4-1752",
"14e4-1752", 0 ),
73 PCI_ROM( 0x14e4, 0x1760,
"14e4-1760",
"14e4-1760", 0 ),
74 PCI_ROM( 0x14e4, 0x1800,
"14e4-1800",
"14e4-1800", 0 ),
75 PCI_ROM( 0x14e4, 0x1801,
"14e4-1801",
"14e4-1801", 0 ),
76 PCI_ROM( 0x14e4, 0x1802,
"14e4-1802",
"14e4-1802", 0 ),
77 PCI_ROM( 0x14e4, 0x1803,
"14e4-1803",
"14e4-1803", 0 ),
78 PCI_ROM( 0x14e4, 0x1804,
"14e4-1804",
"14e4-1804", 0 ),
79 PCI_ROM( 0x14e4, 0x1805,
"14e4-1805",
"14e4-1805", 0 ),
84 PCI_ROM( 0x14e4, 0xd802,
"14e4-D802",
"14e4-D802", 0 ),
85 PCI_ROM( 0x14e4, 0xd804,
"14e4-D804",
"14e4-D804", 0 ),
101 DBGP (
"%s\n", __func__ );
118 unsigned long reg_base, reg_size;
129 DBGP (
"%s\n", __func__ );
139 &
bp->subsystem_vendor );
144 &
bp->subsystem_device );
167 DBGP (
"%s\n", __func__ );
170 DBGP (
"- %s ( ): Failed\n", __func__ );
205 off = (
void * ) (
bp->bar1 );
219 (
u32 )
bp->nq.epoch, 0 );
245 (
u32 )
bp->rx.epoch, 0 );
256 (
u32 )
bp->tx.epoch, 0 );
266 char *
src = (
char * )iob->
data;
314 if ( rx_vlan ==
bp->vlan_tx )
317 if ( rx_vlan ==
bp->vlan_id )
319 if ( rx_vlan && !
bp->vlan_id )
323 if ( !
bp->vlan_tx && !
bp->vlan_id )
339 return ( avail-use );
350 else if (
len < 1024 )
352 else if (
len < 2048 )
367 iob =
bp->tx.iob[hw_idx];
379 DBGP (
"%s\n", __func__ );
383 for ( i = 0; i <
bp->rx.buf_cnt; i++ ) {
384 if (
bp->rx.iob[i] ) {
414 DBGP (
"- %s ( ): alloc_iob Failed\n", __func__ );
421 bp->rx.iob[iob_idx] = iob;
427 u16 cons_id = (
bp->rx.cons_id %
bp->rx.ring_cnt );
430 while (
bp->rx.iob_cnt <
bp->rx.buf_cnt ) {
431 iob_idx = ( cons_id %
bp->rx.buf_cnt );
432 if ( !
bp->rx.iob[iob_idx] ) {
438 cons_id =
NEXT_IDX ( cons_id,
bp->rx.ring_cnt );
440 if ( iob_idx > cons_id )
445 if ( cons_id !=
bp->rx.cons_id ) {
447 bp->rx.cons_id = cons_id;
462 u16 err_flags, rx_vlan;
463 u8 ignore_chksum_err = 0;
472 ignore_chksum_err = 1;
474 if ( err_flags && !ignore_chksum_err ) {
479 for ( i = 0; i < 6; i++ ) {
480 if ( rx_buf[6 + i] !=
bp->mac_addr[i] )
509 cons_id =
bp->cq.cons_id + cnt;
510 if ( cons_id >=
bp->cq.ring_cnt) {
512 bp->cq.completion_bit ^= 1;
514 cons_id = cons_id -
bp->cq.ring_cnt;
516 bp->cq.cons_id = cons_id;
536 bp->rx.iob[desc_idx] =
NULL;
548 u8 cmpl_bit =
bp->cq.completion_bit;
550 if (
bp->cq.cons_id == (
bp->cq.ring_cnt - 1 ) ) {
565 DBGP (
"%s\n", __func__ );
586 DBGP (
"%s\n", __func__ );
592 bp->nq.completion_bit = 0x1;
596 bp->cq.completion_bit = 0x1;
618 DBGP (
"%s\n", __func__ );
619 if (
bp->nq.bd_virt ) {
624 if (
bp->cq.bd_virt ) {
629 if (
bp->rx.bd_virt ) {
634 if (
bp->tx.bd_virt ) {
639 if (
bp->hwrm_addr_dma ) {
641 bp->dma_addr_mapping = 0;
645 if (
bp->hwrm_addr_resp ) {
647 bp->resp_addr_mapping = 0;
648 bp->hwrm_addr_resp =
NULL;
651 if (
bp->hwrm_addr_req ) {
653 bp->req_addr_mapping = 0;
656 DBGP (
"- %s ( ): - Done\n", __func__ );
661 DBGP (
"%s\n", __func__ );
671 bp->hwrm_addr_resp &&
681 DBGP (
"- %s ( ): Failed\n", __func__ );
700 for ( i = 0; i < cnt; i++ ) {
724 struct input *req = (
struct input * )
bp->hwrm_addr_req;
726 u8 *ptr = (
u8 * )resp;
732 if (
len >
bp->hwrm_max_req_len )
737 for ( idx = 0; idx < wait_cnt; idx++ ) {
738 resp_len = resp->resp_len;
741 ptr[resp_len - 1] == 1 ) {
742 bp->last_resp_code = resp->error_code;
743 ret = resp->error_code;
759 DBGP (
"%s\n", __func__ );
775 if ( !
bp->hwrm_cmd_timeout )
810 DBGP (
"%s\n", __func__ );
870 DBGP (
"%s\n", __func__ );
878 bp->num_cmpl_rings =
bp->min_cp_rings;
881 bp->num_tx_rings =
bp->min_tx_rings;
884 bp->num_rx_rings =
bp->min_rx_rings;
887 bp->num_hw_ring_grps =
bp->min_hw_ring_grps;
890 bp->num_stat_ctxs =
bp->min_stat_ctxs;
906 DBGP (
"%s\n", __func__ );
926 DBGP (
"%s\n", __func__ );
936 DBGP (
"- %s ( ): Failed\n", __func__ );
956 DBGP (
"%s\n", __func__ );
963 DBGP (
"- %s ( ): Failed\n", __func__ );
974 bp->ordinal_value = (
u8 )resp->
pci_id & 0x0F;
997 DBGP (
"%s\n", __func__ );
1004 DBGP (
"-s %s ( ): Failed\n", __func__ );
1019 DBGP (
"%s\n", __func__ );
1033 DBGP (
"%s\n", __func__ );
1049 return wait_resp (
bp,
bp->hwrm_cmd_timeout, cmd_len, __func__ );
1058 DBGP (
"%s\n", __func__ );
1073 DBGP (
"- %s ( ): Failed\n", __func__ );
1087 DBGP (
"%s\n", __func__ );
1107 DBGP (
"%s\n", __func__ );
1109 idx =
bp->nq_ring_id;
1111 idx =
bp->cq_ring_id;
1149 DBGP (
"%s\n", __func__ );
1162 memcpy ( (
char * )&req->l2_addr[0], (
char * )&
bp->mac_addr[0],
1170 req->src_id = (
u32 )
bp->port_idx;
1171 req->dst_id =
bp->vnic_id;
1187 DBGP (
"%s\n", __func__ );
1197 DBGP (
"- %s ( ): Failed\n", __func__ );
1236 return wait_resp (
bp,
bp->hwrm_cmd_timeout, cmd_len, __func__ );
1246 DBGP (
"%s\n", __func__ );
1252 DBGP (
"- %s ( ): Failed\n", __func__ );
1284 DBGP (
"%s\n", __func__ );
1294 cmd_len, __func__ );
1299 u32 *ptr32 = (
u32 * )
bp->hwrm_addr_dma;
1301 DBGP (
"%s\n", __func__ );
1384 u32 *ptr32 = (
u32 * )
bp->hwrm_addr_dma;
1409 DBGP (
"VLAN MBA Enabled ( %d )\n",
1421 DBGP (
"%s\n", __func__ );
1428 return wait_resp (
bp,
bp->hwrm_cmd_timeout, cmd_len, __func__ );
1436 DBGP (
"%s\n", __func__ );
1455 DBGP (
"%s\n", __func__ );
1466 DBGP (
"- %s ( ): Failed\n", __func__ );
1479 DBGP (
"%s\n", __func__ );
1486 return wait_resp (
bp,
bp->hwrm_cmd_timeout, cmd_len, __func__ );
1504 DBGP (
"%s\n", __func__ );
1625 req->port_id =
bp->port_idx;
1635 return wait_resp (
bp,
bp->hwrm_cmd_timeout, cmd_len, __func__ );
1642 DBGP (
"%s\n", __func__ );
1678 DBGP (
"%s\n", __func__ );
1680 for ( i = 0; i < (
bp->wait_link_timeout / 100 ); i++ ) {
1703 DBGP (
"%s\n", __func__ );
1709 DBGP (
"- %s ( ): Failed\n", __func__ );
1724 DBGP (
"%s\n", __func__ );
1733 DBGP (
"- %s ( ): Failed\n", __func__ );
1747 DBGP (
"%s\n", __func__ );
1756 DBGP (
"- %s ( ): Failed\n", __func__ );
1771 DBGP (
"%s\n", __func__ );
1778 req->cr =
bp->cq_ring_id;
1779 req->rr =
bp->rx_ring_id;
1782 req->sc =
bp->stat_ctx_id;
1786 DBGP (
"- %s ( ): Failed\n", __func__ );
1800 DBGP (
"%s\n", __func__ );
1805 return wait_resp (
bp,
bp->hwrm_cmd_timeout, cmd_len, __func__ );
1815 DBGP (
"%s\n", __func__ );
1819 req->ring_type =
type;
1824 req->length = (
u32 )
bp->nq.ring_cnt;
1825 req->logical_id = 0xFFFF;
1831 req->length = (
u32 )
bp->cq.ring_cnt;
1836 req->nq_ring_id =
bp->nq_ring_id;
1837 req->cq_handle = (
u64 )
bp->nq_ring_id;
1842 req->length = (
u32 )
bp->tx.ring_cnt;
1844 req->stat_ctx_id = (
u32 )
bp->stat_ctx_id;
1845 req->cmpl_ring_id =
bp->cq_ring_id;
1851 req->length = (
u32 )
bp->rx.ring_cnt;
1853 req->cmpl_ring_id =
bp->cq_ring_id;
1866 DBGP (
"- %s ( ): Failed, type = %x\n", __func__,
type );
1888 DBGP (
"%s\n", __func__ );
1894 DBGP (
"%s\n", __func__ );
1900 DBGP (
"%s\n", __func__ );
1908 DBGP (
"%s\n", __func__ );
1923 DBGP (
"%s\n", __func__ );
1938 DBGP (
"%s\n", __func__ );
1963 DBGP (
"%s\n", __func__ );
1981 DBGP (
"%s\n", __func__ );
1988 DBGP (
"- %s ( ): Failed\n", __func__ );
2003 DBGP (
"%s\n", __func__ );
2012 DBGP (
"- %s ( ): Failed\n", __func__ );
2025 DBGP (
"%s\n", __func__ );
2043 return wait_resp (
bp,
bp->hwrm_cmd_timeout, cmd_len, __func__ );
2118 for ( ptr = cmds; *ptr; ++ptr ) {
2121 ret = ( *ptr ) (
bp );
2123 DBGP (
"- %s ( ): Failed\n", __func__ );
2130 #define bnxt_down_chip( bp ) bnxt_hwrm_run ( bring_down_chip, bp ) 2131 #define bnxt_up_chip( bp ) bnxt_hwrm_run ( bring_up_chip, bp ) 2132 #define bnxt_down_nic( bp ) bnxt_hwrm_run ( bring_down_nic, bp ) 2133 #define bnxt_up_nic( bp ) bnxt_hwrm_run ( bring_up_nic, bp ) 2139 DBGP (
"%s\n", __func__ );
2149 if ( !
bp->vlan_tx &&
bp->vlan_id )
2153 if (
iob_len ( iob ) != prev_len )
2167 DBGP (
"- %s ( ): Failed no bd's available\n", __func__ );
2172 entry =
bp->tx.prod_id;
2175 bp->tx.iob[entry] = iob;
2179 if (
bp->tx.prod_id > entry )
2184 bp->tx.prod_id = entry;
2195 cons_id =
bp->nq.cons_id + cnt;
2196 if ( cons_id >=
bp->nq.ring_cnt ) {
2198 bp->nq.completion_bit ^= 1;
2200 cons_id = cons_id -
bp->nq.ring_cnt;
2202 bp->nq.cons_id = cons_id;
2226 u16 old_cid =
bp->cq.cons_id;
2242 switch ( cq_type ) {
2266 if (
bp->cq.cons_id != old_cid )
2274 u16 old_cid =
bp->nq.cons_id;
2283 bp->nq.cons_id, sizeof (
struct nq_base ) );
2284 if ( ( nqp->
v &
NQ_CN_V ) ^
bp->nq.completion_bit )
2291 switch ( nq_type ) {
2305 if (
bp->nq.cons_id != old_cid )
2320 DBGP (
"%s\n", __func__ );
2346 DBGP (
"%s\n", __func__ );
2350 DBGP (
"- %s ( ): alloc_etherdev Failed\n", __func__ );
2378 DBGP (
"- %s ( ): bnxt_alloc_mem Failed\n", __func__ );
2384 DBGP (
"- %s ( ): bnxt_up_chip Failed\n", __func__ );
2390 DBGP (
"- %s ( ): register_netdev Failed\n", __func__ );
2415 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 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 MEDIUM_SPEED_100PAM4_112GBPS
#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)
#define RX_PKT_V3_CMPL_TYPE_MASK
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 LINK_SPEED_FW_200G_PAM4_112
#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
#define PORT_PHY_CFG_REQ_FORCE_LINK_SPEEDS2_25GB
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 NQ_CN_TOGGLE_MASK
#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_FW_10G
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
#define RX_PKT_V3_CMPL_HI_METADATA0_VID_MASK
#define PORT_PHY_CFG_REQ_FORCE_LINK_SPEEDS2_10GB
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 PORT_PHY_CFG_REQ_FORCE_LINK_SPEEDS2_400GB_PAM4_56
uint64_t desc
Microcode descriptor list physical address.
#define RING_FREE(bp, rid, flag)
#define PORT_PHY_CFG_REQ_ENABLES_AUTO_LINK_SPEED_MASK
#define MEDIUM_SPEED_200PAM4_112GBPS
#define LINK_POLL_WAIT_TIME
#define CMPL_BASE_TYPE_RX_L2_V3
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 LINK_SPEED_FW_100G_PAM4_112
#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 BNXT_FLAG_IS_CHIP_P5
#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)
uint32_t data_len
Microcode data size (or 0 to indicate 2000 bytes)
#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 PORT_PHY_CFG_REQ_FORCE_PAM4_LINK_SPEED_200GB
#define MEDIUM_SPEED_10GBPS
#define LINK_SPEED_FW_50G_PAM4
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
#define LINK_SPEED_FW_25G
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.
#define RX_PKT_V3_CMPL_TYPE_RX_L2_V3
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_FW_400G_PAM4_112
void * memcpy(void *dest, const void *src, size_t len) __nonnull
#define PORT_PHY_CFG_REQ_FORCE_LINK_SPEEDS2_200GB_PAM4_112
int bnxt_alloc_mem(struct bnxt *bp)
#define PORT_PHY_CFG_REQ_AUTO_PAUSE_RX
#define NO_MORE_NQ_BD_TO_SERVICE
#define PORT_PHY_CFG_REQ_FORCE_LINK_SPEEDS2_100GB_PAM4_56
static int bnxt_hwrm_port_phy_qcaps_req(struct bnxt *bp)
#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.
#define LINK_SPEED_FW_AUTONEG
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 LINK_SPEED_FW_40G
#define bnxt_down_nic(bp)
void udelay(unsigned long usecs)
Delay for a fixed number of microseconds.
#define PORT_PHY_CFG_REQ_ENABLES_FORCE_PAM4_LINK_SPEED
static int bnxt_hwrm_set_async_event(struct bnxt *bp)
#define BNXT_DMA_ALIGNMENT
static struct net_device * netdev
#define LINK_SPEED_FW_MASK
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 PORT_PHY_QCAPS_RESP_FLAGS2_SPEEDS2_SUPPORTED
#define PORT_PHY_CFG_REQ_FORCE_LINK_SPEEDS2_200GB_PAM4_56
#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 void dev_p5_db(struct bnxt *bp, u32 idx, u32 xid, u32 flag)
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)
#define LINK_SPEED_FW_50G
hwrm_func_t bring_up_chip[]
static void dev_p7_db(struct bnxt *bp, u32 idx, u32 xid, u32 flag, u32 epoch, u32 toggle)
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
#define VNIC_CFG_REQ_ENABLES_DEFAULT_RX_RING_ID
#define PORT_PHY_CFG_REQ_FORCE_PAM4_LINK_SPEED_100GB
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)
#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 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.
u8 bnxt_rx_drop(struct bnxt *bp, struct io_buffer *iob, struct rx_pkt_cmpl *rx_cmp, struct rx_pkt_cmpl_hi *rx_cmp_hi, u16 rx_len)
#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 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_SPEEDS2_100GB_PAM4_112
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)
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 PORT_PHY_CFG_REQ_FORCE_LINK_SPEED_50GB
#define MEDIUM_SPEED_50PAM4GBPS
#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 dump_cq(cq, id, toggle)
#define CMPL_BASE_TYPE_STAT_EJECT
#define MEDIUM_SPEED_100PAM4GBPS
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 LINK_SPEED_FW_2_5G
#define BNXT_FLAG_LINK_SPEEDS2
#define PORT_PHY_CFG_REQ_FORCE_LINK_SPEEDS2_40GB
#define HWRM_NVM_GET_VARIABLE
#define PORT_PHY_CFG_REQ_FORCE_PAM4_LINK_SPEED_50GB
#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 RX_PKT_V3_CMPL_HI_FLAGS2_META_FORMAT_ACT_REC_PTR
#define dbg_fw_ver(resp, tmo)
#define ENOBUFS
No buffer space available.
#define MEDIUM_FULL_DUPLEX
#define MEDIUM_SPEED_400PAM4_112GBPS
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
static u16 bnxt_get_rx_vlan(struct rx_pkt_cmpl *rx_cmp, struct rx_pkt_cmpl_hi *rx_cmp_hi)
void * data
Start of data.
static int bnxt_hwrm_vnic_alloc(struct bnxt *bp)
#define PORT_PHY_CFG_REQ_ENABLES_FORCE_LINK_SPEEDS2
#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 LINK_SPEED_FW_100G
#define PORT_PHY_CFG_REQ_ENABLES_AUTO_LINK_SPEEDS2_MASK
#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 LINK_SPEED_FW_200G
#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)
static int bnxt_hwrm_func_qcfg_req(struct bnxt *bp)
#define BNXT_FLAG_IS_CHIP_P7
#define SERVICE_NEXT_CQ_BD
#define DBC_MSG_TOGGLE(idx)
#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 PORT_PHY_CFG_REQ_FORCE_LINK_SPEEDS2_100GB
static u16 bnxt_get_pkt_vlan(char *src)
void mb(void)
Memory barrier.
#define dbg_link_status(bp)
#define DBC_MSG_EPCH(idx)
#define RX_DOORBELL_KEY_RX
#define RING_ALLOC_REQ_RING_TYPE_L2_CMPL
#define PCI_SUBSYSTEM_VENDOR_ID
PCI subsystem vendor ID.
#define RX_PKT_V3_CMPL_HI_ERRORS_BUFFER_ERROR_SFT
#define BNXT_FLAG_HWRM_SHORT_CMD_SUPP
#define dbg_num_rings(bp)
#define MEDIUM_SPEED_40GBPS
#define PORT_PHY_CFG_REQ_FORCE_LINK_SPEEDS2_50GB_PAM4_56
#define LINK_SPEED_FW_400G_PAM4
#define TX_DOORBELL_KEY_TX
#define dbg_link_state(bp, tmo)
#define FUNC_CFG_PRE_BOOT_MBA_VLAN_NUM
uint32_t flag
Flag number.
#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.
#define LINK_SPEED_FW_100G_PAM4
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 PORT_PHY_CFG_REQ_FORCE_LINK_SPEEDS2_50GB
#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 MEDIUM_SPEED_400PAM4GBPS
#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
#define PORT_PHY_CFG_REQ_FORCE_LINK_SPEEDS2_400GB_PAM4_112
#define HWRM_PORT_PHY_QCAPS
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
#define BNXT_FLAG_IS_CHIP_P5_PLUS
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)
static void bnxt_db_cq(struct bnxt *bp)