net: wireless: bcmdhd: Allow Improved suspend/resume processing on 2.6.39
[linux-2.6.git] / drivers / net / niu.h
index 35e9afb..51e177e 100644 (file)
 #define XMAC_ADDR1                     0x000a8UL
 #define  XMAC_ADDR1_ADDR1              0x000000000000ffffULL
 
-#define XMAC_ADDR2                     0x000b0UL 
+#define XMAC_ADDR2                     0x000b0UL
 #define  XMAC_ADDR2_ADDR2              0x000000000000ffffULL
 
 #define XMAC_ADDR_CMPEN                        0x00208UL
 #define  PLL_CFG_LD_SHIFT              8
 #define  PLL_CFG_MPY                   0x0000001e
 #define  PLL_CFG_MPY_SHIFT             1
+#define  PLL_CFG_MPY_4X                0x0
+#define  PLL_CFG_MPY_5X                0x00000002
+#define  PLL_CFG_MPY_6X                0x00000004
+#define  PLL_CFG_MPY_8X                0x00000008
+#define  PLL_CFG_MPY_10X               0x0000000a
+#define  PLL_CFG_MPY_12X               0x0000000c
+#define  PLL_CFG_MPY_12P5X             0x0000000e
 #define  PLL_CFG_ENPLL                 0x00000001
 
 #define ESR2_TI_PLL_STS_L              (ESR2_BASE + 0x002)
 #define  PLL_TX_CFG_INVPAIR            0x00000080
 #define  PLL_TX_CFG_RATE               0x00000060
 #define  PLL_TX_CFG_RATE_SHIFT         5
+#define  PLL_TX_CFG_RATE_FULL          0x0
+#define  PLL_TX_CFG_RATE_HALF          0x20
+#define  PLL_TX_CFG_RATE_QUAD          0x40
 #define  PLL_TX_CFG_BUSWIDTH           0x0000001c
 #define  PLL_TX_CFG_BUSWIDTH_SHIFT     2
 #define  PLL_TX_CFG_ENTEST             0x00000002
 #define  PLL_RX_CFG_INVPAIR            0x00000080
 #define  PLL_RX_CFG_RATE               0x00000060
 #define  PLL_RX_CFG_RATE_SHIFT         5
+#define  PLL_RX_CFG_RATE_FULL          0x0
+#define  PLL_RX_CFG_RATE_HALF          0x20
+#define  PLL_RX_CFG_RATE_QUAD          0x40
 #define  PLL_RX_CFG_BUSWIDTH           0x0000001c
 #define  PLL_RX_CFG_BUSWIDTH_SHIFT     2
 #define  PLL_RX_CFG_ENTEST             0x00000002
@@ -2537,6 +2550,7 @@ struct fcram_hash_ipv6 {
 
 #define NIU_PHY_ID_MASK                        0xfffff0f0
 #define NIU_PHY_ID_BCM8704             0x00206030
+#define NIU_PHY_ID_BCM8706             0x00206035
 #define NIU_PHY_ID_BCM5464R            0x002060b0
 #define NIU_PHY_ID_MRVL88X2011         0x01410020
 
@@ -2692,7 +2706,7 @@ struct rx_pkt_hdr0 {
 #if defined(__LITTLE_ENDIAN_BITFIELD)
        u8      inputport:2,
                maccheck:1,
-               class:4;
+               class:5;
        u8      vlan:1,
                llcsnap:1,
                noport:1,
@@ -2701,7 +2715,7 @@ struct rx_pkt_hdr0 {
                tres:2,
                tzfvld:1;
 #elif defined(__BIG_ENDIAN_BITFIELD)
-       u8      class:4,
+       u8      class:5,
                maccheck:1,
                inputport:2;
        u8      tzfvld:1,
@@ -2761,6 +2775,9 @@ struct rx_pkt_hdr1 {
        /* Bits 7:0 of hash value, H1.  */
        u8      hashval1_2;
 
+       u8      hwrsvd5;
+       u8      hwrsvd6;
+
        u8      usrdata_0;      /* Bits 39:32 of user data.  */
        u8      usrdata_1;      /* Bits 31:24 of user data.  */
        u8      usrdata_2;      /* Bits 23:16 of user data.  */
@@ -2945,6 +2962,15 @@ struct rx_ring_info {
 #define        NIU_ALONSO_BM_STR       "373-0202"
 #define        NIU_FOXXY_BM_STR        "501-7961"
 #define        NIU_2XGF_MRVL_BM_STR    "SK-6E82"
+#define        NIU_QGC_LP_MDL_STR      "SUNW,pcie-qgc"
+#define        NIU_2XGF_LP_MDL_STR     "SUNW,pcie-2xgf"
+#define        NIU_QGC_PEM_MDL_STR     "SUNW,pcie-qgc-pem"
+#define        NIU_2XGF_PEM_MDL_STR    "SUNW,pcie-2xgf-pem"
+#define        NIU_ALONSO_MDL_STR      "SUNW,CP3220"
+#define        NIU_KIMI_MDL_STR        "SUNW,CP3260"
+#define        NIU_MARAMBA_MDL_STR     "SUNW,pcie-neptune"
+#define        NIU_FOXXY_MDL_STR       "SUNW,pcie-rfem"
+#define        NIU_2XGF_MRVL_MDL_STR   "SysKonnect,pcie-2xgf"
 
 #define NIU_VPD_MIN_MAJOR      3
 #define NIU_VPD_MIN_MINOR      4
@@ -2981,7 +3007,9 @@ struct niu_classifier {
        struct niu_altmac_rdc   alt_mac_mappings[16];
        struct niu_vlan_rdc     vlan_mappings[ENET_VLAN_TBL_NUM_ENTRIES];
 
-       u16                     tcam_index;
+       u16                     tcam_top;
+       u16                     tcam_sz;
+       u16                     tcam_valid_entries;
        u16                     num_alt_mac_mappings;
 
        u32                     h1_init;
@@ -3017,6 +3045,7 @@ struct phy_probe_info {
 };
 
 struct niu_tcam_entry {
+       u8                      valid;
        u64                     key[4];
        u64                     key_mask[4];
        u64                     assoc_data;
@@ -3084,10 +3113,15 @@ struct niu_parent {
        struct phy_probe_info   phy_probe_info;
 
        struct niu_tcam_entry   tcam[NIU_TCAM_ENTRIES_MAX];
-       u64                     l2_cls[2];
-       u64                     l3_cls[4];
+
+#define        NIU_L2_PROG_CLS         2
+#define        NIU_L3_PROG_CLS         4
+       u64                     l2_cls[NIU_L2_PROG_CLS];
+       u64                     l3_cls[NIU_L3_PROG_CLS];
        u64                     tcam_key[12];
        u64                     flow_key[12];
+       u16                     l3_cls_refcnt[NIU_L3_PROG_CLS];
+       u8                      l3_cls_pid[NIU_L3_PROG_CLS];
 };
 
 struct niu_ops {
@@ -3108,16 +3142,19 @@ struct niu_ops {
 };
 
 struct niu_link_config {
+       u32                             supported;
+
        /* Describes what we're trying to get. */
        u32                             advertising;
-       u32                             supported;
        u16                             speed;
        u8                              duplex;
        u8                              autoneg;
 
        /* Describes what we actually have. */
+       u32                             active_advertising;
        u16                             active_speed;
        u8                              active_duplex;
+       u8                              active_autoneg;
 #define SPEED_INVALID          0xffff
 #define DUPLEX_INVALID         0xff
 #define AUTONEG_INVALID                0xff
@@ -3199,7 +3236,7 @@ struct niu_phy_ops {
        int (*link_status)(struct niu *np, int *);
 };
 
-struct of_device;
+struct platform_device;
 struct niu {
        void __iomem                    *regs;
        struct net_device               *dev;
@@ -3208,6 +3245,8 @@ struct niu {
        struct niu_parent               *parent;
 
        u32                             flags;
+#define NIU_FLAGS_HOTPLUG_PHY_PRESENT  0x02000000 /* Removeable PHY detected*/
+#define NIU_FLAGS_HOTPLUG_PHY          0x01000000 /* Removeable PHY */
 #define NIU_FLAGS_VPD_VALID            0x00800000 /* VPD has valid version */
 #define NIU_FLAGS_MSIX                 0x00400000 /* MSI-X in use */
 #define NIU_FLAGS_MCAST                        0x00200000 /* multicast filter enabled */
@@ -3218,12 +3257,12 @@ struct niu {
 #define NIU_FLAGS_XMAC                 0x00010000 /* 0=BMAC 1=XMAC */
 
        u32                             msg_enable;
+       char                            irq_name[NIU_NUM_RXCHAN+NIU_NUM_TXCHAN+3][IFNAMSIZ + 6];
 
        /* Protects hw programming, and ring state.  */
        spinlock_t                      lock;
 
        const struct niu_ops            *ops;
-       struct net_device_stats         net_stats;
        union niu_mac_stats             mac_stats;
 
        struct rx_ring_info             *rx_rings;
@@ -3240,6 +3279,7 @@ struct niu {
        unsigned long                   xpcs_off;
 
        struct timer_list               timer;
+       u64                             orig_led_state;
        const struct niu_phy_ops        *phy_ops;
        int                             phy_addr;
 
@@ -3258,7 +3298,7 @@ struct niu {
        struct niu_vpd                  vpd;
        u32                             eeprom_len;
 
-       struct of_device                *op;
+       struct platform_device          *op;
        void __iomem                    *vir_regs_1;
        void __iomem                    *vir_regs_2;
 };