Merge tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[cascardo/linux.git] / drivers / net / ethernet / broadcom / tg3.h
index 9cd88a4..8d7d4c2 100644 (file)
 #define  MISC_HOST_CTRL_TAGGED_STATUS   0x00000200
 #define  MISC_HOST_CTRL_CHIPREV                 0xffff0000
 #define  MISC_HOST_CTRL_CHIPREV_SHIFT   16
-#define  GET_CHIP_REV_ID(MISC_HOST_CTRL) \
-        (((MISC_HOST_CTRL) & MISC_HOST_CTRL_CHIPREV) >> \
-         MISC_HOST_CTRL_CHIPREV_SHIFT)
+
 #define  CHIPREV_ID_5700_A0             0x7000
 #define  CHIPREV_ID_5700_A1             0x7001
 #define  CHIPREV_ID_5700_B0             0x7100
 #define  CHIPREV_ID_5719_A0             0x05719000
 #define  CHIPREV_ID_5720_A0             0x05720000
 #define  CHIPREV_ID_5762_A0             0x05762000
-#define  GET_ASIC_REV(CHIP_REV_ID)     ((CHIP_REV_ID) >> 12)
+
 #define   ASIC_REV_5700                         0x07
 #define   ASIC_REV_5701                         0x00
 #define   ASIC_REV_5703                         0x01
 #define   ASIC_REV_5720                         0x5720
 #define   ASIC_REV_57766                0x57766
 #define   ASIC_REV_5762                         0x5762
-#define  GET_CHIP_REV(CHIP_REV_ID)     ((CHIP_REV_ID) >> 8)
 #define   CHIPREV_5700_AX               0x70
 #define   CHIPREV_5700_BX               0x71
 #define   CHIPREV_5700_CX               0x72
 #define   CHIPREV_5784_AX               0x57840
 #define   CHIPREV_5761_AX               0x57610
 #define   CHIPREV_57765_AX              0x577650
-#define  GET_METAL_REV(CHIP_REV_ID)    ((CHIP_REV_ID) & 0xff)
 #define   METAL_REV_A0                  0x00
 #define   METAL_REV_A1                  0x01
 #define   METAL_REV_B0                  0x00
 #define  CPMU_MUTEX_GNT_DRIVER          0x00001000
 #define TG3_CPMU_PHY_STRAP             0x00003664
 #define TG3_CPMU_PHY_STRAP_IS_SERDES    0x00000020
+#define TG3_CPMU_PADRNG_CTL            0x00003668
+#define  TG3_CPMU_PADRNG_CTL_RDIV2      0x00040000
 /* 0x3664 --> 0x36b0 unused */
 
 #define TG3_CPMU_EEE_MODE              0x000036b0
@@ -3056,6 +3054,11 @@ enum TG3_FLAGS {
        TG3_FLAG_57765_PLUS,
        TG3_FLAG_57765_CLASS,
        TG3_FLAG_5717_PLUS,
+       TG3_FLAG_IS_SSB_CORE,
+       TG3_FLAG_FLUSH_POSTED_WRITES,
+       TG3_FLAG_ROBOSWITCH,
+       TG3_FLAG_ONE_DMA_AT_ONCE,
+       TG3_FLAG_RGMII_MODE,
 
        /* Add new flags before this comment and TG3_FLAG_NUMBER_OF_FLAGS */
        TG3_FLAG_NUMBER_OF_FLAGS,       /* Last entry in enum TG3_FLAGS */
@@ -3352,4 +3355,18 @@ struct tg3 {
        bool                            link_up;
 };
 
+/* Accessor macros for chip and asic attributes
+ *
+ * nb: Using static inlines equivalent to the accessor macros generates
+ *     larger object code with gcc 4.7.
+ *     Using statement expression macros to check tp with
+ *     typecheck(struct tg3 *, tp) also creates larger objects.
+ */
+#define tg3_chip_rev_id(tp)                                    \
+       ((tp)->pci_chip_rev_id)
+#define tg3_asic_rev(tp)                                       \
+       ((tp)->pci_chip_rev_id >> 12)
+#define tg3_chip_rev(tp)                                       \
+       ((tp)->pci_chip_rev_id >> 8)
+
 #endif /* !(_T3_H) */