]> 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 714ddf461d7310dd7cdd8284f1697e1a92c3f62a..42a288348aca22d0d458c325125e67289f5777f2 100644 (file)
@@ -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)
@@ -898,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
@@ -935,7 +946,7 @@ struct qlcnic_mac_req {
 struct qlcnic_filter {
        struct hlist_node fnode;
        u8 faddr[ETH_ALEN];
-       u16 vlan_id;
+       __le16 vlan_id;
        unsigned long ftime;
 };
 
@@ -1169,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;
@@ -1274,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);