carl9170 firmware: merge CARL9170FW_PSM with the standard RF code
authorChristian Lamparter <chunkeey@googlemail.com>
Fri, 4 Mar 2011 20:08:49 +0000 (21:08 +0100)
committerChristian Lamparter <chunkeey@googlemail.com>
Fri, 4 Mar 2011 20:08:49 +0000 (21:08 +0100)
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
carlfw/Kconfig
carlfw/include/carl9170.h
carlfw/src/cmd.c
carlfw/src/fw.c
carlfw/src/rf.c
carlfw/src/wlan.c

index fd1161e816dc04f53b8fa8ee867b9e4f9a1853a2..68e7773656e3ef0815733ba29bec225be1bb49f3 100644 (file)
@@ -114,16 +114,6 @@ config CARL9170FW_EXPERIMENTAL
        def_bool y
        prompt "Experimental Features"
 
-config CARL9170FW_PSM
-       def_bool y
-       prompt "Firmware Supported Power-saving Management"
-       depends on CARL9170FW_EXPERIMENTAL && CARL9170FW_RADIO_FUNCTIONS
-       ---help---
-        This options enables a interface for the application to
-        switch off the RF/PHY (in order to save power). And the
-        Firmware will automatically turn it on again, when the
-        PRETBTT event fires.
-
 config CARL9170FW_WOL_OPTION
        def_bool n
        prompt "Wakeup on WLAN"
index b05d8beaec22ee3a70ae31078d1d0b72310e94f7..72bd6118a34029673d8d1946d0f9c59722f78b47 100644 (file)
@@ -182,9 +182,7 @@ struct firmware_context_struct {
                unsigned int frequency;
                unsigned int ht_settings;
 
-#ifdef CONFIG_CARL9170FW_PSM
                struct carl9170_psm psm;
-#endif /* CONFIG_CARL9170FW_PSM */
 #endif /* CONFIG_CARL9170FW_RADIO_FUNCTIONS */
        } phy;
 
index fd8faf588e66c957915f2c95ef92d0df92195f24..2bbfcffaa71f1cacbdda4b33ddcee3e60eef8c72 100644 (file)
@@ -128,13 +128,11 @@ void handle_cmd(struct carl9170_rsp *resp)
                rf_notify_set_channel();
                break;
 
-# ifdef CONFIG_CARL9170FW_PSM
        case CARL9170_CMD_PSM:
                resp->hdr.len = 0;
                fw.phy.psm.state = le32_to_cpu(cmd->psm.state);
                rf_psm();
                break;
-# endif /* CONFIG_CARL9170FW_PSM */
 #endif /* CONFIG_CARL9170FW_RADIO_FUNCTIOS */
 
        default:
index bad3b1266190a61dd96d94dc38e921b50ebb2627..aed674fb1b41bbde42f360d9cac1fb2176c0d53d 100644 (file)
@@ -35,6 +35,8 @@ const struct carl9170_firmware_descriptor __section(fwdsc) carl9170fw_desc = {
        FILL(otus, OTUS,
             .feature_set = cpu_to_le32(BIT(CARL9170FW_DUMMY_FEATURE) |
                                        BIT(CARL9170FW_USB_RESP_EP2) |
+                                       BIT(CARL9170FW_PSM) |
+                                       BIT(CARL9170FW_RX_FILTER) |
 #ifdef CONFIG_CARL9170FW_USB_INIT_FIRMWARE
                                        BIT(CARL9170FW_USB_INIT_FIRMWARE) |
 # ifdef CONFIG_CARL9170FW_USB_UP_STREAM
@@ -62,14 +64,10 @@ const struct carl9170_firmware_descriptor __section(fwdsc) carl9170fw_desc = {
 #ifdef CONFIG_CARL9170FW_GPIO_INTERRUPT
                                        BIT(CARL9170FW_GPIO_INTERRUPT) |
 #endif /* CONFIG_CARL9170FW_GPIO_INTERRUPT */
-#ifdef CONFIG_CARL9170FW_PSM
-                                       BIT(CARL9170FW_PSM) |
-#endif /* CONFIG_CARL9170FW_PSM */
-                                       BIT(CARL9170FW_RX_FILTER) |
 #ifdef CONFIG_CARL9170FW_WOL
                                        BIT(CARL9170FW_WOL) |
 #endif /* CONFIG_CARL9170FW_WOL */
-                                          (0)),
+                                       (0)),
 
             .miniboot_size = cpu_to_le16(0),
             .tx_descs = AR9170_TX_BLOCK_NUMBER,
index 8a9895914990d82817a86ddbb28c9d954ffd651b..10220481d3e8514e04c1ab1010dd73a81ae87538 100644 (file)
@@ -215,7 +215,6 @@ void rf_cmd(const struct carl9170_cmd *cmd, struct carl9170_rsp *resp)
        resp->rf_init_res.ret = cpu_to_le32(ret);
 }
 
-#ifdef CONFIG_CARL9170FW_PSM
 void rf_psm(void)
 {
        u32 bank3;
@@ -275,6 +274,5 @@ void rf_psm(void)
 
        set(0x1c58f0, bank3);
 }
-#endif /* CONFIG_CARL9170FW_PSM */
 
 #endif /* CONFIG_CARL9170FW_RADIO_FUNCTIONS */
index 0e0b1dd144b27c4254b0f8fbd0d53278e296c849..08836db4d9781afa7d9f192aa5c6a528c343b0ce 100644 (file)
@@ -307,9 +307,9 @@ static void __wlan_tx(struct dma_desc *desc)
 # endif
 #else /* CONFIG_CARL9170FW_LOOPBACK */
 
-# if ((defined CONFIG_CARL9170FW_DEBUG) && (defined CONFIG_CARL9170FW_PSM))
+# ifdef CONFIG_CARL9170FW_DEBUG
        BUG_ON(fw.phy.psm.state != CARL9170_PSM_WAKE);
-# endif /* CONFIG_CARL9170FW_DEBUG && CONFIG_CARL9170FW_PSM */
+# endif /* CONFIG_CARL9170FW_DEBUG */
 
        /* insert desc into the right queue */
        dma_put(&fw.wlan.tx_queue[super->s.queue], desc);
@@ -985,14 +985,10 @@ static void handle_pretbtt(void)
        fw.wlan.cab_flush_time = get_clock_counter();
 #endif /* CONFIG_CARL9170FW_CAB_QUEUE */
 
-#ifdef CONFIG_CARL9170FW_PSM
        rf_psm();
 
        send_cmd_to_host(4, CARL9170_RSP_PRETBTT, 0x00,
                         (uint8_t *) &fw.phy.psm.state);
-#else
-       send_cmd_to_host(0, CARL9170_RSP_PRETBTT, 0x00, NULL);
-#endif /* CONFIG_CARL9170FW_PSM */
 }
 
 static void handle_atim(void)