carl9170 firmware: fix ar9170_stream struct
[carl9170fw.git] / include / shared / hw.h
index 13b7b754cc4dfa1226ed4191dfeb78c538d0d8f6..c59e5af511d01554123f4a2b9f6a56f96f0108fc 100644 (file)
@@ -1,7 +1,7 @@
 /*
- * Atheros AR9170 driver
+ * Shared Atheros AR9170 Header
  *
- * Hardware-specific definitions
+ * Register map, hardware-specific definitions
  *
  * Copyright 2008, Johannes Berg <johannes@sipsolutions.net>
  * Copyright 2009, 2010, Christian Lamparter <chunkeey@googlemail.com>
 #define        AR9170_MAC_REG_PRETBTT                  (AR9170_MAC_REG_BASE + 0x524)
 #define                AR9170_MAC_PRETBTT_S                    0
 #define                AR9170_MAC_PRETBTT                      0x0000ffff
+#define                AR9170_MAC_PRETBTT2_S                   16
+#define                AR9170_MAC_PRETBTT2                     0xffff0000
 
 #define        AR9170_MAC_REG_MAC_ADDR_L               (AR9170_MAC_REG_BASE + 0x610)
 #define        AR9170_MAC_REG_MAC_ADDR_H               (AR9170_MAC_REG_BASE + 0x614)
 #define                AR9170_MAC_CAM_STA                      0x2
 #define                AR9170_MAC_CAM_AP_WDS                   0x3
 #define                AR9170_MAC_CAM_DEFAULTS                 (0xf << 24)
-/* BEACON specification bits */
-#define                AR9170_MAC_CAM_AP_MODE                  0x01000000
-#define                AR9170_MAC_CAM_IBSS_MODE                0x02000000
-#define                AR9170_MAC_CAM_POWER_MNT                0x04000000
-#define                AR9170_MAC_CAM_STA_PS                   0x08000000
 #define                AR9170_MAC_CAM_HOST_PENDING             0x80000000
 
 #define        AR9170_MAC_REG_CAM_ROLL_CALL_TBL_L      (AR9170_MAC_REG_BASE + 0x704)
 #define        AR9170_CAM_MAX_USER                     64
 #define        AR9170_CAM_MAX_KEY_LENGTH               16
 
-#define AR9170_PRAM_OFFSET                     0x200000
+#define AR9170_SRAM_OFFSET             0x100000
+#define AR9170_SRAM_SIZE               0x18000
+
+#define AR9170_PRAM_OFFSET             0x200000
+#define AR9170_PRAM_SIZE               0x8000
 
 enum cpu_clock {
        AHB_STATIC_40MHZ = 0,
@@ -711,7 +712,8 @@ struct ar9170_stream {
        __le16 tag;
 
        u8 payload[0];
-};
+} __packed __aligned(4);
+#define AR9170_STREAM_LEN                              4
 
 #define AR9170_MAX_ACKTABLE_ENTRIES                    8
 #define AR9170_MAX_VIRTUAL_MAC                         7
@@ -730,6 +732,9 @@ struct ar9170_stream {
 #define SET_VAL(reg, value, newvalue)                                  \
        (value = ((value) & ~reg) | (((newvalue) << reg##_S) & reg))
 
+#define SET_CONSTVAL(reg, newvalue)                                    \
+       (((newvalue) << reg##_S) & reg)
+
 #define MOD_VAL(reg, value, newvalue)                                  \
        (((value) & ~reg) | (((newvalue) << reg##_S) & reg))
 #endif /* __CARL9170_SHARED_HW_H */