1004b26b8SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */ 2577ae39dSJitendra Kalsaria /* 3577ae39dSJitendra Kalsaria * QLogic qlcnic NIC Driver 4577ae39dSJitendra Kalsaria * Copyright (c) 2009-2013 QLogic Corporation 5577ae39dSJitendra Kalsaria */ 6577ae39dSJitendra Kalsaria 77f966452SSony Chacko #ifndef __QLCNIC_83XX_HW_H 87f966452SSony Chacko #define __QLCNIC_83XX_HW_H 97f966452SSony Chacko 107f966452SSony Chacko #include <linux/types.h> 117f966452SSony Chacko #include <linux/etherdevice.h> 12a930a463SHarish Patil 137f966452SSony Chacko #include "qlcnic_hw.h" 147f966452SSony Chacko 15a520030eSHimanshu Madhani #define QLCNIC_83XX_BAR0_LENGTH 0x4000 16a520030eSHimanshu Madhani 177f966452SSony Chacko /* Directly mapped registers */ 187f966452SSony Chacko #define QLC_83XX_CRB_WIN_BASE 0x3800 197f966452SSony Chacko #define QLC_83XX_CRB_WIN_FUNC(f) (QLC_83XX_CRB_WIN_BASE+((f)*4)) 207f966452SSony Chacko #define QLC_83XX_SEM_LOCK_BASE 0x3840 217f966452SSony Chacko #define QLC_83XX_SEM_UNLOCK_BASE 0x3844 227f966452SSony Chacko #define QLC_83XX_SEM_LOCK_FUNC(f) (QLC_83XX_SEM_LOCK_BASE+((f)*8)) 237f966452SSony Chacko #define QLC_83XX_SEM_UNLOCK_FUNC(f) (QLC_83XX_SEM_UNLOCK_BASE+((f)*8)) 247f966452SSony Chacko #define QLC_83XX_LINK_STATE(f) (0x3698+((f) > 7 ? 4 : 0)) 257f966452SSony Chacko #define QLC_83XX_LINK_SPEED(f) (0x36E0+(((f) >> 2) * 4)) 267f966452SSony Chacko #define QLC_83XX_LINK_SPEED_FACTOR 10 277f966452SSony Chacko #define QLC_83xx_FUNC_VAL(v, f) ((v) & (1 << (f * 4))) 287f966452SSony Chacko #define QLC_83XX_INTX_PTR 0x38C0 297f966452SSony Chacko #define QLC_83XX_INTX_TRGR 0x38C4 307f966452SSony Chacko #define QLC_83XX_INTX_MASK 0x38C8 317f966452SSony Chacko 327f966452SSony Chacko #define QLC_83XX_DRV_LOCK_WAIT_COUNTER 100 337f966452SSony Chacko #define QLC_83XX_DRV_LOCK_WAIT_DELAY 20 347f966452SSony Chacko #define QLC_83XX_NEED_DRV_LOCK_RECOVERY 1 357f966452SSony Chacko #define QLC_83XX_DRV_LOCK_RECOVERY_IN_PROGRESS 2 367f966452SSony Chacko #define QLC_83XX_MAX_DRV_LOCK_RECOVERY_ATTEMPT 3 377f966452SSony Chacko #define QLC_83XX_DRV_LOCK_RECOVERY_DELAY 200 387f966452SSony Chacko #define QLC_83XX_DRV_LOCK_RECOVERY_STATUS_MASK 0x3 392c4a7878SJitendra Kalsaria #define QLC_83XX_LB_WAIT_COUNT 250 402c4a7878SJitendra Kalsaria #define QLC_83XX_LB_MSLEEP_COUNT 20 417f966452SSony Chacko #define QLC_83XX_NO_NIC_RESOURCE 0x5 427f966452SSony Chacko #define QLC_83XX_MAC_PRESENT 0xC 437f966452SSony Chacko #define QLC_83XX_MAC_ABSENT 0xD 447f966452SSony Chacko 457f966452SSony Chacko 467f966452SSony Chacko #define QLC_83XX_FLASH_SECTOR_SIZE (64 * 1024) 477f966452SSony Chacko 487f966452SSony Chacko /* PEG status definitions */ 497f966452SSony Chacko #define QLC_83XX_CMDPEG_COMPLETE 0xff01 507f966452SSony Chacko #define QLC_83XX_VALID_INTX_BIT30(val) ((val) & BIT_30) 517f966452SSony Chacko #define QLC_83XX_VALID_INTX_BIT31(val) ((val) & BIT_31) 527f966452SSony Chacko #define QLC_83XX_INTX_FUNC(val) ((val) & 0xFF) 537f966452SSony Chacko #define QLC_83XX_LEGACY_INTX_MAX_RETRY 100 547f966452SSony Chacko #define QLC_83XX_LEGACY_INTX_DELAY 4 557f966452SSony Chacko #define QLC_83XX_REG_DESC 1 567f966452SSony Chacko #define QLC_83XX_LRO_DESC 2 577f966452SSony Chacko #define QLC_83XX_CTRL_DESC 3 587f966452SSony Chacko #define QLC_83XX_FW_CAPABILITY_TSO BIT_6 597f966452SSony Chacko #define QLC_83XX_FW_CAP_LRO_MSS BIT_17 607f966452SSony Chacko #define QLC_83XX_HOST_RDS_MODE_UNIQUE 0 617f966452SSony Chacko #define QLC_83XX_HOST_SDS_MBX_IDX 8 627f966452SSony Chacko 637f966452SSony Chacko #define QLCNIC_HOST_RDS_MBX_IDX 88 647f966452SSony Chacko 65629263acSSony Chacko /* Pause control registers */ 66629263acSSony Chacko #define QLC_83XX_SRE_SHIM_REG 0x0D200284 67629263acSSony Chacko #define QLC_83XX_PORT0_THRESHOLD 0x0B2003A4 68629263acSSony Chacko #define QLC_83XX_PORT1_THRESHOLD 0x0B2013A4 69629263acSSony Chacko #define QLC_83XX_PORT0_TC_MC_REG 0x0B200388 70629263acSSony Chacko #define QLC_83XX_PORT1_TC_MC_REG 0x0B201388 71629263acSSony Chacko #define QLC_83XX_PORT0_TC_STATS 0x0B20039C 72629263acSSony Chacko #define QLC_83XX_PORT1_TC_STATS 0x0B20139C 73629263acSSony Chacko #define QLC_83XX_PORT2_IFB_THRESHOLD 0x0B200704 74629263acSSony Chacko #define QLC_83XX_PORT3_IFB_THRESHOLD 0x0B201704 75629263acSSony Chacko 76629263acSSony Chacko /* Peg PC status registers */ 77629263acSSony Chacko #define QLC_83XX_CRB_PEG_NET_0 0x3400003c 78629263acSSony Chacko #define QLC_83XX_CRB_PEG_NET_1 0x3410003c 79629263acSSony Chacko #define QLC_83XX_CRB_PEG_NET_2 0x3420003c 80629263acSSony Chacko #define QLC_83XX_CRB_PEG_NET_3 0x3430003c 81629263acSSony Chacko #define QLC_83XX_CRB_PEG_NET_4 0x34b0003c 82629263acSSony Chacko 83629263acSSony Chacko /* Firmware image definitions */ 84629263acSSony Chacko #define QLC_83XX_BOOTLOADER_FLASH_ADDR 0x10000 85629263acSSony Chacko #define QLC_83XX_FW_FILE_NAME "83xx_fw.bin" 863ced0a88SShahed Shaikh #define QLC_83XX_POST_FW_FILE_NAME "83xx_post_fw.bin" 87fef349ceSPratik Pujar #define QLC_84XX_FW_FILE_NAME "84xx_fw.bin" 88629263acSSony Chacko #define QLC_83XX_BOOT_FROM_FLASH 0 89629263acSSony Chacko #define QLC_83XX_BOOT_FROM_FILE 0x12345678 90629263acSSony Chacko 91fef349ceSPratik Pujar #define QLC_FW_FILE_NAME_LEN 20 9281d0aeb0SSony Chacko #define QLC_83XX_MAX_RESET_SEQ_ENTRIES 16 9381d0aeb0SSony Chacko 94e5c4e6c6SManish Chopra #define QLC_83XX_MBX_POST_BC_OP 0x1 95e5c4e6c6SManish Chopra #define QLC_83XX_MBX_COMPLETION 0x0 96e5c4e6c6SManish Chopra #define QLC_83XX_MBX_REQUEST 0x1 97e5c4e6c6SManish Chopra 98e5c4e6c6SManish Chopra #define QLC_83XX_MBX_TIMEOUT (5 * HZ) 99e5c4e6c6SManish Chopra #define QLC_83XX_MBX_CMD_LOOP 5000000 100e5c4e6c6SManish Chopra 1017cb03b23SRajesh Borundia /* status descriptor mailbox data 1027cb03b23SRajesh Borundia * @phy_addr_{low|high}: physical address of buffer 1037cb03b23SRajesh Borundia * @sds_ring_size: buffer size 1047cb03b23SRajesh Borundia * @intrpt_id: interrupt id 1057cb03b23SRajesh Borundia * @intrpt_val: source of interrupt 1067cb03b23SRajesh Borundia */ 1077cb03b23SRajesh Borundia struct qlcnic_sds_mbx { 1087cb03b23SRajesh Borundia u32 phy_addr_low; 1097cb03b23SRajesh Borundia u32 phy_addr_high; 1107cb03b23SRajesh Borundia u32 rsvd1[4]; 1117cb03b23SRajesh Borundia #if defined(__LITTLE_ENDIAN) 1127cb03b23SRajesh Borundia u16 sds_ring_size; 1137cb03b23SRajesh Borundia u16 rsvd2; 1147cb03b23SRajesh Borundia u16 rsvd3[2]; 1157cb03b23SRajesh Borundia u16 intrpt_id; 1167cb03b23SRajesh Borundia u8 intrpt_val; 1177cb03b23SRajesh Borundia u8 rsvd4; 1187cb03b23SRajesh Borundia #elif defined(__BIG_ENDIAN) 1197cb03b23SRajesh Borundia u16 rsvd2; 1207cb03b23SRajesh Borundia u16 sds_ring_size; 1217cb03b23SRajesh Borundia u16 rsvd3[2]; 1227cb03b23SRajesh Borundia u8 rsvd4; 1237cb03b23SRajesh Borundia u8 intrpt_val; 1247cb03b23SRajesh Borundia u16 intrpt_id; 1257cb03b23SRajesh Borundia #endif 1267cb03b23SRajesh Borundia u32 rsvd5; 1277cb03b23SRajesh Borundia } __packed; 1287cb03b23SRajesh Borundia 1297cb03b23SRajesh Borundia /* receive descriptor buffer data 1307cb03b23SRajesh Borundia * phy_addr_reg_{low|high}: physical address of regular buffer 1317cb03b23SRajesh Borundia * phy_addr_jmb_{low|high}: physical address of jumbo buffer 1327cb03b23SRajesh Borundia * reg_ring_sz: size of regular buffer 1337cb03b23SRajesh Borundia * reg_ring_len: no. of entries in regular buffer 1347cb03b23SRajesh Borundia * jmb_ring_len: no. of entries in jumbo buffer 1357cb03b23SRajesh Borundia * jmb_ring_sz: size of jumbo buffer 1367cb03b23SRajesh Borundia */ 1377cb03b23SRajesh Borundia struct qlcnic_rds_mbx { 1387cb03b23SRajesh Borundia u32 phy_addr_reg_low; 1397cb03b23SRajesh Borundia u32 phy_addr_reg_high; 1407cb03b23SRajesh Borundia u32 phy_addr_jmb_low; 1417cb03b23SRajesh Borundia u32 phy_addr_jmb_high; 1427cb03b23SRajesh Borundia #if defined(__LITTLE_ENDIAN) 1437cb03b23SRajesh Borundia u16 reg_ring_sz; 1447cb03b23SRajesh Borundia u16 reg_ring_len; 1457cb03b23SRajesh Borundia u16 jmb_ring_sz; 1467cb03b23SRajesh Borundia u16 jmb_ring_len; 1477cb03b23SRajesh Borundia #elif defined(__BIG_ENDIAN) 1487cb03b23SRajesh Borundia u16 reg_ring_len; 1497cb03b23SRajesh Borundia u16 reg_ring_sz; 1507cb03b23SRajesh Borundia u16 jmb_ring_len; 1517cb03b23SRajesh Borundia u16 jmb_ring_sz; 1527cb03b23SRajesh Borundia #endif 1537cb03b23SRajesh Borundia } __packed; 1547cb03b23SRajesh Borundia 1557cb03b23SRajesh Borundia /* host producers for regular and jumbo rings */ 1567cb03b23SRajesh Borundia struct __host_producer_mbx { 1577cb03b23SRajesh Borundia u32 reg_buf; 1587cb03b23SRajesh Borundia u32 jmb_buf; 1597cb03b23SRajesh Borundia } __packed; 1607cb03b23SRajesh Borundia 1617cb03b23SRajesh Borundia /* Receive context mailbox data outbox registers 1627cb03b23SRajesh Borundia * @state: state of the context 1637cb03b23SRajesh Borundia * @vport_id: virtual port id 1647cb03b23SRajesh Borundia * @context_id: receive context id 1657cb03b23SRajesh Borundia * @num_pci_func: number of pci functions of the port 1667cb03b23SRajesh Borundia * @phy_port: physical port id 1677cb03b23SRajesh Borundia */ 1687cb03b23SRajesh Borundia struct qlcnic_rcv_mbx_out { 1697cb03b23SRajesh Borundia #if defined(__LITTLE_ENDIAN) 1707cb03b23SRajesh Borundia u8 rcv_num; 1717cb03b23SRajesh Borundia u8 sts_num; 1727cb03b23SRajesh Borundia u16 ctx_id; 1737cb03b23SRajesh Borundia u8 state; 1747cb03b23SRajesh Borundia u8 num_pci_func; 1757cb03b23SRajesh Borundia u8 phy_port; 1767cb03b23SRajesh Borundia u8 vport_id; 1777cb03b23SRajesh Borundia #elif defined(__BIG_ENDIAN) 1787cb03b23SRajesh Borundia u16 ctx_id; 1797cb03b23SRajesh Borundia u8 sts_num; 1807cb03b23SRajesh Borundia u8 rcv_num; 1817cb03b23SRajesh Borundia u8 vport_id; 1827cb03b23SRajesh Borundia u8 phy_port; 1837cb03b23SRajesh Borundia u8 num_pci_func; 1847cb03b23SRajesh Borundia u8 state; 1857cb03b23SRajesh Borundia #endif 18634e8c406SHimanshu Madhani u32 host_csmr[QLCNIC_MAX_SDS_RINGS]; 18734e8c406SHimanshu Madhani struct __host_producer_mbx host_prod[QLCNIC_MAX_SDS_RINGS]; 1887cb03b23SRajesh Borundia } __packed; 1897cb03b23SRajesh Borundia 1907cb03b23SRajesh Borundia struct qlcnic_add_rings_mbx_out { 1917cb03b23SRajesh Borundia #if defined(__LITTLE_ENDIAN) 1927cb03b23SRajesh Borundia u8 rcv_num; 1937cb03b23SRajesh Borundia u8 sts_num; 1947cb03b23SRajesh Borundia u16 ctx_id; 1957cb03b23SRajesh Borundia #elif defined(__BIG_ENDIAN) 1967cb03b23SRajesh Borundia u16 ctx_id; 1977cb03b23SRajesh Borundia u8 sts_num; 1987cb03b23SRajesh Borundia u8 rcv_num; 1997cb03b23SRajesh Borundia #endif 20034e8c406SHimanshu Madhani u32 host_csmr[QLCNIC_MAX_SDS_RINGS]; 20134e8c406SHimanshu Madhani struct __host_producer_mbx host_prod[QLCNIC_MAX_SDS_RINGS]; 2027cb03b23SRajesh Borundia } __packed; 2037cb03b23SRajesh Borundia 2047cb03b23SRajesh Borundia /* Transmit context mailbox inbox registers 2057cb03b23SRajesh Borundia * @phys_addr_{low|high}: DMA address of the transmit buffer 2067cb03b23SRajesh Borundia * @cnsmr_index_{low|high}: host consumer index 2077cb03b23SRajesh Borundia * @size: legth of transmit buffer ring 208dbedd44eSJoe Perches * @intr_id: interrupt id 2097cb03b23SRajesh Borundia * @src: src of interrupt 2107cb03b23SRajesh Borundia */ 2117cb03b23SRajesh Borundia struct qlcnic_tx_mbx { 2127cb03b23SRajesh Borundia u32 phys_addr_low; 2137cb03b23SRajesh Borundia u32 phys_addr_high; 2147cb03b23SRajesh Borundia u32 cnsmr_index_low; 2157cb03b23SRajesh Borundia u32 cnsmr_index_high; 2167cb03b23SRajesh Borundia #if defined(__LITTLE_ENDIAN) 2177cb03b23SRajesh Borundia u16 size; 2187cb03b23SRajesh Borundia u16 intr_id; 2197cb03b23SRajesh Borundia u8 src; 2207cb03b23SRajesh Borundia u8 rsvd[3]; 2217cb03b23SRajesh Borundia #elif defined(__BIG_ENDIAN) 2227cb03b23SRajesh Borundia u16 intr_id; 2237cb03b23SRajesh Borundia u16 size; 2247cb03b23SRajesh Borundia u8 rsvd[3]; 2257cb03b23SRajesh Borundia u8 src; 2267cb03b23SRajesh Borundia #endif 2277cb03b23SRajesh Borundia } __packed; 2287cb03b23SRajesh Borundia 2297cb03b23SRajesh Borundia /* Transmit context mailbox outbox registers 2307cb03b23SRajesh Borundia * @host_prod: host producer index 2317cb03b23SRajesh Borundia * @ctx_id: transmit context id 2327cb03b23SRajesh Borundia * @state: state of the transmit context 2337cb03b23SRajesh Borundia */ 2347cb03b23SRajesh Borundia 2357cb03b23SRajesh Borundia struct qlcnic_tx_mbx_out { 2367cb03b23SRajesh Borundia u32 host_prod; 2377cb03b23SRajesh Borundia #if defined(__LITTLE_ENDIAN) 2387cb03b23SRajesh Borundia u16 ctx_id; 2397cb03b23SRajesh Borundia u8 state; 2407cb03b23SRajesh Borundia u8 rsvd; 2417cb03b23SRajesh Borundia #elif defined(__BIG_ENDIAN) 2427cb03b23SRajesh Borundia u8 rsvd; 2437cb03b23SRajesh Borundia u8 state; 2447cb03b23SRajesh Borundia u16 ctx_id; 2457cb03b23SRajesh Borundia #endif 2467cb03b23SRajesh Borundia } __packed; 2477cb03b23SRajesh Borundia 2487f966452SSony Chacko struct qlcnic_intrpt_config { 2497f966452SSony Chacko u8 type; 2507f966452SSony Chacko u8 enabled; 2517f966452SSony Chacko u16 id; 2527f966452SSony Chacko u32 src; 2537f966452SSony Chacko }; 2547f966452SSony Chacko 2557f966452SSony Chacko struct qlcnic_macvlan_mbx { 256a96227e6SShahed Shaikh #if defined(__LITTLE_ENDIAN) 257a96227e6SShahed Shaikh u8 mac_addr0; 258a96227e6SShahed Shaikh u8 mac_addr1; 259a96227e6SShahed Shaikh u8 mac_addr2; 260a96227e6SShahed Shaikh u8 mac_addr3; 261a96227e6SShahed Shaikh u8 mac_addr4; 262a96227e6SShahed Shaikh u8 mac_addr5; 2637f966452SSony Chacko u16 vlan; 264a96227e6SShahed Shaikh #elif defined(__BIG_ENDIAN) 265a96227e6SShahed Shaikh u8 mac_addr3; 266a96227e6SShahed Shaikh u8 mac_addr2; 267a96227e6SShahed Shaikh u8 mac_addr1; 268a96227e6SShahed Shaikh u8 mac_addr0; 269a96227e6SShahed Shaikh u16 vlan; 270a96227e6SShahed Shaikh u8 mac_addr5; 271a96227e6SShahed Shaikh u8 mac_addr4; 272a96227e6SShahed Shaikh #endif 2737f966452SSony Chacko }; 2747f966452SSony Chacko 275629263acSSony Chacko struct qlc_83xx_fw_info { 276629263acSSony Chacko const struct firmware *fw; 2777000078aSPratik Pujar char fw_file_name[QLC_FW_FILE_NAME_LEN]; 278629263acSSony Chacko }; 279629263acSSony Chacko 28081d0aeb0SSony Chacko struct qlc_83xx_reset { 28181d0aeb0SSony Chacko struct qlc_83xx_reset_hdr *hdr; 28281d0aeb0SSony Chacko int seq_index; 28381d0aeb0SSony Chacko int seq_error; 28481d0aeb0SSony Chacko int array_index; 28581d0aeb0SSony Chacko u32 array[QLC_83XX_MAX_RESET_SEQ_ENTRIES]; 28681d0aeb0SSony Chacko u8 *buff; 28781d0aeb0SSony Chacko u8 *stop_offset; 28881d0aeb0SSony Chacko u8 *start_offset; 28981d0aeb0SSony Chacko u8 *init_offset; 29081d0aeb0SSony Chacko u8 seq_end; 29181d0aeb0SSony Chacko u8 template_end; 29281d0aeb0SSony Chacko }; 29381d0aeb0SSony Chacko 294629263acSSony Chacko #define QLC_83XX_IDC_DISABLE_FW_RESET_RECOVERY 0x1 295629263acSSony Chacko #define QLC_83XX_IDC_GRACEFULL_RESET 0x2 296890b6e02SShahed Shaikh #define QLC_83XX_IDC_DISABLE_FW_DUMP 0x4 297629263acSSony Chacko #define QLC_83XX_IDC_TIMESTAMP 0 298629263acSSony Chacko #define QLC_83XX_IDC_DURATION 1 299629263acSSony Chacko #define QLC_83XX_IDC_INIT_TIMEOUT_SECS 30 300629263acSSony Chacko #define QLC_83XX_IDC_RESET_ACK_TIMEOUT_SECS 10 301629263acSSony Chacko #define QLC_83XX_IDC_RESET_TIMEOUT_SECS 10 302629263acSSony Chacko #define QLC_83XX_IDC_QUIESCE_ACK_TIMEOUT_SECS 20 303629263acSSony Chacko #define QLC_83XX_IDC_FW_POLL_DELAY (1 * HZ) 304629263acSSony Chacko #define QLC_83XX_IDC_FW_FAIL_THRESH 2 305629263acSSony Chacko #define QLC_83XX_IDC_MAX_FUNC_PER_PARTITION_INFO 8 306629263acSSony Chacko #define QLC_83XX_IDC_MAX_CNA_FUNCTIONS 16 307629263acSSony Chacko #define QLC_83XX_IDC_MAJOR_VERSION 1 308629263acSSony Chacko #define QLC_83XX_IDC_MINOR_VERSION 0 309629263acSSony Chacko #define QLC_83XX_IDC_FLASH_PARAM_ADDR 0x3e8020 310629263acSSony Chacko 311629263acSSony Chacko struct qlcnic_adapter; 312225837a0SShahed Shaikh struct qlcnic_fw_dump; 313225837a0SShahed Shaikh 314629263acSSony Chacko struct qlc_83xx_idc { 315629263acSSony Chacko int (*state_entry) (struct qlcnic_adapter *); 316629263acSSony Chacko u64 sec_counter; 317629263acSSony Chacko u64 delay; 318629263acSSony Chacko unsigned long status; 319629263acSSony Chacko int err_code; 320629263acSSony Chacko int collect_dump; 321629263acSSony Chacko u8 curr_state; 322629263acSSony Chacko u8 prev_state; 323629263acSSony Chacko u8 vnic_state; 324629263acSSony Chacko u8 vnic_wait_limit; 325629263acSSony Chacko u8 quiesce_req; 326099907faSSony Chacko u8 delay_reset; 327629263acSSony Chacko char **name; 328629263acSSony Chacko }; 3297f966452SSony Chacko 330154d0c81SManish Chopra enum qlcnic_vlan_operations { 331154d0c81SManish Chopra QLC_VLAN_ADD = 0, 332154d0c81SManish Chopra QLC_VLAN_DELETE 333154d0c81SManish Chopra }; 334154d0c81SManish Chopra 335f036e4f4SRajesh Borundia /* Device States */ 336f036e4f4SRajesh Borundia enum qlcnic_83xx_states { 337f036e4f4SRajesh Borundia QLC_83XX_IDC_DEV_UNKNOWN, 338f036e4f4SRajesh Borundia QLC_83XX_IDC_DEV_COLD, 339f036e4f4SRajesh Borundia QLC_83XX_IDC_DEV_INIT, 340f036e4f4SRajesh Borundia QLC_83XX_IDC_DEV_READY, 341f036e4f4SRajesh Borundia QLC_83XX_IDC_DEV_NEED_RESET, 342f036e4f4SRajesh Borundia QLC_83XX_IDC_DEV_NEED_QUISCENT, 343f036e4f4SRajesh Borundia QLC_83XX_IDC_DEV_FAILED, 344f036e4f4SRajesh Borundia QLC_83XX_IDC_DEV_QUISCENT 345f036e4f4SRajesh Borundia }; 346f036e4f4SRajesh Borundia 347483202d5SJitendra Kalsaria #define QLCNIC_MBX_RSP(reg) LSW(reg) 348483202d5SJitendra Kalsaria #define QLCNIC_MBX_NUM_REGS(reg) (MSW(reg) & 0x1FF) 349483202d5SJitendra Kalsaria #define QLCNIC_MBX_STATUS(reg) (((reg) >> 25) & 0x7F) 350483202d5SJitendra Kalsaria #define QLCNIC_MBX_HOST(ahw, i) ((ahw)->pci_base0 + ((i) * 4)) 351483202d5SJitendra Kalsaria #define QLCNIC_MBX_FW(ahw, i) ((ahw)->pci_base0 + 0x800 + ((i) * 4)) 352483202d5SJitendra Kalsaria 3537f966452SSony Chacko /* Mailbox process AEN count */ 3547f966452SSony Chacko #define QLC_83XX_IDC_COMP_AEN 3 3557f966452SSony Chacko #define QLC_83XX_MBX_AEN_CNT 5 3567f966452SSony Chacko #define QLC_83XX_MODULE_LOADED 1 3577f966452SSony Chacko #define QLC_83XX_MBX_READY 2 3587f966452SSony Chacko #define QLC_83XX_MBX_AEN_ACK 3 3597f966452SSony Chacko #define QLC_83XX_SFP_PRESENT(data) ((data) & 3) 3607f966452SSony Chacko #define QLC_83XX_SFP_ERR(data) (((data) >> 2) & 3) 3617f966452SSony Chacko #define QLC_83XX_SFP_MODULE_TYPE(data) (((data) >> 4) & 0x1F) 3627f966452SSony Chacko #define QLC_83XX_SFP_CU_LENGTH(data) (LSB((data) >> 16)) 3637f966452SSony Chacko #define QLC_83XX_SFP_TX_FAULT(data) ((data) & BIT_10) 3647f966452SSony Chacko #define QLC_83XX_LINK_STATS(data) ((data) & BIT_0) 3657f966452SSony Chacko #define QLC_83XX_CURRENT_LINK_SPEED(data) (((data) >> 3) & 7) 3667f966452SSony Chacko #define QLC_83XX_LINK_PAUSE(data) (((data) >> 6) & 3) 3677f966452SSony Chacko #define QLC_83XX_LINK_LB(data) (((data) >> 8) & 7) 3687f966452SSony Chacko #define QLC_83XX_LINK_FEC(data) ((data) & BIT_12) 3697f966452SSony Chacko #define QLC_83XX_LINK_EEE(data) ((data) & BIT_13) 3707f966452SSony Chacko #define QLC_83XX_DCBX(data) (((data) >> 28) & 7) 3717f966452SSony Chacko #define QLC_83XX_AUTONEG(data) ((data) & BIT_15) 3726177a95aSJitendra Kalsaria #define QLC_83XX_TX_PAUSE 0x10 3736177a95aSJitendra Kalsaria #define QLC_83XX_RX_PAUSE 0x20 3746177a95aSJitendra Kalsaria #define QLC_83XX_TX_RX_PAUSE 0x30 3757f966452SSony Chacko #define QLC_83XX_CFG_STD_PAUSE (1 << 5) 3767f966452SSony Chacko #define QLC_83XX_CFG_STD_TX_PAUSE (1 << 20) 3777f966452SSony Chacko #define QLC_83XX_CFG_STD_RX_PAUSE (2 << 20) 3787f966452SSony Chacko #define QLC_83XX_CFG_STD_TX_RX_PAUSE (3 << 20) 3797f966452SSony Chacko #define QLC_83XX_ENABLE_AUTONEG (1 << 15) 3807f966452SSony Chacko #define QLC_83XX_CFG_LOOPBACK_HSS (2 << 1) 3817f966452SSony Chacko #define QLC_83XX_CFG_LOOPBACK_PHY (3 << 1) 3827f966452SSony Chacko #define QLC_83XX_CFG_LOOPBACK_EXT (4 << 1) 3837f966452SSony Chacko 3847f966452SSony Chacko /* LED configuration settings */ 3857f966452SSony Chacko #define QLC_83XX_ENABLE_BEACON 0xe 386a0431589SHimanshu Madhani #define QLC_83XX_BEACON_ON 1 387a0431589SHimanshu Madhani #define QLC_83XX_BEACON_OFF 0 3887f966452SSony Chacko #define QLC_83XX_LED_RATE 0xff 3897f966452SSony Chacko #define QLC_83XX_LED_ACT (1 << 10) 3907f966452SSony Chacko #define QLC_83XX_LED_MOD (0 << 13) 3917f966452SSony Chacko #define QLC_83XX_LED_CONFIG (QLC_83XX_LED_RATE | QLC_83XX_LED_ACT | \ 3927f966452SSony Chacko QLC_83XX_LED_MOD) 3937f966452SSony Chacko 3947f966452SSony Chacko #define QLC_83XX_10M_LINK 1 3957f966452SSony Chacko #define QLC_83XX_100M_LINK 2 3967f966452SSony Chacko #define QLC_83XX_1G_LINK 3 3977f966452SSony Chacko #define QLC_83XX_10G_LINK 4 3987f966452SSony Chacko #define QLC_83XX_STAT_TX 3 3997f966452SSony Chacko #define QLC_83XX_STAT_RX 2 4007f966452SSony Chacko #define QLC_83XX_STAT_MAC 1 4017f966452SSony Chacko #define QLC_83XX_TX_STAT_REGS 14 4027f966452SSony Chacko #define QLC_83XX_RX_STAT_REGS 40 40352290740SShahed Shaikh #define QLC_83XX_MAC_STAT_REGS 94 4047f966452SSony Chacko 4057f966452SSony Chacko #define QLC_83XX_GET_FUNC_PRIVILEGE(VAL, FN) (0x3 & ((VAL) >> (FN * 2))) 4067f966452SSony Chacko #define QLC_83XX_SET_FUNC_OPMODE(VAL, FN) ((VAL) << (FN * 2)) 4077f966452SSony Chacko #define QLC_83XX_DEFAULT_OPMODE 0x55555555 4087f966452SSony Chacko #define QLC_83XX_PRIVLEGED_FUNC 0x1 4097f966452SSony Chacko #define QLC_83XX_VIRTUAL_FUNC 0x2 4107f966452SSony Chacko 4117f966452SSony Chacko #define QLC_83XX_LB_MAX_FILTERS 2048 4127f966452SSony Chacko #define QLC_83XX_LB_BUCKET_SIZE 256 4137f966452SSony Chacko #define QLC_83XX_MINIMUM_VECTOR 3 41452e493d0SJitendra Kalsaria #define QLC_83XX_MAX_MC_COUNT 38 41552e493d0SJitendra Kalsaria #define QLC_83XX_MAX_UC_COUNT 4096 4167f966452SSony Chacko 41758945e1bSManish Chopra #define QLC_83XX_PVID_STRIP_CAPABILITY BIT_22 4187f966452SSony Chacko #define QLC_83XX_GET_FUNC_MODE_FROM_NPAR_INFO(val) (val & 0x80000000) 4197f966452SSony Chacko #define QLC_83XX_GET_LRO_CAPABILITY(val) (val & 0x20) 4207f966452SSony Chacko #define QLC_83XX_GET_LSO_CAPABILITY(val) (val & 0x40) 4217f966452SSony Chacko #define QLC_83XX_GET_HW_LRO_CAPABILITY(val) (val & 0x400) 4227f966452SSony Chacko #define QLC_83XX_GET_VLAN_ALIGN_CAPABILITY(val) (val & 0x4000) 42399e85879SShahed Shaikh #define QLC_83XX_GET_FW_LRO_MSS_CAPABILITY(val) (val & 0x20000) 42435dafcb0SSony Chacko #define QLC_83XX_ESWITCH_CAPABILITY BIT_23 42502feda17SRajesh Borundia #define QLC_83XX_SRIOV_MODE 0x1 4267f966452SSony Chacko #define QLCNIC_BRDTYPE_83XX_10G 0x0083 4277f966452SSony Chacko 428d865ebb4SSony Chacko #define QLC_83XX_FLASH_SPI_STATUS 0x2808E010 429d865ebb4SSony Chacko #define QLC_83XX_FLASH_SPI_CONTROL 0x2808E014 430d865ebb4SSony Chacko #define QLC_83XX_FLASH_STATUS 0x42100004 431d865ebb4SSony Chacko #define QLC_83XX_FLASH_CONTROL 0x42110004 432d865ebb4SSony Chacko #define QLC_83XX_FLASH_ADDR 0x42110008 433d865ebb4SSony Chacko #define QLC_83XX_FLASH_WRDATA 0x4211000C 434d865ebb4SSony Chacko #define QLC_83XX_FLASH_RDDATA 0x42110018 435d865ebb4SSony Chacko #define QLC_83XX_FLASH_DIRECT_WINDOW 0x42110030 436d865ebb4SSony Chacko #define QLC_83XX_FLASH_DIRECT_DATA(DATA) (0x42150000 | (0x0000FFFF&DATA)) 437d865ebb4SSony Chacko #define QLC_83XX_FLASH_SECTOR_ERASE_CMD 0xdeadbeef 438d865ebb4SSony Chacko #define QLC_83XX_FLASH_WRITE_CMD 0xdacdacda 439d865ebb4SSony Chacko #define QLC_83XX_FLASH_BULK_WRITE_CMD 0xcadcadca 440d865ebb4SSony Chacko #define QLC_83XX_FLASH_READ_RETRY_COUNT 5000 441d865ebb4SSony Chacko #define QLC_83XX_FLASH_STATUS_READY 0x6 442a520030eSHimanshu Madhani #define QLC_83XX_FLASH_WRITE_MIN 2 443a520030eSHimanshu Madhani #define QLC_83XX_FLASH_WRITE_MAX 64 444d865ebb4SSony Chacko #define QLC_83XX_FLASH_STATUS_REG_POLL_DELAY 1 445d865ebb4SSony Chacko #define QLC_83XX_ERASE_MODE 1 446d865ebb4SSony Chacko #define QLC_83XX_WRITE_MODE 2 447d865ebb4SSony Chacko #define QLC_83XX_BULK_WRITE_MODE 3 448d865ebb4SSony Chacko #define QLC_83XX_FLASH_FDT_WRITE_DEF_SIG 0xFD0100 449d865ebb4SSony Chacko #define QLC_83XX_FLASH_FDT_ERASE_DEF_SIG 0xFD0300 450d865ebb4SSony Chacko #define QLC_83XX_FLASH_FDT_READ_MFG_ID_VAL 0xFD009F 451d865ebb4SSony Chacko #define QLC_83XX_FLASH_OEM_ERASE_SIG 0xFD03D8 452d865ebb4SSony Chacko #define QLC_83XX_FLASH_OEM_WRITE_SIG 0xFD0101 453d865ebb4SSony Chacko #define QLC_83XX_FLASH_OEM_READ_SIG 0xFD0005 454d865ebb4SSony Chacko #define QLC_83XX_FLASH_ADDR_TEMP_VAL 0x00800000 455d865ebb4SSony Chacko #define QLC_83XX_FLASH_ADDR_SECOND_TEMP_VAL 0x00800001 456d865ebb4SSony Chacko #define QLC_83XX_FLASH_WRDATA_DEF 0x0 457d865ebb4SSony Chacko #define QLC_83XX_FLASH_READ_CTRL 0x3F 458d865ebb4SSony Chacko #define QLC_83XX_FLASH_SPI_CTRL 0x4 459d865ebb4SSony Chacko #define QLC_83XX_FLASH_FIRST_ERASE_MS_VAL 0x2 460d865ebb4SSony Chacko #define QLC_83XX_FLASH_SECOND_ERASE_MS_VAL 0x5 461d865ebb4SSony Chacko #define QLC_83XX_FLASH_LAST_ERASE_MS_VAL 0x3D 462d865ebb4SSony Chacko #define QLC_83XX_FLASH_FIRST_MS_PATTERN 0x43 463d865ebb4SSony Chacko #define QLC_83XX_FLASH_SECOND_MS_PATTERN 0x7F 464d865ebb4SSony Chacko #define QLC_83XX_FLASH_LAST_MS_PATTERN 0x7D 465d865ebb4SSony Chacko #define QLC_83xx_FLASH_MAX_WAIT_USEC 100 466d865ebb4SSony Chacko #define QLC_83XX_FLASH_LOCK_TIMEOUT 10000 467d865ebb4SSony Chacko 468e5c4e6c6SManish Chopra enum qlc_83xx_mbx_cmd_type { 469e5c4e6c6SManish Chopra QLC_83XX_MBX_CMD_WAIT = 0, 470e5c4e6c6SManish Chopra QLC_83XX_MBX_CMD_NO_WAIT, 471e5c4e6c6SManish Chopra QLC_83XX_MBX_CMD_BUSY_WAIT, 472e5c4e6c6SManish Chopra }; 473e5c4e6c6SManish Chopra 474e5c4e6c6SManish Chopra enum qlc_83xx_mbx_response_states { 475e5c4e6c6SManish Chopra QLC_83XX_MBX_RESPONSE_WAIT = 0, 476e5c4e6c6SManish Chopra QLC_83XX_MBX_RESPONSE_ARRIVED, 477e5c4e6c6SManish Chopra }; 478e5c4e6c6SManish Chopra 479e5c4e6c6SManish Chopra #define QLC_83XX_MBX_RESPONSE_FAILED 0x2 480e5c4e6c6SManish Chopra #define QLC_83XX_MBX_RESPONSE_UNKNOWN 0x3 481e5c4e6c6SManish Chopra 4827f966452SSony Chacko /* Additional registers in 83xx */ 4837f966452SSony Chacko enum qlc_83xx_ext_regs { 4847f966452SSony Chacko QLCNIC_GLOBAL_RESET = 0, 4857f966452SSony Chacko QLCNIC_WILDCARD, 4867f966452SSony Chacko QLCNIC_INFORMANT, 4877f966452SSony Chacko QLCNIC_HOST_MBX_CTRL, 4887f966452SSony Chacko QLCNIC_FW_MBX_CTRL, 4897f966452SSony Chacko QLCNIC_BOOTLOADER_ADDR, 4907f966452SSony Chacko QLCNIC_BOOTLOADER_SIZE, 4917f966452SSony Chacko QLCNIC_FW_IMAGE_ADDR, 4927f966452SSony Chacko QLCNIC_MBX_INTR_ENBL, 4937f966452SSony Chacko QLCNIC_DEF_INT_MASK, 4947f966452SSony Chacko QLCNIC_DEF_INT_ID, 4957f966452SSony Chacko QLC_83XX_IDC_MAJ_VERSION, 4967f966452SSony Chacko QLC_83XX_IDC_DEV_STATE, 4977f966452SSony Chacko QLC_83XX_IDC_DRV_PRESENCE, 4987f966452SSony Chacko QLC_83XX_IDC_DRV_ACK, 4997f966452SSony Chacko QLC_83XX_IDC_CTRL, 5007f966452SSony Chacko QLC_83XX_IDC_DRV_AUDIT, 5017f966452SSony Chacko QLC_83XX_IDC_MIN_VERSION, 5027f966452SSony Chacko QLC_83XX_RECOVER_DRV_LOCK, 5037f966452SSony Chacko QLC_83XX_IDC_PF_0, 5047f966452SSony Chacko QLC_83XX_IDC_PF_1, 5057f966452SSony Chacko QLC_83XX_IDC_PF_2, 5067f966452SSony Chacko QLC_83XX_IDC_PF_3, 5077f966452SSony Chacko QLC_83XX_IDC_PF_4, 5087f966452SSony Chacko QLC_83XX_IDC_PF_5, 5097f966452SSony Chacko QLC_83XX_IDC_PF_6, 5107f966452SSony Chacko QLC_83XX_IDC_PF_7, 5117f966452SSony Chacko QLC_83XX_IDC_PF_8, 5127f966452SSony Chacko QLC_83XX_IDC_PF_9, 5137f966452SSony Chacko QLC_83XX_IDC_PF_10, 5147f966452SSony Chacko QLC_83XX_IDC_PF_11, 5157f966452SSony Chacko QLC_83XX_IDC_PF_12, 5167f966452SSony Chacko QLC_83XX_IDC_PF_13, 5177f966452SSony Chacko QLC_83XX_IDC_PF_14, 5187f966452SSony Chacko QLC_83XX_IDC_PF_15, 5197f966452SSony Chacko QLC_83XX_IDC_DEV_PARTITION_INFO_1, 5207f966452SSony Chacko QLC_83XX_IDC_DEV_PARTITION_INFO_2, 5217f966452SSony Chacko QLC_83XX_DRV_OP_MODE, 5227f966452SSony Chacko QLC_83XX_VNIC_STATE, 5237f966452SSony Chacko QLC_83XX_DRV_LOCK, 5247f966452SSony Chacko QLC_83XX_DRV_UNLOCK, 5257f966452SSony Chacko QLC_83XX_DRV_LOCK_ID, 5267f966452SSony Chacko QLC_83XX_ASIC_TEMP, 5277f966452SSony Chacko }; 5287f966452SSony Chacko 5293720bf79SSucheta Chakraborty /* Initialize/Stop NIC command bit definitions */ 5309b0fff2aSSucheta Chakraborty #define QLC_REGISTER_LB_IDC BIT_0 5312b3d7b75SShahed Shaikh #define QLC_REGISTER_DCB_AEN BIT_1 5322b3d7b75SShahed Shaikh #define QLC_83XX_MULTI_TENANCY_INFO BIT_29 5339b0fff2aSSucheta Chakraborty #define QLC_INIT_FW_RESOURCES BIT_31 5343720bf79SSucheta Chakraborty 5357f966452SSony Chacko /* 83xx funcitons */ 5367f966452SSony Chacko int qlcnic_83xx_get_fw_version(struct qlcnic_adapter *); 537e5c4e6c6SManish Chopra int qlcnic_83xx_issue_cmd(struct qlcnic_adapter *, struct qlcnic_cmd_args *); 53834e8c406SHimanshu Madhani int qlcnic_83xx_setup_intr(struct qlcnic_adapter *); 5397f966452SSony Chacko void qlcnic_83xx_get_func_no(struct qlcnic_adapter *); 5407f966452SSony Chacko int qlcnic_83xx_cam_lock(struct qlcnic_adapter *); 5417f966452SSony Chacko void qlcnic_83xx_cam_unlock(struct qlcnic_adapter *); 5427f966452SSony Chacko int qlcnic_send_ctrl_op(struct qlcnic_adapter *, struct qlcnic_cmd_args *, u32); 543319ecf12SSony Chacko void qlcnic_83xx_add_sysfs(struct qlcnic_adapter *); 544319ecf12SSony Chacko void qlcnic_83xx_remove_sysfs(struct qlcnic_adapter *); 5457f966452SSony Chacko void qlcnic_83xx_write_crb(struct qlcnic_adapter *, char *, loff_t, size_t); 5467f966452SSony Chacko void qlcnic_83xx_read_crb(struct qlcnic_adapter *, char *, loff_t, size_t); 5474bd8e738SHimanshu Madhani int qlcnic_83xx_rd_reg_indirect(struct qlcnic_adapter *, ulong, int *); 5487f966452SSony Chacko int qlcnic_83xx_wrt_reg_indirect(struct qlcnic_adapter *, ulong, u32); 5497f966452SSony Chacko int qlcnic_83xx_nic_set_promisc(struct qlcnic_adapter *, u32); 5507f966452SSony Chacko int qlcnic_83xx_config_hw_lro(struct qlcnic_adapter *, int); 5517f966452SSony Chacko int qlcnic_83xx_config_rss(struct qlcnic_adapter *, int); 552c333fa0cSShahed Shaikh void qlcnic_83xx_change_l2_filter(struct qlcnic_adapter *adapter, u64 *addr, 553c333fa0cSShahed Shaikh u16 vlan, struct qlcnic_host_tx_ring *ring); 5547f966452SSony Chacko int qlcnic_83xx_get_pci_info(struct qlcnic_adapter *, struct qlcnic_pci_info *); 5557f966452SSony Chacko int qlcnic_83xx_set_nic_info(struct qlcnic_adapter *, struct qlcnic_info *); 5569b0fff2aSSucheta Chakraborty void qlcnic_83xx_initialize_nic(struct qlcnic_adapter *, int); 5577f966452SSony Chacko 5584be41e92SSony Chacko int qlcnic_83xx_napi_add(struct qlcnic_adapter *, struct net_device *); 5594be41e92SSony Chacko void qlcnic_83xx_napi_del(struct qlcnic_adapter *); 5604be41e92SSony Chacko void qlcnic_83xx_napi_enable(struct qlcnic_adapter *); 5614be41e92SSony Chacko void qlcnic_83xx_napi_disable(struct qlcnic_adapter *); 562319ecf12SSony Chacko int qlcnic_83xx_config_led(struct qlcnic_adapter *, u32, u32); 5638d37ba02SShahed Shaikh int qlcnic_ind_wr(struct qlcnic_adapter *, u32, u32); 5647f966452SSony Chacko int qlcnic_ind_rd(struct qlcnic_adapter *, u32); 5657f966452SSony Chacko int qlcnic_83xx_create_rx_ctx(struct qlcnic_adapter *); 5667f966452SSony Chacko int qlcnic_83xx_create_tx_ctx(struct qlcnic_adapter *, 5677f966452SSony Chacko struct qlcnic_host_tx_ring *, int); 5687cb03b23SRajesh Borundia void qlcnic_83xx_del_rx_ctx(struct qlcnic_adapter *); 5697cb03b23SRajesh Borundia void qlcnic_83xx_del_tx_ctx(struct qlcnic_adapter *, 5707cb03b23SRajesh Borundia struct qlcnic_host_tx_ring *); 5717f966452SSony Chacko int qlcnic_83xx_get_nic_info(struct qlcnic_adapter *, struct qlcnic_info *, u8); 5727f966452SSony Chacko int qlcnic_83xx_setup_link_event(struct qlcnic_adapter *, int); 5737f966452SSony Chacko void qlcnic_83xx_process_rcv_ring_diag(struct qlcnic_host_sds_ring *); 5747f966452SSony Chacko int qlcnic_83xx_config_intrpt(struct qlcnic_adapter *, bool); 575f80bc8feSRajesh Borundia int qlcnic_83xx_sre_macaddr_change(struct qlcnic_adapter *, u8 *, u16, u8); 57607a251c8SShahed Shaikh int qlcnic_83xx_get_mac_address(struct qlcnic_adapter *, u8 *, u8); 5777f966452SSony Chacko int qlcnic_83xx_alloc_mbx_args(struct qlcnic_cmd_args *, 5787f966452SSony Chacko struct qlcnic_adapter *, u32); 5797f966452SSony Chacko void qlcnic_free_mbx_args(struct qlcnic_cmd_args *); 5807f966452SSony Chacko void qlcnic_set_npar_data(struct qlcnic_adapter *, const struct qlcnic_info *, 5817f966452SSony Chacko struct qlcnic_info *); 582a514722aSHimanshu Madhani int qlcnic_83xx_config_intr_coal(struct qlcnic_adapter *, 583a514722aSHimanshu Madhani struct ethtool_coalesce *); 584a514722aSHimanshu Madhani int qlcnic_83xx_set_rx_tx_intr_coal(struct qlcnic_adapter *); 5857f966452SSony Chacko int qlcnic_83xx_get_port_info(struct qlcnic_adapter *); 586e5c4e6c6SManish Chopra void qlcnic_83xx_enable_mbx_interrupt(struct qlcnic_adapter *); 587f036e4f4SRajesh Borundia void qlcnic_83xx_disable_mbx_intr(struct qlcnic_adapter *); 5887f966452SSony Chacko irqreturn_t qlcnic_83xx_clear_legacy_intr(struct qlcnic_adapter *); 589ac166700SHimanshu Madhani irqreturn_t qlcnic_83xx_intr(int, void *); 5907f966452SSony Chacko irqreturn_t qlcnic_83xx_tmp_intr(int, void *); 5917f966452SSony Chacko void qlcnic_83xx_check_vf(struct qlcnic_adapter *, 5927f966452SSony Chacko const struct pci_device_id *); 5937f966452SSony Chacko int qlcnic_83xx_config_default_opmode(struct qlcnic_adapter *); 5947f966452SSony Chacko int qlcnic_83xx_setup_mbx_intr(struct qlcnic_adapter *); 5957f966452SSony Chacko void qlcnic_83xx_free_mbx_intr(struct qlcnic_adapter *); 5967f966452SSony Chacko void qlcnic_83xx_register_map(struct qlcnic_hardware_context *); 5977f966452SSony Chacko void qlcnic_83xx_idc_aen_work(struct work_struct *); 5987f966452SSony Chacko void qlcnic_83xx_config_ipaddr(struct qlcnic_adapter *, __be32, int); 599d865ebb4SSony Chacko 600d865ebb4SSony Chacko int qlcnic_83xx_erase_flash_sector(struct qlcnic_adapter *, u32); 601d865ebb4SSony Chacko int qlcnic_83xx_flash_bulk_write(struct qlcnic_adapter *, u32, u32 *, int); 602d865ebb4SSony Chacko int qlcnic_83xx_flash_write32(struct qlcnic_adapter *, u32, u32 *); 603d865ebb4SSony Chacko int qlcnic_83xx_lock_flash(struct qlcnic_adapter *); 604d865ebb4SSony Chacko void qlcnic_83xx_unlock_flash(struct qlcnic_adapter *); 605d865ebb4SSony Chacko int qlcnic_83xx_save_flash_status(struct qlcnic_adapter *); 606d865ebb4SSony Chacko int qlcnic_83xx_restore_flash_status(struct qlcnic_adapter *, int); 607d865ebb4SSony Chacko int qlcnic_83xx_read_flash_mfg_id(struct qlcnic_adapter *); 608d865ebb4SSony Chacko int qlcnic_83xx_read_flash_descriptor_table(struct qlcnic_adapter *); 609629263acSSony Chacko int qlcnic_83xx_flash_read32(struct qlcnic_adapter *, u32, u8 *, int); 610629263acSSony Chacko int qlcnic_83xx_lockless_flash_read32(struct qlcnic_adapter *, 611629263acSSony Chacko u32, u8 *, int); 612*a72dc199SChristophe JAILLET int qlcnic_83xx_init(struct qlcnic_adapter *); 613629263acSSony Chacko int qlcnic_83xx_idc_ready_state_entry(struct qlcnic_adapter *); 614629263acSSony Chacko void qlcnic_83xx_idc_poll_dev_state(struct work_struct *); 615629263acSSony Chacko void qlcnic_83xx_idc_exit(struct qlcnic_adapter *); 616629263acSSony Chacko void qlcnic_83xx_idc_request_reset(struct qlcnic_adapter *, u32); 617629263acSSony Chacko int qlcnic_83xx_lock_driver(struct qlcnic_adapter *); 618629263acSSony Chacko void qlcnic_83xx_unlock_driver(struct qlcnic_adapter *); 619629263acSSony Chacko int qlcnic_83xx_set_default_offload_settings(struct qlcnic_adapter *); 620d71170fbSSony Chacko int qlcnic_83xx_idc_vnic_pf_entry(struct qlcnic_adapter *); 621d71170fbSSony Chacko int qlcnic_83xx_disable_vnic_mode(struct qlcnic_adapter *, int); 622d71170fbSSony Chacko int qlcnic_83xx_config_vnic_opmode(struct qlcnic_adapter *); 623d71170fbSSony Chacko int qlcnic_83xx_get_vnic_vport_info(struct qlcnic_adapter *, 624d71170fbSSony Chacko struct qlcnic_info *, u8); 625d71170fbSSony Chacko int qlcnic_83xx_get_vnic_pf_info(struct qlcnic_adapter *, struct qlcnic_info *); 6264c776aadSSony Chacko int qlcnic_83xx_set_port_eswitch_status(struct qlcnic_adapter *, int, int *); 6274e60ac46SSony Chacko 6284e60ac46SSony Chacko void qlcnic_83xx_get_minidump_template(struct qlcnic_adapter *); 6297e38d04bSSony Chacko void qlcnic_83xx_get_stats(struct qlcnic_adapter *adapter, u64 *data); 630d01a6d3cSShahed Shaikh int qlcnic_83xx_extend_md_capab(struct qlcnic_adapter *); 63149cef10fSPhilippe Reynes int qlcnic_83xx_get_link_ksettings(struct qlcnic_adapter *adapter, 63249cef10fSPhilippe Reynes struct ethtool_link_ksettings *ecmd); 63349cef10fSPhilippe Reynes int qlcnic_83xx_set_link_ksettings(struct qlcnic_adapter *adapter, 63449cef10fSPhilippe Reynes const struct ethtool_link_ksettings *ecmd); 6357e38d04bSSony Chacko void qlcnic_83xx_get_pauseparam(struct qlcnic_adapter *, 6367e38d04bSSony Chacko struct ethtool_pauseparam *); 6377e38d04bSSony Chacko int qlcnic_83xx_set_pauseparam(struct qlcnic_adapter *, 6387e38d04bSSony Chacko struct ethtool_pauseparam *); 6397e38d04bSSony Chacko int qlcnic_83xx_test_link(struct qlcnic_adapter *); 640f9c3fe2fSChopra, Manish void qlcnic_83xx_get_port_type(struct qlcnic_adapter *adapter); 6417e38d04bSSony Chacko int qlcnic_83xx_reg_test(struct qlcnic_adapter *); 6427e38d04bSSony Chacko int qlcnic_83xx_get_regs_len(struct qlcnic_adapter *); 6437e38d04bSSony Chacko int qlcnic_83xx_get_registers(struct qlcnic_adapter *, u32 *); 644ba4468dbSJitendra Kalsaria int qlcnic_83xx_loopback_test(struct net_device *, u8); 64558ead415SJitendra Kalsaria int qlcnic_83xx_interrupt_test(struct net_device *); 646d16951d9SHimanshu Madhani int qlcnic_83xx_set_led(struct net_device *, enum ethtool_phys_id_state); 6477e38d04bSSony Chacko int qlcnic_83xx_flash_test(struct qlcnic_adapter *); 648a520030eSHimanshu Madhani int qlcnic_83xx_enable_flash_write(struct qlcnic_adapter *); 649a520030eSHimanshu Madhani int qlcnic_83xx_disable_flash_write(struct qlcnic_adapter *); 6507ed3ce48SRajesh Borundia void qlcnic_83xx_enable_mbx_poll(struct qlcnic_adapter *); 6517ed3ce48SRajesh Borundia void qlcnic_83xx_disable_mbx_poll(struct qlcnic_adapter *); 652486a5bc7SRajesh Borundia int qlcnic_83xx_idc_init(struct qlcnic_adapter *); 653486a5bc7SRajesh Borundia int qlcnic_83xx_idc_reattach_driver(struct qlcnic_adapter *); 654486a5bc7SRajesh Borundia int qlcnic_83xx_set_vnic_opmode(struct qlcnic_adapter *); 655486a5bc7SRajesh Borundia int qlcnic_83xx_check_vnic_state(struct qlcnic_adapter *); 6569ce226faSPratik Pujar void qlcnic_83xx_aer_stop_poll_work(struct qlcnic_adapter *); 6579ce226faSPratik Pujar int qlcnic_83xx_aer_reset(struct qlcnic_adapter *); 6589ce226faSPratik Pujar void qlcnic_83xx_aer_start_poll_work(struct qlcnic_adapter *); 659225837a0SShahed Shaikh u32 qlcnic_83xx_get_saved_state(void *, u32); 660225837a0SShahed Shaikh void qlcnic_83xx_set_saved_state(void *, u32, u32); 661225837a0SShahed Shaikh void qlcnic_83xx_cache_tmpl_hdr_values(struct qlcnic_fw_dump *); 662225837a0SShahed Shaikh u32 qlcnic_83xx_get_cap_size(void *, int); 663225837a0SShahed Shaikh void qlcnic_83xx_set_sys_info(void *, int, u32); 664225837a0SShahed Shaikh void qlcnic_83xx_store_cap_mask(void *, u32); 6658d37ba02SShahed Shaikh int qlcnic_ms_mem_write128(struct qlcnic_adapter *, u64, u32 *, u32); 6667f966452SSony Chacko #endif 667