return *(const volatile uint16_t *) addr;
}
-static inline __inline void *readp(const volatile void *addr)
+static inline __inline volatile void *readp(const volatile void *addr)
{
- return *(void **) addr;
+ return *(volatile void **) addr;
}
static inline __inline uint32_t readl(const volatile void *addr)
{
- return (uint32_t) (const unsigned int *) readp(addr);
+ return *(const volatile unsigned int *) addr;
}
static inline __inline void writeb(volatile void *addr, const volatile uint8_t val)
static inline __inline uint32_t get(const volatile uint32_t addr)
{
- return readl((const volatile void *) addr);
+ return readl((volatile void *) addr);
}
-static inline __inline void *getp(const volatile uint32_t addr)
+static inline __inline volatile void *getp(const volatile uint32_t addr)
{
return readp((const volatile void *) addr);
}
set(AR9170_MAC_REG_DMA_TXQ_CURR_ADDR + (q << 3), v);
}
-static inline __inline struct dma_desc *get_wlan_txq_dma_addr(const unsigned int q)
+static inline __inline volatile struct dma_desc *get_wlan_txq_dma_addr(const unsigned int q)
{
return getp(AR9170_MAC_REG_DMA_TXQ_ADDR + (q << 3));
}
-static inline __inline struct dma_desc *get_wlan_txq_addr(const unsigned int q)
+static inline __inline volatile struct dma_desc *get_wlan_txq_addr(const unsigned int q)
{
return getp(AR9170_MAC_REG_DMA_TXQ_CURR_ADDR + (q << 3));
}
-static inline __inline struct dma_desc *get_wlan_txq_last_addr(const unsigned int q)
+static inline __inline volatile struct dma_desc *get_wlan_txq_last_addr(const unsigned int q)
{
return getp(AR9170_MAC_REG_DMA_TXQ_LAST_ADDR + (q << 2));
}
}
/* fetch the current DMA queue position */
- desc = get_wlan_txq_addr(i);
+ desc = (struct dma_desc *)get_wlan_txq_addr(i);
/* Stuck frame detection */
if (unlikely(DESC_PAYLOAD(desc) == fw.wlan.last_super[i])) {