unsigned char buf_use[MAX_STATIC_BUF_NUM];
} bcm_static_buf_t;
-static bcm_static_buf_t *bcm_static_buf = 0;
+static bcm_static_buf_t *bcm_static_buf;
#define MAX_STATIC_PKT_NUM 8
typedef struct bcm_static_pkt {
struct semaphore osl_pkt_sem;
unsigned char pkt_use[MAX_STATIC_PKT_NUM * 2];
} bcm_static_pkt_t;
-static bcm_static_pkt_t *bcm_static_skb = 0;
+static bcm_static_pkt_t *bcm_static_skb;
#endif /* DHD_USE_STATIC_BUF */
struct osl_info {
case PCI_BUS:
case SI_BUS:
case PCMCIA_BUS:
- osh->pub.mmbus = TRUE;
+ osh->pub.mmbus = true;
break;
case JTAG_BUS:
case SDIO_BUS:
case USB_BUS:
case SPI_BUS:
case RPC_BUS:
- osh->pub.mmbus = FALSE;
+ osh->pub.mmbus = false;
break;
default:
- ASSERT(FALSE);
+ ASSERT(false);
break;
}
#if defined(BRCM_FULLMAC) && defined(DHD_USE_STATIC_BUF)
if (!bcm_static_buf) {
- if (!(bcm_static_buf =
- (bcm_static_buf_t *) dhd_os_prealloc(3,
- STATIC_BUF_SIZE + STATIC_BUF_TOTAL_LEN))) {
+ bcm_static_buf = (bcm_static_buf_t *) dhd_os_prealloc(3,
+ STATIC_BUF_SIZE + STATIC_BUF_TOTAL_LEN);
+ if (!bcm_static_buf) {
printk(KERN_ERR "can not alloc static buf!\n");
} else
printk(KERN_ERR "alloc static buf at %x!\n",
return PAGE_SIZE;
}
-#ifdef BRCM_FULLMAC
-void *osl_dma_alloc_consistent(osl_t *osh, uint size, unsigned long *pap)
-{
- ASSERT((osh && (osh->magic == OS_HANDLE_MAGIC)));
-
- return pci_alloc_consistent(osh->pdev, size, (dma_addr_t *) pap);
-}
-#else /* !BRCM_FULLMAC */
void *osl_dma_alloc_consistent(osl_t *osh, uint size, u16 align_bits,
uint *alloced, unsigned long *pap)
{
- u16 align = (1 << align_bits);
ASSERT((osh && (osh->magic == OS_HANDLE_MAGIC)));
- if (!IS_ALIGNED(DMA_CONSISTENT_ALIGN, align))
- size += align;
- *alloced = size;
-
+ if (align_bits) {
+ u16 align = (1 << align_bits);
+ if (!IS_ALIGNED(DMA_CONSISTENT_ALIGN, align))
+ size += align;
+ *alloced = size;
+ }
return pci_alloc_consistent(osh->pdev, size, (dma_addr_t *) pap);
}
-#endif /* BRCM_FULLMAC */
void osl_dma_free_consistent(osl_t *osh, void *va, uint size, unsigned long pa)
{
}
#endif /* defined(BCMDBG_ASSERT) */
-void osl_delay(uint usec)
-{
- uint d;
-
- while (usec > 0) {
- d = min(usec, (uint)1000);
- udelay(d);
- usec -= d;
- }
-}
-
#if defined(BCMSDIO) && !defined(BRCM_FULLMAC)
u8 osl_readb(osl_t *osh, volatile u8 *r)
{