diff options
Diffstat (limited to 'sys/dev/pci/if_iwnreg.h')
-rw-r--r-- | sys/dev/pci/if_iwnreg.h | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/sys/dev/pci/if_iwnreg.h b/sys/dev/pci/if_iwnreg.h index 789610db84b..ea18655ba10 100644 --- a/sys/dev/pci/if_iwnreg.h +++ b/sys/dev/pci/if_iwnreg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwnreg.h,v 1.19 2008/12/02 17:17:50 damien Exp $ */ +/* $OpenBSD: if_iwnreg.h,v 1.20 2008/12/12 17:15:40 damien Exp $ */ /*- * Copyright (c) 2007, 2008 @@ -33,6 +33,15 @@ /* RX buffers must be large enough to hold a full 4K A-MPDU. */ #define IWN_RBUF_SIZE (4 * 1024) +#if defined(__LP64__) +/* HW supports 36-bit DMA addresses. */ +#define IWN_LOADDR(paddr) ((uint32_t)(paddr)) +#define IWN_HIADDR(paddr) (((paddr) >> 32) & 0xf) +#else +#define IWN_LOADDR(paddr) (paddr) +#define IWN_HIADDR(paddr) (0) +#endif + /* Base Address Register. */ #define IWN_PCI_BAR0 PCI_MAPREG_START @@ -296,30 +305,13 @@ struct iwn_tx_desc { uint8_t reserved1[3]; uint8_t nsegs; struct { - uint32_t w1; - uint32_t w2; - uint32_t w3; - } __packed segs[IWN_MAX_SCATTER / 2]; + uint32_t addr; + uint16_t len; + } __packed segs[IWN_MAX_SCATTER]; /* Pad to 128 bytes. */ uint32_t reserved2; } __packed; -#define IWN_SET_DESC_NSEGS(d, x) \ - (d)->nsegs = (x) - -/* Set a segment physical address and length in a TX descriptor. */ -#define IWN_SET_DESC_SEG(d, n, addr, size) do { \ - if ((n) & 1) { \ - (d)->segs[(n) / 2].w2 |= \ - htole32(((addr) & 0xffff) << 16); \ - (d)->segs[(n) / 2].w3 = \ - htole32((((addr) >> 16) & 0xffff) | (size) << 20); \ - } else { \ - (d)->segs[(n) / 2].w1 = htole32(addr); \ - (d)->segs[(n) / 2].w2 = htole32((size) << 4); \ - } \ -} while (0) - struct iwn_rx_status { uint16_t closed_count; uint16_t closed_rx_count; |