From: Christian Lamparter Date: Fri, 4 Mar 2011 20:08:49 +0000 (+0100) Subject: carl9170 firmware: merge CARL9170FW_PSM with the standard RF code X-Git-Tag: 1.9.3~2 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=f064ea52ed3ab342b7f2d31ac88239ceac5bc214;p=carl9170fw.git carl9170 firmware: merge CARL9170FW_PSM with the standard RF code Signed-off-by: Christian Lamparter --- diff --git a/carlfw/Kconfig b/carlfw/Kconfig index fd1161e..68e7773 100644 --- a/carlfw/Kconfig +++ b/carlfw/Kconfig @@ -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" diff --git a/carlfw/include/carl9170.h b/carlfw/include/carl9170.h index b05d8be..72bd611 100644 --- a/carlfw/include/carl9170.h +++ b/carlfw/include/carl9170.h @@ -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; diff --git a/carlfw/src/cmd.c b/carlfw/src/cmd.c index fd8faf5..2bbfcff 100644 --- a/carlfw/src/cmd.c +++ b/carlfw/src/cmd.c @@ -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: diff --git a/carlfw/src/fw.c b/carlfw/src/fw.c index bad3b12..aed674f 100644 --- a/carlfw/src/fw.c +++ b/carlfw/src/fw.c @@ -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, diff --git a/carlfw/src/rf.c b/carlfw/src/rf.c index 8a98959..1022048 100644 --- a/carlfw/src/rf.c +++ b/carlfw/src/rf.c @@ -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 */ diff --git a/carlfw/src/wlan.c b/carlfw/src/wlan.c index 0e0b1dd..08836db 100644 --- a/carlfw/src/wlan.c +++ b/carlfw/src/wlan.c @@ -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)