* Ensuring reading of interrupt status is done only once.
* Code style cleanup. * Automatic white space cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34815 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -395,11 +395,11 @@ iwi_attach(device_t dev)
|
|||||||
val = iwi_read_prom_word(sc, IWI_EEPROM_MAC + 2);
|
val = iwi_read_prom_word(sc, IWI_EEPROM_MAC + 2);
|
||||||
macaddr[4] = val & 0xff;
|
macaddr[4] = val & 0xff;
|
||||||
macaddr[5] = val >> 8;
|
macaddr[5] = val >> 8;
|
||||||
|
|
||||||
bands = 0;
|
bands = 0;
|
||||||
setbit(&bands, IEEE80211_MODE_11B);
|
setbit(&bands, IEEE80211_MODE_11B);
|
||||||
setbit(&bands, IEEE80211_MODE_11G);
|
setbit(&bands, IEEE80211_MODE_11G);
|
||||||
if (pci_get_device(dev) >= 0x4223)
|
if (pci_get_device(dev) >= 0x4223)
|
||||||
setbit(&bands, IEEE80211_MODE_11A);
|
setbit(&bands, IEEE80211_MODE_11A);
|
||||||
ieee80211_init_channels(ic, NULL, &bands);
|
ieee80211_init_channels(ic, NULL, &bands);
|
||||||
|
|
||||||
@@ -567,7 +567,7 @@ iwi_alloc_cmd_ring(struct iwi_softc *sc, struct iwi_cmd_ring *ring, int count)
|
|||||||
|
|
||||||
error = bus_dma_tag_create(bus_get_dma_tag(sc->sc_dev), 4, 0,
|
error = bus_dma_tag_create(bus_get_dma_tag(sc->sc_dev), 4, 0,
|
||||||
BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
|
BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
|
||||||
count * IWI_CMD_DESC_SIZE, 1, count * IWI_CMD_DESC_SIZE, 0,
|
count * IWI_CMD_DESC_SIZE, 1, count * IWI_CMD_DESC_SIZE, 0,
|
||||||
NULL, NULL, &ring->desc_dmat);
|
NULL, NULL, &ring->desc_dmat);
|
||||||
if (error != 0) {
|
if (error != 0) {
|
||||||
device_printf(sc->sc_dev, "could not create desc DMA tag\n");
|
device_printf(sc->sc_dev, "could not create desc DMA tag\n");
|
||||||
@@ -612,7 +612,7 @@ iwi_free_cmd_ring(struct iwi_softc *sc, struct iwi_cmd_ring *ring)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ring->desc_dmat != NULL)
|
if (ring->desc_dmat != NULL)
|
||||||
bus_dma_tag_destroy(ring->desc_dmat);
|
bus_dma_tag_destroy(ring->desc_dmat);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@@ -629,7 +629,7 @@ iwi_alloc_tx_ring(struct iwi_softc *sc, struct iwi_tx_ring *ring, int count,
|
|||||||
|
|
||||||
error = bus_dma_tag_create(bus_get_dma_tag(sc->sc_dev), 4, 0,
|
error = bus_dma_tag_create(bus_get_dma_tag(sc->sc_dev), 4, 0,
|
||||||
BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
|
BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
|
||||||
count * IWI_TX_DESC_SIZE, 1, count * IWI_TX_DESC_SIZE, 0, NULL,
|
count * IWI_TX_DESC_SIZE, 1, count * IWI_TX_DESC_SIZE, 0, NULL,
|
||||||
NULL, &ring->desc_dmat);
|
NULL, &ring->desc_dmat);
|
||||||
if (error != 0) {
|
if (error != 0) {
|
||||||
device_printf(sc->sc_dev, "could not create desc DMA tag\n");
|
device_printf(sc->sc_dev, "could not create desc DMA tag\n");
|
||||||
@@ -908,7 +908,7 @@ iwi_node_free(struct ieee80211_node *ni)
|
|||||||
sc->sc_node_free(ni);
|
sc->sc_node_free(ni);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Convert h/w rate code to IEEE rate code.
|
* Convert h/w rate code to IEEE rate code.
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
@@ -1657,10 +1657,14 @@ iwi_intr(void *arg)
|
|||||||
|
|
||||||
IWI_LOCK(sc);
|
IWI_LOCK(sc);
|
||||||
|
|
||||||
|
#if !defined(__HAIKU__)
|
||||||
if ((r = CSR_READ_4(sc, IWI_CSR_INTR)) == 0 || r == 0xffffffff) {
|
if ((r = CSR_READ_4(sc, IWI_CSR_INTR)) == 0 || r == 0xffffffff) {
|
||||||
IWI_UNLOCK(sc);
|
IWI_UNLOCK(sc);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
r = atomic_get((int32 *)&sc->sc_intr_status);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* acknowledge interrupts */
|
/* acknowledge interrupts */
|
||||||
CSR_WRITE_4(sc, IWI_CSR_INTR, r);
|
CSR_WRITE_4(sc, IWI_CSR_INTR, r);
|
||||||
@@ -2901,7 +2905,7 @@ iwi_auth_and_assoc(struct iwi_softc *sc, struct ieee80211vap *vap)
|
|||||||
* key setup. This typically is due to a user app bug
|
* key setup. This typically is due to a user app bug
|
||||||
* but if we blindly grab the key the firmware will
|
* but if we blindly grab the key the firmware will
|
||||||
* barf so avoid it for now.
|
* barf so avoid it for now.
|
||||||
*/
|
*/
|
||||||
if (vap->iv_def_txkey != IEEE80211_KEYIX_NONE)
|
if (vap->iv_def_txkey != IEEE80211_KEYIX_NONE)
|
||||||
assoc->auth |= vap->iv_def_txkey << 4;
|
assoc->auth |= vap->iv_def_txkey << 4;
|
||||||
|
|
||||||
|
|||||||
@@ -216,6 +216,10 @@ struct iwi_softc {
|
|||||||
|
|
||||||
struct iwi_rx_radiotap_header sc_rxtap;
|
struct iwi_rx_radiotap_header sc_rxtap;
|
||||||
struct iwi_tx_radiotap_header sc_txtap;
|
struct iwi_tx_radiotap_header sc_txtap;
|
||||||
|
|
||||||
|
#if defined(__HAIKU__)
|
||||||
|
uint32_t sc_intr_status;
|
||||||
|
#endif;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define IWI_STATE_BEGIN(_sc, _state) do { \
|
#define IWI_STATE_BEGIN(_sc, _state) do { \
|
||||||
|
|||||||
@@ -29,19 +29,15 @@ HAIKU_CHECK_DISABLE_INTERRUPTS(device_t dev)
|
|||||||
{
|
{
|
||||||
struct iwi_softc* sc = (struct iwi_softc*)device_get_softc(dev);
|
struct iwi_softc* sc = (struct iwi_softc*)device_get_softc(dev);
|
||||||
uint32 r;
|
uint32 r;
|
||||||
HAIKU_INTR_REGISTER_STATE;
|
|
||||||
|
|
||||||
HAIKU_INTR_REGISTER_ENTER();
|
r = CSR_READ_4(sc, IWI_CSR_INTR);
|
||||||
if ((r = CSR_READ_4(sc, IWI_CSR_INTR)) == 0 || r == 0xffffffff) {
|
if (r == 0 || r == 0xffffffff)
|
||||||
HAIKU_INTR_REGISTER_LEAVE();
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
|
||||||
|
|
||||||
/* disable interrupts */
|
atomic_set((int32*)&sc->sc_intr_status, r);
|
||||||
|
|
||||||
CSR_WRITE_4(sc, IWI_CSR_INTR_MASK, 0);
|
CSR_WRITE_4(sc, IWI_CSR_INTR_MASK, 0);
|
||||||
|
// disable interrupts
|
||||||
HAIKU_INTR_REGISTER_LEAVE();
|
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,6 +47,6 @@ HAIKU_REENABLE_INTERRUPTS(device_t dev)
|
|||||||
{
|
{
|
||||||
struct iwi_softc* sc = (struct iwi_softc*)device_get_softc(dev);
|
struct iwi_softc* sc = (struct iwi_softc*)device_get_softc(dev);
|
||||||
|
|
||||||
/* enable interrupts */
|
|
||||||
CSR_WRITE_4(sc, IWI_CSR_INTR_MASK, IWI_INTR_MASK);
|
CSR_WRITE_4(sc, IWI_CSR_INTR_MASK, IWI_INTR_MASK);
|
||||||
|
// reenable interrupts
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user