X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=carlfw%2Finclude%2Fdma.h;h=565c48ddcbc706d7e5667f3efd0eae24827cecba;hb=12d3f1ba6ba522cd1ef11483d813fe2c2e64f04b;hp=9913f3a40359ce23ebf393730ab84b38b90b5ae0;hpb=fa097d02ca1683946b2207c8ebf69538e8c3cb9c;p=carl9170fw.git diff --git a/carlfw/include/dma.h b/carlfw/include/dma.h index 9913f3a..565c48d 100644 --- a/carlfw/include/dma.h +++ b/carlfw/include/dma.h @@ -6,7 +6,7 @@ * Copyright (c) 2000-2005 ZyDAS Technology Corporation * Copyright (c) 2007-2009 Atheros Communications, Inc. * Copyright 2009 Johannes Berg - * Copyright 2009, 2010 Christian Lamparter + * Copyright 2009-2011 Christian Lamparter * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -44,7 +44,7 @@ struct dma_desc { void *dataAddr; } __packed; struct dma_desc *nextAddr; /* Next TD address */ -} __packed; +} __packed __aligned(4); /* (Up, Dn, 5x Tx, Rx), USB Int, (5x delayed Tx + retry), CAB, BA */ #define AR9170_TERMINATOR_NUMBER_B 8 @@ -58,7 +58,7 @@ struct dma_desc { #endif /* CONFIG_CARL9170FW_DELAYED_TX */ #ifdef CONFIG_CARL9170FW_CAB_QUEUE -#define AR9170_TERMINATOR_NUMBER_CAB 1 +#define AR9170_TERMINATOR_NUMBER_CAB CARL9170_INTF_NUM #else #define AR9170_TERMINATOR_NUMBER_CAB 0 #endif /* CONFIG_CARL9170FW_CAB_QUEUE */ @@ -147,7 +147,6 @@ struct carl9170_sram_reserved { * 0x18000 */ -#define AR9170_SRAM_SIZE 0x18000 #define CARL9170_SRAM_RESERVED (sizeof(struct carl9170_sram_reserved)) #define AR9170_FRAME_MEMORY_SIZE (AR9170_SRAM_SIZE - CARL9170_SRAM_RESERVED) @@ -170,8 +169,8 @@ struct ar9170_data_block { struct ar9170_dma_memory { struct dma_desc terminator[AR9170_TERMINATOR_NUMBER]; struct dma_desc block[AR9170_BLOCK_NUMBER]; - struct ar9170_data_block data[AR9170_BLOCK_NUMBER] __attribute__((aligned(BLOCK_ALIGNMENT))); - struct carl9170_sram_reserved reserved __attribute__((aligned(BLOCK_ALIGNMENT))); + struct ar9170_data_block data[AR9170_BLOCK_NUMBER] __aligned(BLOCK_ALIGNMENT); + struct carl9170_sram_reserved reserved __aligned(BLOCK_ALIGNMENT); }; extern struct ar9170_dma_memory dma_mem; @@ -224,8 +223,11 @@ void dma_init_descriptors(void); void dma_reclaim(struct dma_queue *q, struct dma_desc *desc); void dma_put(struct dma_queue *q, struct dma_desc *desc); void dma_queue_reclaim(struct dma_queue *dst, struct dma_queue *src); -void queue_dump(void); -void wlan_txq_hangfix(const unsigned int queue); + +static inline __inline bool is_terminator(struct dma_queue *q, struct dma_desc *desc) +{ + return q->terminator == desc; +} static inline __inline bool queue_empty(struct dma_queue *q) {