]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/net/qlcnic/qlcnic.h
qlcnic: set mtu lower limit
[net-next-2.6.git] / drivers / net / qlcnic / qlcnic.h
index 0a537044d7dab73f74530c95922c75e7aaa92cbb..42a288348aca22d0d458c325125e67289f5777f2 100644 (file)
@@ -51,8 +51,8 @@
 
 #define _QLCNIC_LINUX_MAJOR 5
 #define _QLCNIC_LINUX_MINOR 0
-#define _QLCNIC_LINUX_SUBVERSION 8
-#define QLCNIC_LINUX_VERSIONID  "5.0.8"
+#define _QLCNIC_LINUX_SUBVERSION 10
+#define QLCNIC_LINUX_VERSIONID  "5.0.10"
 #define QLCNIC_DRV_IDC_VER  0x01
 #define QLCNIC_DRIVER_VERSION  ((_QLCNIC_LINUX_MAJOR << 16) |\
                 (_QLCNIC_LINUX_MINOR << 8) | (_QLCNIC_LINUX_SUBVERSION))
@@ -95,6 +95,7 @@
 #define FIRST_PAGE_GROUP_END   0x100000
 
 #define P3_MAX_MTU                     (9600)
+#define P3_MIN_MTU                     (68)
 #define QLCNIC_MAX_ETHERHDR                32 /* This contains some padding */
 
 #define QLCNIC_P3_RX_BUF_MAX_LEN         (QLCNIC_MAX_ETHERHDR + ETH_DATA_LEN)
@@ -224,7 +225,8 @@ struct rcv_desc {
 #define QLCNIC_LRO_DESC        0x12
 
 /* for status field in status_desc */
-#define STATUS_CKSUM_OK                (2)
+#define STATUS_CKSUM_LOOP      0
+#define STATUS_CKSUM_OK                2
 
 /* owner bits of status_desc */
 #define STATUS_OWNER_HOST      (0x1ULL << 56)
@@ -722,6 +724,8 @@ struct qlcnic_cardrsp_tx_ctx {
 #define QLCNIC_MAC_NOOP        0
 #define QLCNIC_MAC_ADD 1
 #define QLCNIC_MAC_DEL 2
+#define QLCNIC_MAC_VLAN_ADD    3
+#define QLCNIC_MAC_VLAN_DEL    4
 
 struct qlcnic_mac_list_s {
        struct list_head list;
@@ -895,6 +899,16 @@ struct qlcnic_mac_req {
        u8 mac_addr[6];
 };
 
+struct qlcnic_vlan_req {
+       __le16 vlan_id;
+       __le16 rsvd[3];
+};
+
+struct qlcnic_ipaddr {
+       __be32 ipv4;
+       __be32 ipv6[4];
+};
+
 #define QLCNIC_MSI_ENABLED             0x02
 #define QLCNIC_MSIX_ENABLED            0x04
 #define QLCNIC_LRO_ENABLED             0x08
@@ -905,6 +919,7 @@ struct qlcnic_mac_req {
 #define QLCNIC_ADAPTER_INITIALIZED     0x80
 #define QLCNIC_TAGGING_ENABLED         0x100
 #define QLCNIC_MACSPOOF                        0x200
+#define QLCNIC_MAC_OVERRIDE_DISABLED   0x400
 #define QLCNIC_IS_MSI_FAMILY(adapter) \
        ((adapter)->flags & (QLCNIC_MSI_ENABLED | QLCNIC_MSIX_ENABLED))
 
@@ -925,6 +940,22 @@ struct qlcnic_mac_req {
 #define QLCNIC_INTERRUPT_TEST          1
 #define QLCNIC_LOOPBACK_TEST           2
 
+#define QLCNIC_FILTER_AGE      80
+#define QLCNIC_LB_MAX_FILTERS  64
+
+struct qlcnic_filter {
+       struct hlist_node fnode;
+       u8 faddr[ETH_ALEN];
+       __le16 vlan_id;
+       unsigned long ftime;
+};
+
+struct qlcnic_filter_hash {
+       struct hlist_head *fhead;
+       u8 fnum;
+       u8 fmax;
+};
+
 struct qlcnic_adapter {
        struct qlcnic_hardware_context ahw;
 
@@ -933,6 +964,7 @@ struct qlcnic_adapter {
        struct list_head mac_list;
 
        spinlock_t tx_clean_lock;
+       spinlock_t mac_learn_lock;
 
        u16 num_txd;
        u16 num_rxd;
@@ -978,7 +1010,7 @@ struct qlcnic_adapter {
        u32 temp;
 
        u32 int_vec_bit;
-       u32 heartbit;
+       u32 heartbeat;
 
        u8 max_mac_filters;
        u8 dev_state;
@@ -992,6 +1024,7 @@ struct qlcnic_adapter {
 
        u64 dev_rst_time;
 
+       struct vlan_group *vlgrp;
        struct qlcnic_npar_info *npars;
        struct qlcnic_eswitch *eswitch;
        struct qlcnic_nic_template *nic_ops;
@@ -1012,6 +1045,8 @@ struct qlcnic_adapter {
 
        struct qlcnic_nic_intr_coalesce coal;
 
+       struct qlcnic_filter_hash fhash;
+
        unsigned long state;
        __le32 file_prd_off;    /*File fw product offset*/
        u32 fw_version;
@@ -1060,7 +1095,7 @@ struct qlcnic_npar_info {
        u8      enable_pm;
        u8      dest_npar;
        u8      discard_tagged;
-       u8      mac_learning;
+       u8      mac_override;
        u8      mac_anti_spoof;
        u8      promisc_mode;
        u8      offload_flags;
@@ -1134,7 +1169,7 @@ struct qlcnic_esw_func_cfg {
        u8      host_vlan_tag;
        u8      promisc_mode;
        u8      discard_tagged;
-       u8      mac_learning;
+       u8      mac_override;
        u8      mac_anti_spoof;
        u8      offload_flags;
        u8      reserved[5];
@@ -1145,6 +1180,18 @@ struct qlcnic_esw_func_cfg {
 #define QLCNIC_STATS_ESWITCH           2
 #define QLCNIC_QUERY_RX_COUNTER                0
 #define QLCNIC_QUERY_TX_COUNTER                1
+#define QLCNIC_ESW_STATS_NOT_AVAIL     0xffffffffffffffffULL
+
+#define QLCNIC_ADD_ESW_STATS(VAL1, VAL2)\
+do {   \
+       if (((VAL1) == QLCNIC_ESW_STATS_NOT_AVAIL) && \
+           ((VAL2) != QLCNIC_ESW_STATS_NOT_AVAIL)) \
+               (VAL1) = (VAL2); \
+       else if (((VAL1) != QLCNIC_ESW_STATS_NOT_AVAIL) && \
+                ((VAL2) != QLCNIC_ESW_STATS_NOT_AVAIL)) \
+                       (VAL1) += (VAL2); \
+} while (0)
+
 struct __qlcnic_esw_statistics {
        __le16 context_id;
        __le16 version;
@@ -1210,6 +1257,8 @@ void qlcnic_pcie_sem_unlock(struct qlcnic_adapter *, int);
 int qlcnic_get_board_info(struct qlcnic_adapter *adapter);
 int qlcnic_wol_supported(struct qlcnic_adapter *adapter);
 int qlcnic_config_led(struct qlcnic_adapter *adapter, u32 state, u32 rate);
+void qlcnic_prune_lb_filters(struct qlcnic_adapter *adapter);
+void qlcnic_delete_lb_filters(struct qlcnic_adapter *adapter);
 
 /* Functions from qlcnic_init.c */
 int qlcnic_load_firmware(struct qlcnic_adapter *adapter);
@@ -1248,7 +1297,7 @@ void qlcnic_free_mac_list(struct qlcnic_adapter *adapter);
 int qlcnic_nic_set_promisc(struct qlcnic_adapter *adapter, u32);
 int qlcnic_config_intr_coalesce(struct qlcnic_adapter *adapter);
 int qlcnic_config_rss(struct qlcnic_adapter *adapter, int enable);
-int qlcnic_config_ipaddr(struct qlcnic_adapter *adapter, u32 ip, int cmd);
+int qlcnic_config_ipaddr(struct qlcnic_adapter *adapter, __be32 ip, int cmd);
 int qlcnic_linkevent_request(struct qlcnic_adapter *adapter, int enable);
 void qlcnic_advert_link_change(struct qlcnic_adapter *adapter, int linkup);
 
@@ -1259,7 +1308,6 @@ int qlcnic_config_bridged_mode(struct qlcnic_adapter *adapter, u32 enable);
 int qlcnic_send_lro_cleanup(struct qlcnic_adapter *adapter);
 void qlcnic_update_cmd_producer(struct qlcnic_adapter *adapter,
                struct qlcnic_host_tx_ring *tx_ring);
-int qlcnic_get_mac_addr(struct qlcnic_adapter *adapter, u8 *mac);
 void qlcnic_clear_ilb_mode(struct qlcnic_adapter *adapter);
 int qlcnic_set_ilb_mode(struct qlcnic_adapter *adapter);
 void qlcnic_fetch_mac(struct qlcnic_adapter *, u32, u32, u8, u8 *);
@@ -1326,6 +1374,8 @@ static const struct qlcnic_brdinfo qlcnic_boards[] = {
                "3200 Series Quad Port 1Gb Intelligent Ethernet Adapter"},
        {0x1077, 0x8020, 0x1077, 0x20f,
                "3200 Series Single Port 10Gb Intelligent Ethernet Adapter"},
+       {0x1077, 0x8020, 0x103c, 0x3733,
+               "NC523SFP 10Gb 2-port Flex-10 Server Adapter"},
        {0x1077, 0x8020, 0x0, 0x0, "cLOM8214 1/10GbE Controller"},
 };
 
@@ -1344,7 +1394,6 @@ static inline u32 qlcnic_tx_avail(struct qlcnic_host_tx_ring *tx_ring)
 extern const struct ethtool_ops qlcnic_ethtool_ops;
 
 struct qlcnic_nic_template {
-       int (*get_mac_addr) (struct qlcnic_adapter *, u8*);
        int (*config_bridged_mode) (struct qlcnic_adapter *, u32);
        int (*config_led) (struct qlcnic_adapter *, u32, u32);
        int (*start_firmware) (struct qlcnic_adapter *);