#ifdef CONFIG_CARL9170FW_CAB_QUEUE
enum carl9170_cab_trigger {
CARL9170_CAB_TRIGGER_EMPTY = 0,
- CARL9170_CAB_TRIGGER_READY = BIT(0),
- CARL9170_CAB_TRIGGER_ARMED = BIT(1),
- CARL9170_CAB_TRIGGER_DEFER = BIT(2),
+ CARL9170_CAB_TRIGGER_ARMED = BIT(0),
+ CARL9170_CAB_TRIGGER_DEFER = BIT(1),
};
#endif /* CONFIG_CARL9170FW_CAB_QUEUE */
BUILD_BUG_ON(sizeof(struct carl9170_rf_init_result) != CARL9170_RF_INIT_RESULT_SIZE);
BUILD_BUG_ON(sizeof(struct carl9170_psm) != CARL9170_PSM_SIZE);
BUILD_BUG_ON(sizeof(struct carl9170_tsf_rsp) != CARL9170_TSF_RSP_SIZE);
- BUILD_BUG_ON(sizeof(struct carl9170_cab_flush_cmd) != CARL9170_CAB_FLUSH_CMD_SIZE);
+ BUILD_BUG_ON(sizeof(struct carl9170_bcn_ctrl_cmd) != CARL9170_BCN_CTRL_CMD_SIZE);
BUILD_BUG_ON(sizeof(struct carl9170_tx_status) != CARL9170_TX_STATUS_SIZE);
BUILD_BUG_ON(sizeof(struct _carl9170_tx_status) != CARL9170_TX_STATUS_SIZE);
BUILD_BUG_ON(sizeof(struct carl9170_gpio) != CARL9170_GPIO_SIZE);
break;
#ifdef CONFIG_CARL9170FW_CAB_QUEUE
- case CARL9170_CMD_FLUSH_CAB:
+ case CARL9170_CMD_BCN_CTRL:
resp->hdr.len = 0;
- if (cmd->cab_flush.mode & CARL9170_CAB_FLUSH_CAB_TRIGGER) {
- wlan_cab_modify_dtim_beacon(cmd->cab_flush.vif_id);
+ if (cmd->bcn_ctrl.mode & CARL9170_BCN_CTRL_CAB_TRIGGER) {
+ wlan_cab_modify_dtim_beacon(cmd->bcn_ctrl.vif_id);
+ set(AR9170_MAC_REG_BCN_ADDR, cmd->bcn_ctrl.bcn_addr);
+ set(AR9170_MAC_REG_BCN_LENGTH, cmd->bcn_ctrl.bcn_len);
set(AR9170_MAC_REG_BCN_CTRL, AR9170_BCN_CTRL_READY);
} else {
- wlan_cab_flush_queue(cmd->cab_flush.vif_id);
+ wlan_cab_flush_queue(cmd->bcn_ctrl.vif_id);
fw.wlan.cab_flush_trigger[i] = CARL9170_CAB_TRIGGER_EMPTY;
}
break;
fw.wlan.cab_flush_trigger[vif] = CARL9170_CAB_TRIGGER_EMPTY;
}
- /* Triggered by CARL9170_CAB_TRIGGER_ARMED || CARL9170_CAB_TRIGGER_READY || CARL9170_CAB_TRIGGER_DEFER */
+ /* Triggered by CARL9170_CAB_TRIGGER_ARMED || CARL9170_CAB_TRIGGER_DEFER */
if (fw.wlan.cab_flush_trigger[vif]) {
/* Set the almighty Multicast Traffic Indication Bit. */
ie->bitmap_ctrl |= 0x1;
bcn_count = get(AR9170_MAC_REG_BCN_COUNT);
send_cmd_to_host(4, CARL9170_RSP_BEACON_CONFIG, 0x00,
(uint8_t *) &bcn_count);
+
+ set(AR9170_MAC_REG_BCN_CTRL, AR9170_BCN_CTRL_READY);
}
static void handle_pretbtt(void)
{
#ifdef CONFIG_CARL9170FW_CAB_QUEUE
-#if CARL9170_INTF_NUM != 2
- /* GCC BUG ? */
- unsigned int i;
-
- for (i = 0; i < CARL9170_INTF_NUM; i++) {
- if (unlikely(fw.wlan.cab_flush_trigger[i] == CARL9170_CAB_TRIGGER_ARMED))
- fw.wlan.cab_flush_trigger[i] = CARL9170_CAB_TRIGGER_READY;
- }
-#else
- if (unlikely(fw.wlan.cab_flush_trigger[0] == CARL9170_CAB_TRIGGER_ARMED))
- fw.wlan.cab_flush_trigger[0] = CARL9170_CAB_TRIGGER_READY;
- if (unlikely(fw.wlan.cab_flush_trigger[1] == CARL9170_CAB_TRIGGER_ARMED))
- fw.wlan.cab_flush_trigger[1] = CARL9170_CAB_TRIGGER_READY;
-#endif
-
fw.wlan.cab_flush_time = get_clock_counter();
#endif /* CONFIG_CARL9170FW_CAB_QUEUE */
unsigned int i;
for (i = 0; i < CARL9170_INTF_NUM; i++) {
- if (unlikely(fw.wlan.cab_flush_trigger[i] == CARL9170_CAB_TRIGGER_READY)) {
+ if (unlikely(fw.wlan.cab_flush_trigger[i] == CARL9170_CAB_TRIGGER_ARMED)) {
/*
* This is hardcoded into carl9170usb driver.
*
CARL9170_CMD_ECHO = 0x02,
CARL9170_CMD_SWRST = 0x03,
CARL9170_CMD_REBOOT = 0x04,
- CARL9170_CMD_FLUSH_CAB = 0x05,
+ CARL9170_CMD_BCN_CTRL = 0x05,
CARL9170_CMD_READ_TSF = 0x06,
/* CAM */
CARL9170_CMD_ASYNC_FLAG),
CARL9170_CMD_REBOOT_ASYNC = (CARL9170_CMD_REBOOT |
CARL9170_CMD_ASYNC_FLAG),
- CARL9170_CMD_FLUSH_CAB_ASYNC = (CARL9170_CMD_FLUSH_CAB |
+ CARL9170_CMD_BCN_CTRL_ASYNC = (CARL9170_CMD_BCN_CTRL |
CARL9170_CMD_ASYNC_FLAG),
CARL9170_CMD_PSM_ASYNC = (CARL9170_CMD_PSM |
CARL9170_CMD_ASYNC_FLAG),
} __packed;
#define CARL9170_PSM_SIZE 4
-struct carl9170_cab_flush_cmd {
+struct carl9170_bcn_ctrl_cmd {
__le32 vif_id;
__le32 mode;
+ __le32 bcn_addr;
+ __le32 bcn_len;
} __packed;
-#define CARL9170_CAB_FLUSH_CMD_SIZE 8
+#define CARL9170_BCN_CTRL_CMD_SIZE 16
-#define CARL9170_CAB_FLUSH_DRAIN 0
-#define CARL9170_CAB_FLUSH_CAB_TRIGGER 1
+#define CARL9170_BCN_CTRL_DRAIN 0
+#define CARL9170_BCN_CTRL_CAB_TRIGGER 1
struct carl9170_cmd_head {
union {
struct carl9170_write_reg wreg;
struct carl9170_rf_init rf_init;
struct carl9170_psm psm;
- struct carl9170_cab_flush_cmd cab_flush;
+ struct carl9170_bcn_ctrl_cmd bcn_ctrl;
u8 data[CARL9170_MAX_CMD_PAYLOAD_LEN];
} __packed;
} __packed;
#define CARL9170FW_DESC_HEAD_SIZE \
(sizeof(struct carl9170fw_desc_head))
-#define CARL9170FW_OTUS_DESC_MIN_VER 5
-#define CARL9170FW_OTUS_DESC_CUR_VER 5
+#define CARL9170FW_OTUS_DESC_MIN_VER 6
+#define CARL9170FW_OTUS_DESC_CUR_VER 6
struct carl9170fw_otus_desc {
struct carl9170fw_desc_head head;
__le32 feature_set;