qlcnic.h (879f99ef2c4c05d9a7f0a67a05f1415663119825) qlcnic.h (ed616689a3d95eb6c9bdbb1ef74b0f50cbdf276a)
1/*
2 * QLogic qlcnic NIC Driver
3 * Copyright (c) 2009-2013 QLogic Corporation
4 *
5 * See LICENSE.qlcnic for copyright and licensing details.
6 */
7
8#ifndef _QLCNIC_H_

--- 25 unchanged lines hidden (view full) ---

34
35#include "qlcnic_hdr.h"
36#include "qlcnic_hw.h"
37#include "qlcnic_83xx_hw.h"
38#include "qlcnic_dcb.h"
39
40#define _QLCNIC_LINUX_MAJOR 5
41#define _QLCNIC_LINUX_MINOR 3
1/*
2 * QLogic qlcnic NIC Driver
3 * Copyright (c) 2009-2013 QLogic Corporation
4 *
5 * See LICENSE.qlcnic for copyright and licensing details.
6 */
7
8#ifndef _QLCNIC_H_

--- 25 unchanged lines hidden (view full) ---

34
35#include "qlcnic_hdr.h"
36#include "qlcnic_hw.h"
37#include "qlcnic_83xx_hw.h"
38#include "qlcnic_dcb.h"
39
40#define _QLCNIC_LINUX_MAJOR 5
41#define _QLCNIC_LINUX_MINOR 3
42#define _QLCNIC_LINUX_SUBVERSION 57
43#define QLCNIC_LINUX_VERSIONID "5.3.57"
42#define _QLCNIC_LINUX_SUBVERSION 59
43#define QLCNIC_LINUX_VERSIONID "5.3.59"
44#define QLCNIC_DRV_IDC_VER 0x01
45#define QLCNIC_DRIVER_VERSION ((_QLCNIC_LINUX_MAJOR << 16) |\
46 (_QLCNIC_LINUX_MINOR << 8) | (_QLCNIC_LINUX_SUBVERSION))
47
48#define QLCNIC_VERSION_CODE(a, b, c) (((a) << 24) + ((b) << 16) + (c))
49#define _major(v) (((v) >> 24) & 0xff)
50#define _minor(v) (((v) >> 16) & 0xff)
51#define _build(v) ((v) & 0xffff)

--- 480 unchanged lines hidden (view full) ---

532 u32 *ext_reg_tbl;
533 u32 mbox_aen[QLC_83XX_MBX_AEN_CNT];
534 u32 mbox_reg[4];
535 struct qlcnic_mailbox *mailbox;
536 u8 extend_lb_time;
537 u8 phys_port_id[ETH_ALEN];
538 u8 lb_mode;
539 u16 vxlan_port;
44#define QLCNIC_DRV_IDC_VER 0x01
45#define QLCNIC_DRIVER_VERSION ((_QLCNIC_LINUX_MAJOR << 16) |\
46 (_QLCNIC_LINUX_MINOR << 8) | (_QLCNIC_LINUX_SUBVERSION))
47
48#define QLCNIC_VERSION_CODE(a, b, c) (((a) << 24) + ((b) << 16) + (c))
49#define _major(v) (((v) >> 24) & 0xff)
50#define _minor(v) (((v) >> 16) & 0xff)
51#define _build(v) ((v) & 0xffff)

--- 480 unchanged lines hidden (view full) ---

532 u32 *ext_reg_tbl;
533 u32 mbox_aen[QLC_83XX_MBX_AEN_CNT];
534 u32 mbox_reg[4];
535 struct qlcnic_mailbox *mailbox;
536 u8 extend_lb_time;
537 u8 phys_port_id[ETH_ALEN];
538 u8 lb_mode;
539 u16 vxlan_port;
540 struct device *hwmon_dev;
540};
541
542struct qlcnic_adapter_stats {
543 u64 xmitcalled;
544 u64 xmitfinished;
545 u64 rxdropped;
546 u64 txdropped;
547 u64 csummed;

--- 465 unchanged lines hidden (view full) ---

1013#define QLCNIC_HAS_PHYS_PORT_ID 0x40000
1014#define QLCNIC_TSS_RSS 0x80000
1015
1016#ifdef CONFIG_QLCNIC_VXLAN
1017#define QLCNIC_ADD_VXLAN_PORT 0x100000
1018#define QLCNIC_DEL_VXLAN_PORT 0x200000
1019#endif
1020
541};
542
543struct qlcnic_adapter_stats {
544 u64 xmitcalled;
545 u64 xmitfinished;
546 u64 rxdropped;
547 u64 txdropped;
548 u64 csummed;

--- 465 unchanged lines hidden (view full) ---

1014#define QLCNIC_HAS_PHYS_PORT_ID 0x40000
1015#define QLCNIC_TSS_RSS 0x80000
1016
1017#ifdef CONFIG_QLCNIC_VXLAN
1018#define QLCNIC_ADD_VXLAN_PORT 0x100000
1019#define QLCNIC_DEL_VXLAN_PORT 0x200000
1020#endif
1021
1022#define QLCNIC_VLAN_FILTERING 0x800000
1023
1021#define QLCNIC_IS_MSI_FAMILY(adapter) \
1022 ((adapter)->flags & (QLCNIC_MSI_ENABLED | QLCNIC_MSIX_ENABLED))
1023#define QLCNIC_IS_TSO_CAPABLE(adapter) \
1024 ((adapter)->ahw->capabilities & QLCNIC_FW_CAPABILITY_TSO)
1025
1026#define QLCNIC_BEACON_EANBLE 0xC
1027#define QLCNIC_BEACON_DISABLE 0xD
1028

--- 282 unchanged lines hidden (view full) ---

1311#define QLCNIC_SWITCH_PORT_MIRRORING BIT_4
1312};
1313
1314
1315/* Return codes for Error handling */
1316#define QL_STATUS_INVALID_PARAM -1
1317
1318#define MAX_BW 100 /* % of link speed */
1024#define QLCNIC_IS_MSI_FAMILY(adapter) \
1025 ((adapter)->flags & (QLCNIC_MSI_ENABLED | QLCNIC_MSIX_ENABLED))
1026#define QLCNIC_IS_TSO_CAPABLE(adapter) \
1027 ((adapter)->ahw->capabilities & QLCNIC_FW_CAPABILITY_TSO)
1028
1029#define QLCNIC_BEACON_EANBLE 0xC
1030#define QLCNIC_BEACON_DISABLE 0xD
1031

--- 282 unchanged lines hidden (view full) ---

1314#define QLCNIC_SWITCH_PORT_MIRRORING BIT_4
1315};
1316
1317
1318/* Return codes for Error handling */
1319#define QL_STATUS_INVALID_PARAM -1
1320
1321#define MAX_BW 100 /* % of link speed */
1322#define MIN_BW 1 /* % of link speed */
1319#define MAX_VLAN_ID 4095
1320#define MIN_VLAN_ID 2
1321#define DEFAULT_MAC_LEARN 1
1322
1323#define IS_VALID_VLAN(vlan) (vlan >= MIN_VLAN_ID && vlan < MAX_VLAN_ID)
1324#define IS_VALID_BW(bw) (bw <= MAX_BW)
1325
1326struct qlcnic_pci_func_cfg {

--- 360 unchanged lines hidden (view full) ---

1687int qlcnic_set_default_offload_settings(struct qlcnic_adapter *);
1688int qlcnic_reset_npar_config(struct qlcnic_adapter *);
1689int qlcnic_set_eswitch_port_config(struct qlcnic_adapter *);
1690int qlcnic_83xx_configure_opmode(struct qlcnic_adapter *adapter);
1691int qlcnic_read_mac_addr(struct qlcnic_adapter *);
1692int qlcnic_setup_netdev(struct qlcnic_adapter *, struct net_device *, int);
1693void qlcnic_set_netdev_features(struct qlcnic_adapter *,
1694 struct qlcnic_esw_func_cfg *);
1323#define MAX_VLAN_ID 4095
1324#define MIN_VLAN_ID 2
1325#define DEFAULT_MAC_LEARN 1
1326
1327#define IS_VALID_VLAN(vlan) (vlan >= MIN_VLAN_ID && vlan < MAX_VLAN_ID)
1328#define IS_VALID_BW(bw) (bw <= MAX_BW)
1329
1330struct qlcnic_pci_func_cfg {

--- 360 unchanged lines hidden (view full) ---

1691int qlcnic_set_default_offload_settings(struct qlcnic_adapter *);
1692int qlcnic_reset_npar_config(struct qlcnic_adapter *);
1693int qlcnic_set_eswitch_port_config(struct qlcnic_adapter *);
1694int qlcnic_83xx_configure_opmode(struct qlcnic_adapter *adapter);
1695int qlcnic_read_mac_addr(struct qlcnic_adapter *);
1696int qlcnic_setup_netdev(struct qlcnic_adapter *, struct net_device *, int);
1697void qlcnic_set_netdev_features(struct qlcnic_adapter *,
1698 struct qlcnic_esw_func_cfg *);
1695void qlcnic_sriov_vf_schedule_multi(struct net_device *);
1699void qlcnic_sriov_vf_set_multi(struct net_device *);
1696int qlcnic_is_valid_nic_func(struct qlcnic_adapter *, u8);
1697int qlcnic_get_pci_func_type(struct qlcnic_adapter *, u16, u16 *, u16 *,
1698 u16 *);
1699
1700/*
1701 * QLOGIC Board information
1702 */
1703

--- 10 unchanged lines hidden (view full) ---

1714{
1715 if (likely(tx_ring->producer < tx_ring->sw_consumer))
1716 return tx_ring->sw_consumer - tx_ring->producer;
1717 else
1718 return tx_ring->sw_consumer + tx_ring->num_desc -
1719 tx_ring->producer;
1720}
1721
1700int qlcnic_is_valid_nic_func(struct qlcnic_adapter *, u8);
1701int qlcnic_get_pci_func_type(struct qlcnic_adapter *, u16, u16 *, u16 *,
1702 u16 *);
1703
1704/*
1705 * QLOGIC Board information
1706 */
1707

--- 10 unchanged lines hidden (view full) ---

1718{
1719 if (likely(tx_ring->producer < tx_ring->sw_consumer))
1720 return tx_ring->sw_consumer - tx_ring->producer;
1721 else
1722 return tx_ring->sw_consumer + tx_ring->num_desc -
1723 tx_ring->producer;
1724}
1725
1722static inline int qlcnic_set_real_num_queues(struct qlcnic_adapter *adapter,
1723 struct net_device *netdev)
1724{
1725 int err;
1726
1727 netdev->num_tx_queues = adapter->drv_tx_rings;
1728 netdev->real_num_tx_queues = adapter->drv_tx_rings;
1729
1730 err = netif_set_real_num_tx_queues(netdev, adapter->drv_tx_rings);
1731 if (err)
1732 netdev_err(netdev, "failed to set %d Tx queues\n",
1733 adapter->drv_tx_rings);
1734
1735 return err;
1736}
1737
1738struct qlcnic_nic_template {
1739 int (*config_bridged_mode) (struct qlcnic_adapter *, u32);
1740 int (*config_led) (struct qlcnic_adapter *, u32, u32);
1741 int (*start_firmware) (struct qlcnic_adapter *);
1742 int (*init_driver) (struct qlcnic_adapter *);
1743 void (*request_reset) (struct qlcnic_adapter *, u32);
1744 void (*cancel_idc_work) (struct qlcnic_adapter *);
1745 int (*napi_add)(struct qlcnic_adapter *, struct net_device *);

--- 603 unchanged lines hidden (view full) ---

2349
2350static inline bool qlcnic_83xx_vf_check(struct qlcnic_adapter *adapter)
2351{
2352 unsigned short device = adapter->pdev->device;
2353
2354 return (device == PCI_DEVICE_ID_QLOGIC_VF_QLE834X) ? true : false;
2355}
2356
1726struct qlcnic_nic_template {
1727 int (*config_bridged_mode) (struct qlcnic_adapter *, u32);
1728 int (*config_led) (struct qlcnic_adapter *, u32, u32);
1729 int (*start_firmware) (struct qlcnic_adapter *);
1730 int (*init_driver) (struct qlcnic_adapter *);
1731 void (*request_reset) (struct qlcnic_adapter *, u32);
1732 void (*cancel_idc_work) (struct qlcnic_adapter *);
1733 int (*napi_add)(struct qlcnic_adapter *, struct net_device *);

--- 603 unchanged lines hidden (view full) ---

2337
2338static inline bool qlcnic_83xx_vf_check(struct qlcnic_adapter *adapter)
2339{
2340 unsigned short device = adapter->pdev->device;
2341
2342 return (device == PCI_DEVICE_ID_QLOGIC_VF_QLE834X) ? true : false;
2343}
2344
2345static inline bool qlcnic_sriov_check(struct qlcnic_adapter *adapter)
2346{
2347 bool status;
2348
2349 status = (qlcnic_sriov_pf_check(adapter) ||
2350 qlcnic_sriov_vf_check(adapter)) ? true : false;
2351
2352 return status;
2353}
2354
2357static inline u32 qlcnic_get_vnic_func_count(struct qlcnic_adapter *adapter)
2358{
2359 if (qlcnic_84xx_check(adapter))
2360 return QLC_84XX_VNIC_COUNT;
2361 else
2362 return QLC_DEFAULT_VNIC_COUNT;
2363}
2355static inline u32 qlcnic_get_vnic_func_count(struct qlcnic_adapter *adapter)
2356{
2357 if (qlcnic_84xx_check(adapter))
2358 return QLC_84XX_VNIC_COUNT;
2359 else
2360 return QLC_DEFAULT_VNIC_COUNT;
2361}
2362
2363#ifdef CONFIG_QLCNIC_HWMON
2364void qlcnic_register_hwmon_dev(struct qlcnic_adapter *);
2365void qlcnic_unregister_hwmon_dev(struct qlcnic_adapter *);
2366#else
2367static inline void qlcnic_register_hwmon_dev(struct qlcnic_adapter *adapter)
2368{
2369 return;
2370}
2371static inline void qlcnic_unregister_hwmon_dev(struct qlcnic_adapter *adapter)
2372{
2373 return;
2374}
2375#endif
2364#endif /* __QLCNIC_H_ */
2376#endif /* __QLCNIC_H_ */