ath9k: follow beacon hints on reg_notifier when world roaming
[safe/jmp/linux-2.6] / drivers / net / bnx2.h
index efa0ca9..704cbbc 100644 (file)
@@ -1,6 +1,6 @@
 /* bnx2.h: Broadcom NX2 network driver.
  *
- * Copyright (c) 2004-2007 Broadcom Corporation
+ * Copyright (c) 2004-2009 Broadcom Corporation
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -378,6 +378,9 @@ struct l2_fhdr {
  *  pci_config_l definition
  *  offset: 0000
  */
+#define BNX2_PCICFG_MSI_CONTROL                                0x00000058
+#define BNX2_PCICFG_MSI_CONTROL_ENABLE                  (1L<<16)
+
 #define BNX2_PCICFG_MISC_CONFIG                                0x00000068
 #define BNX2_PCICFG_MISC_CONFIG_TARGET_BYTE_SWAP        (1L<<2)
 #define BNX2_PCICFG_MISC_CONFIG_TARGET_MB_WORD_SWAP     (1L<<3)
@@ -4199,7 +4202,14 @@ struct l2_fhdr {
 
 #define BNX2_RBUF_CONFIG                               0x0020000c
 #define BNX2_RBUF_CONFIG_XOFF_TRIP                      (0x3ffL<<0)
+#define BNX2_RBUF_CONFIG_XOFF_TRIP_VAL(mtu)             \
+       ((((mtu) - 1500) * 31 / 1000) + 54)
 #define BNX2_RBUF_CONFIG_XON_TRIP                       (0x3ffL<<16)
+#define BNX2_RBUF_CONFIG_XON_TRIP_VAL(mtu)              \
+       ((((mtu) - 1500) * 39 / 1000) + 66)
+#define BNX2_RBUF_CONFIG_VAL(mtu)                       \
+       (BNX2_RBUF_CONFIG_XOFF_TRIP_VAL(mtu) |           \
+       (BNX2_RBUF_CONFIG_XON_TRIP_VAL(mtu) << 16))
 
 #define BNX2_RBUF_FW_BUF_ALLOC                         0x00200010
 #define BNX2_RBUF_FW_BUF_ALLOC_VALUE                    (0x1ffL<<7)
@@ -4221,11 +4231,25 @@ struct l2_fhdr {
 
 #define BNX2_RBUF_CONFIG2                              0x0020001c
 #define BNX2_RBUF_CONFIG2_MAC_DROP_TRIP                         (0x3ffL<<0)
+#define BNX2_RBUF_CONFIG2_MAC_DROP_TRIP_VAL(mtu)        \
+       ((((mtu) - 1500) * 4 / 1000) + 5)
 #define BNX2_RBUF_CONFIG2_MAC_KEEP_TRIP                         (0x3ffL<<16)
+#define BNX2_RBUF_CONFIG2_MAC_KEEP_TRIP_VAL(mtu)        \
+       ((((mtu) - 1500) * 2 / 100) + 30)
+#define BNX2_RBUF_CONFIG2_VAL(mtu)                      \
+       (BNX2_RBUF_CONFIG2_MAC_DROP_TRIP_VAL(mtu) |      \
+       (BNX2_RBUF_CONFIG2_MAC_KEEP_TRIP_VAL(mtu) << 16))
 
 #define BNX2_RBUF_CONFIG3                              0x00200020
 #define BNX2_RBUF_CONFIG3_CU_DROP_TRIP                  (0x3ffL<<0)
+#define BNX2_RBUF_CONFIG3_CU_DROP_TRIP_VAL(mtu)                 \
+       ((((mtu) - 1500) * 12 / 1000) + 18)
 #define BNX2_RBUF_CONFIG3_CU_KEEP_TRIP                  (0x3ffL<<16)
+#define BNX2_RBUF_CONFIG3_CU_KEEP_TRIP_VAL(mtu)                 \
+       ((((mtu) - 1500) * 2 / 100) + 30)
+#define BNX2_RBUF_CONFIG3_VAL(mtu)                      \
+       (BNX2_RBUF_CONFIG3_CU_DROP_TRIP_VAL(mtu) |       \
+       (BNX2_RBUF_CONFIG3_CU_KEEP_TRIP_VAL(mtu) << 16))
 
 #define BNX2_RBUF_PKT_DATA                             0x00208000
 #define BNX2_RBUF_CLIST_DATA                           0x00210000
@@ -6440,6 +6464,11 @@ struct l2_fhdr {
 
 #define BNX2_MISC_ENABLE_DEFAULT       0x17ffffff
 
+#define BNX2_START_UNICAST_ADDRESS_INDEX       4
+#define BNX2_END_UNICAST_ADDRESS_INDEX         7
+#define BNX2_MAX_UNICAST_ADDRESSES             (BNX2_END_UNICAST_ADDRESS_INDEX - \
+                                        BNX2_START_UNICAST_ADDRESS_INDEX + 1)
+
 #define DMA_READ_CHANS 5
 #define DMA_WRITE_CHANS        3
 
@@ -6504,6 +6533,9 @@ struct l2_fhdr {
 #define RX_CID         0
 #define RX_RSS_CID     4
 #define RX_MAX_RSS_RINGS       7
+#define RX_MAX_RINGS           (RX_MAX_RSS_RINGS + 1)
+#define TX_MAX_TSS_RINGS       7
+#define TX_MAX_RINGS           (TX_MAX_TSS_RINGS + 1)
 
 #define MB_TX_CID_ADDR MB_GET_CID_ADDR(TX_CID)
 #define MB_RX_CID_ADDR MB_GET_CID_ADDR(RX_CID)
@@ -6518,10 +6550,14 @@ struct sw_pg {
        DECLARE_PCI_UNMAP_ADDR(mapping)
 };
 
+struct sw_tx_bd {
+       struct sk_buff          *skb;
+};
+
 #define SW_RXBD_RING_SIZE (sizeof(struct sw_bd) * RX_DESC_CNT)
 #define SW_RXPG_RING_SIZE (sizeof(struct sw_pg) * RX_DESC_CNT)
 #define RXBD_RING_SIZE (sizeof(struct rx_bd) * RX_DESC_CNT)
-#define SW_TXBD_RING_SIZE (sizeof(struct sw_bd) * TX_DESC_CNT)
+#define SW_TXBD_RING_SIZE (sizeof(struct sw_tx_bd) * TX_DESC_CNT)
 #define TXBD_RING_SIZE (sizeof(struct tx_bd) * TX_DESC_CNT)
 
 /* Buffered flash (Atmel: AT45DB011B) specific information */
@@ -6589,9 +6625,9 @@ struct flash_spec {
 
 struct bnx2_irq {
        irq_handler_t   handler;
-       u16             vector;
+       unsigned int    vector;
        u8              requested;
-       char            name[16];
+       char            name[IFNAMSIZ + 2];
 };
 
 struct bnx2_tx_ring_info {
@@ -6601,7 +6637,7 @@ struct bnx2_tx_ring_info {
        u32                     tx_bseq_addr;
 
        struct tx_bd            *tx_desc_ring;
-       struct sw_bd            *tx_buf_ring;
+       struct sw_tx_bd         *tx_buf_ring;
 
        u16                     tx_cons;
        u16                     hw_tx_cons;
@@ -6670,6 +6706,7 @@ struct bnx2 {
 #define BNX2_FLAG_USING_MSI_OR_MSIX    (BNX2_FLAG_USING_MSI | \
                                         BNX2_FLAG_USING_MSIX)
 #define BNX2_FLAG_JUMBO_BROKEN         0x00000800
+#define BNX2_FLAG_CAN_KEEP_VLAN                0x00001000
 
        struct bnx2_napi        bnx2_napi[BNX2_MAX_MSIX_VEC];
 
@@ -6692,10 +6729,11 @@ struct bnx2 {
 
        /* End of fields used in the performance code paths. */
 
-       char                    *name;
+       unsigned int            current_interval;
+#define BNX2_TIMER_INTERVAL            HZ
+#define BNX2_SERDES_AN_TIMEOUT         (HZ / 3)
+#define BNX2_SERDES_FORCED_TIMEOUT     (HZ / 10)
 
-       int                     timer_interval;
-       int                     current_interval;
        struct                  timer_list timer;
        struct work_struct      reset_task;
 
@@ -6810,9 +6848,6 @@ struct bnx2 {
        u8                      flow_ctrl;      /* actual flow ctrl settings */
                                                /* may be different from     */
                                                /* req_flow_ctrl if autoneg  */
-#define FLOW_CTRL_TX           1
-#define FLOW_CTRL_RX           2
-
        u32                     advertising;
 
        u8                      req_flow_ctrl;  /* flow ctrl advertisement */
@@ -6827,8 +6862,6 @@ struct bnx2 {
 #define PHY_LOOPBACK           2
 
        u8                      serdes_an_pending;
-#define SERDES_AN_TIMEOUT      (HZ / 3)
-#define SERDES_FORCED_TIMEOUT  (HZ / 10)
 
        u8                      mac_addr[8];
 
@@ -6839,8 +6872,6 @@ struct bnx2 {
        int                     pm_cap;
        int                     pcix_cap;
 
-       struct net_device_stats net_stats;
-
        struct flash_spec       *flash_info;
        u32                     flash_size;
 
@@ -6851,6 +6882,9 @@ struct bnx2 {
 
        u8                      num_tx_rings;
        u8                      num_rx_rings;
+
+       u32                     idle_chk_status_idx;
+
 };
 
 #define REG_RD(bp, offset)                                     \
@@ -6926,14 +6960,14 @@ struct fw_info {
 /* This value (in milliseconds) determines the frequency of the driver
  * issuing the PULSE message code.  The firmware monitors this periodic
  * pulse to determine when to switch to an OS-absent mode. */
-#define DRV_PULSE_PERIOD_MS                 250
+#define BNX2_DRV_PULSE_PERIOD_MS                 250
 
 /* This value (in milliseconds) determines how long the driver should
  * wait for an acknowledgement from the firmware before timing out.  Once
  * the firmware has timed out, the driver will assume there is no firmware
  * running and there won't be any firmware-driver synchronization during a
  * driver reset. */
-#define FW_ACK_TIME_OUT_MS                  1000
+#define BNX2_FW_ACK_TIME_OUT_MS                  1000
 
 
 #define BNX2_DRV_RESET_SIGNATURE               0x00000000
@@ -6951,6 +6985,7 @@ struct fw_info {
 #define BNX2_DRV_MSG_CODE_DIAG                  0x07000000
 #define BNX2_DRV_MSG_CODE_SUSPEND_NO_WOL        0x09000000
 #define BNX2_DRV_MSG_CODE_UNLOAD_LNK_DN                 0x0b000000
+#define BNX2_DRV_MSG_CODE_KEEP_VLAN_UPDATE      0x0d000000
 #define BNX2_DRV_MSG_CODE_CMD_SET_LINK          0x10000000
 
 #define BNX2_DRV_MSG_DATA                       0x00ff0000
@@ -7279,6 +7314,10 @@ struct fw_info {
 #define BNX2_FW_CAP_SIGNATURE_MASK              0xffff0000
 #define BNX2_FW_CAP_REMOTE_PHY_CAPABLE          0x00000001
 #define BNX2_FW_CAP_REMOTE_PHY_PRESENT          0x00000002
+#define BNX2_FW_CAP_MFW_CAN_KEEP_VLAN           0x00000008
+#define BNX2_FW_CAP_BC_CAN_KEEP_VLAN            0x00000010
+#define BNX2_FW_CAP_CAN_KEEP_VLAN      (BNX2_FW_CAP_BC_CAN_KEEP_VLAN | \
+                                        BNX2_FW_CAP_MFW_CAN_KEEP_VLAN)
 
 #define BNX2_RPHY_SIGNATURE                    0x36c
 #define BNX2_RPHY_LOAD_SIGNATURE                0x5a5a5a5a