diff options
author | damien <damien@FreeBSD.org> | 2005-11-13 17:38:02 +0000 |
---|---|---|
committer | damien <damien@FreeBSD.org> | 2005-11-13 17:38:02 +0000 |
commit | b3afa7a234a23e43b10fc9ca85c8cd7cbf245f48 (patch) | |
tree | 9a4a15f8a7da965e1af408c409a5de26d3dc7b4b | |
parent | 83fc9c483a6eef6303d5f2178ccfcedc90881ce3 (diff) | |
download | FreeBSD-src-b3afa7a234a23e43b10fc9ca85c8cd7cbf245f48.zip FreeBSD-src-b3afa7a234a23e43b10fc9ca85c8cd7cbf245f48.tar.gz |
Fix endianness issues. iwi now works on big endian architectures too.
Obtained from: NetBSD (scw@)
MFC after: 2 weeks
-rw-r--r-- | sys/dev/iwi/if_iwi.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/sys/dev/iwi/if_iwi.c b/sys/dev/iwi/if_iwi.c index 0d28515..7dfb20a 100644 --- a/sys/dev/iwi/if_iwi.c +++ b/sys/dev/iwi/if_iwi.c @@ -350,14 +350,14 @@ iwi_attach(device_t dev) /* read MAC address from EEPROM */ val = iwi_read_prom_word(sc, IWI_EEPROM_MAC + 0); - ic->ic_myaddr[0] = val >> 8; - ic->ic_myaddr[1] = val & 0xff; + ic->ic_myaddr[0] = val & 0xff; + ic->ic_myaddr[1] = val >> 8; val = iwi_read_prom_word(sc, IWI_EEPROM_MAC + 1); - ic->ic_myaddr[2] = val >> 8; - ic->ic_myaddr[3] = val & 0xff; + ic->ic_myaddr[2] = val & 0xff; + ic->ic_myaddr[3] = val >> 8; val = iwi_read_prom_word(sc, IWI_EEPROM_MAC + 2); - ic->ic_myaddr[4] = val >> 8; - ic->ic_myaddr[5] = val & 0xff; + ic->ic_myaddr[4] = val & 0xff; + ic->ic_myaddr[5] = val >> 8; if (pci_get_device(dev) >= 0x4223) { /* set supported .11a rates (2915ABG only) */ @@ -1112,7 +1112,7 @@ iwi_read_prom_word(struct iwi_softc *sc, uint8_t addr) IWI_EEPROM_CTL(sc, 0); IWI_EEPROM_CTL(sc, IWI_EEPROM_C); - return be16toh(val); + return val; } /* @@ -1637,14 +1637,14 @@ iwi_tx_start(struct ifnet *ifp, struct mbuf *m0, struct ieee80211_node *ni, desc->nseg = htole32(nsegs); for (i = 0; i < nsegs; i++) { desc->seg_addr[i] = htole32(segs[i].ds_addr); - desc->seg_len[i] = htole32(segs[i].ds_len); + desc->seg_len[i] = htole16(segs[i].ds_len); } bus_dmamap_sync(txq->data_dmat, data->map, BUS_DMASYNC_PREWRITE); bus_dmamap_sync(txq->desc_dmat, txq->desc_map, BUS_DMASYNC_PREWRITE); DPRINTFN(5, ("sending data frame txq=%u idx=%u len=%u nseg=%u\n", - ac, txq->cur, desc->len, desc->nseg)); + ac, txq->cur, le16toh(desc->len), nsegs)); txq->queued++; txq->cur = (txq->cur + 1) % IWI_TX_RING_COUNT; @@ -1920,7 +1920,7 @@ iwi_load_ucode(struct iwi_softc *sc, void *uc, int size) /* write microcode into adapter memory */ for (w = uc; size > 0; w++, size -= 2) - MEM_WRITE_2(sc, 0x200010, *w); + MEM_WRITE_2(sc, 0x200010, htole16(*w)); MEM_WRITE_1(sc, 0x200000, 0x00); MEM_WRITE_1(sc, 0x200000, 0x80); |