X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=carlfw%2Finclude%2Fdma.h;h=8141b1c5ad4344cc3c919bc217096e9514a283a8;hb=b94cc57fa4ee29cb70415b699a1efc5f66eb41c7;hp=11a760dfc98139cb68c921d188d1cc19c8b71941;hpb=bf38ae52cd2ec91f5abeadc00c4e17fc647c2bc0;p=carl9170fw.git diff --git a/carlfw/include/dma.h b/carlfw/include/dma.h index 11a760d..8141b1c 100644 --- a/carlfw/include/dma.h +++ b/carlfw/include/dma.h @@ -19,8 +19,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * with this program; If not, see . */ #ifndef __CARL9170FW_DMA_H @@ -46,26 +45,16 @@ struct dma_desc { struct dma_desc *nextAddr; /* Next TD address */ } __packed __aligned(4); -/* Up, Dn, 5x Tx, retry, Rx, [USB Int], (CAB), (BA) */ -#define AR9170_TERMINATOR_NUMBER_B 9 +/* Up, Dn, 5x Tx, retry, Rx, [USB Int], (CAB), FW */ +#define AR9170_TERMINATOR_NUMBER_B 10 #define AR9170_TERMINATOR_NUMBER_INT 1 -#ifdef CONFIG_CARL9170FW_CAB_QUEUE #define AR9170_TERMINATOR_NUMBER_CAB CARL9170_INTF_NUM -#else -#define AR9170_TERMINATOR_NUMBER_CAB 0 -#endif /* CONFIG_CARL9170FW_CAB_QUEUE */ - -#ifdef CONFIG_CARL9170FW_HANDLE_BACK_REQ -#define AR9170_TERMINATOR_NUMBER_BA 1 -#else -#define AR9170_TERMINATOR_NUMBER_BA 0 -#endif /* CONFIG_CARL9170FW_HANDLE_BACK_REQ */ + #define AR9170_TERMINATOR_NUMBER (AR9170_TERMINATOR_NUMBER_B + \ AR9170_TERMINATOR_NUMBER_INT + \ - AR9170_TERMINATOR_NUMBER_CAB + \ - AR9170_TERMINATOR_NUMBER_BA) + AR9170_TERMINATOR_NUMBER_CAB) #define AR9170_BLOCK_SIZE (256 + 64) @@ -81,19 +70,32 @@ struct carl9170_tx_ba_superframe { struct ar9170_tx_ba_frame f; } __packed; +struct ar9170_tx_null_frame { + struct ar9170_tx_hwdesc hdr; + struct ieee80211_hdr null; +} __packed __aligned(4); + +struct carl9170_tx_null_superframe { + struct carl9170_tx_superdesc s; + struct ar9170_tx_null_frame f; +} __packed __aligned(4); + #define CARL9170_BA_BUFFER_LEN (__roundup(sizeof(struct carl9170_tx_ba_superframe), 16)) #define CARL9170_RSP_BUFFER_LEN AR9170_BLOCK_SIZE struct carl9170_sram_reserved { -#ifdef CONFIG_CARL9170FW_HANDLE_BACK_REQ union { uint32_t buf[CARL9170_BA_BUFFER_LEN / sizeof(uint32_t)]; struct carl9170_tx_ba_superframe ba; } ba; -#endif /* CONFIG_CARL9170FW_HANDLE_BACK_REQ */ + union { uint32_t buf[CARL9170_MAX_CMD_LEN / sizeof(uint32_t)]; struct carl9170_cmd cmd; + +#ifdef CONFIG_CARL9170FW_WOL + struct carl9170_tx_null_superframe null; +#endif /* CONFIG_CARL9170FW_WOL */ } cmd; union { @@ -130,6 +132,7 @@ struct carl9170_sram_reserved { * | BA buffer (128 bytes) * +-- * | CMD buffer (128 bytes) + * | - used as NULLFRAME buffer (128 bytes) for WOL * +-- * | RSP buffer (320 bytes) * +-- @@ -275,7 +278,7 @@ static inline __inline struct dma_desc *dma_dequeue_not_bits(struct dma_queue *q desc = (queue)->head) #define __for_each_desc_continue(desc, queue) \ - for (;desc != (queue)->terminator; \ + for (; desc != (queue)->terminator; \ desc = (desc)->lastAddr->nextAddr) #define __for_each_desc(desc, queue) \ @@ -331,12 +334,11 @@ static inline void __check_desc(void) BUILD_BUG_ON(sizeof(mem) > AR9170_SRAM_SIZE); -#ifdef CONFIG_CARL9170FW_HANDLE_BACK_REQ BUILD_BUG_ON(offsetof(struct carl9170_sram_reserved, ba.buf) & (BLOCK_ALIGNMENT - 1)); -#endif /* CONFIG_CARL9170FW_HANDLE_BACK_REQ */ BUILD_BUG_ON(offsetof(struct carl9170_sram_reserved, cmd.buf) & (BLOCK_ALIGNMENT - 1)); BUILD_BUG_ON(offsetof(struct carl9170_sram_reserved, rsp.buf) & (BLOCK_ALIGNMENT - 1)); BUILD_BUG_ON(offsetof(struct carl9170_sram_reserved, bcn.buf) & (BLOCK_ALIGNMENT - 1)); + BUILD_BUG_ON(sizeof(struct carl9170_tx_null_superframe) > CARL9170_MAX_CMD_LEN); } #endif /* __CARL9170FW_DMA_H */