From 6d93fac49bc07a77f96bfeb62abbdd7c07ea4e27 Mon Sep 17 00:00:00 2001 From: neil Date: Mon, 26 Sep 2011 21:17:34 +0000 Subject: [PATCH] Improved code consistency and removed some unused code. git-svn-id: https://svn.aros.org/svn/aros/trunk/AROS@41621 fb15a70f-31f2-0310-bbcc-cdcc74a49acc --- workbench/devs/networks/atheros5000/initializers.h | 2 +- workbench/devs/networks/atheros5000/unit.c | 24 ++++++++++------------ 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/workbench/devs/networks/atheros5000/initializers.h b/workbench/devs/networks/atheros5000/initializers.h index 251340e79a..e7fbcae43f 100644 --- a/workbench/devs/networks/atheros5000/initializers.h +++ b/workbench/devs/networks/atheros5000/initializers.h @@ -34,7 +34,7 @@ MA 02111-1307, USA. #endif */ #define OFFSET(struct_name, struct_field) \ - ((IPTR)(&(((struct struct_name *)0)->struct_field))) + ((UPINT)(&(((struct struct_name *)0)->struct_field))) /* Use the following macros in the structure definition */ diff --git a/workbench/devs/networks/atheros5000/unit.c b/workbench/devs/networks/atheros5000/unit.c index a03c25935f..64a44e6e2a 100644 --- a/workbench/devs/networks/atheros5000/unit.c +++ b/workbench/devs/networks/atheros5000/unit.c @@ -274,7 +274,8 @@ struct DevUnit *CreateUnit(ULONG index, APTR io_base, UWORD id, APTR card, /* Get physical addresses of DMA structures */ dma_size = sizeof(struct ath_desc) * TX_SLOT_COUNT; - unit->tx_descs_p = (ULONG)(IPTR)CachePreDMA(unit->tx_descs, &dma_size, 0); + unit->tx_descs_p = + (ULONG)(UPINT)CachePreDMA(unit->tx_descs, &dma_size, 0); if(dma_size != sizeof(struct ath_desc) * TX_SLOT_COUNT) success = FALSE; CachePostDMA(unit->tx_descs, &dma_size, 0); @@ -283,7 +284,7 @@ struct DevUnit *CreateUnit(ULONG index, APTR io_base, UWORD id, APTR card, { dma_size = FRAME_BUFFER_SIZE; unit->tx_buffers_p[i] = - (ULONG)(IPTR)CachePreDMA(unit->tx_buffers[i], &dma_size, 0); + (ULONG)(UPINT)CachePreDMA(unit->tx_buffers[i], &dma_size, 0); if(dma_size != FRAME_BUFFER_SIZE) success = FALSE; CachePostDMA(unit->tx_buffers[i], &dma_size, 0); @@ -291,7 +292,7 @@ struct DevUnit *CreateUnit(ULONG index, APTR io_base, UWORD id, APTR card, dma_size = sizeof(struct ath_desc) * MGMT_SLOT_COUNT; unit->mgmt_descs_p = - (ULONG)(IPTR)CachePreDMA(unit->mgmt_descs, &dma_size, 0); + (ULONG)(UPINT)CachePreDMA(unit->mgmt_descs, &dma_size, 0); if(dma_size != sizeof(struct ath_desc) * MGMT_SLOT_COUNT) success = FALSE; CachePostDMA(unit->mgmt_descs, &dma_size, 0); @@ -300,14 +301,15 @@ struct DevUnit *CreateUnit(ULONG index, APTR io_base, UWORD id, APTR card, { dma_size = FRAME_BUFFER_SIZE; unit->mgmt_buffers_p[i] = - (ULONG)(IPTR)CachePreDMA(unit->mgmt_buffers[i], &dma_size, 0); + (ULONG)(UPINT)CachePreDMA(unit->mgmt_buffers[i], &dma_size, 0); if(dma_size != FRAME_BUFFER_SIZE) success = FALSE; CachePostDMA(unit->mgmt_buffers[i], &dma_size, 0); } dma_size = sizeof(struct ath_desc) * RX_SLOT_COUNT; - unit->rx_descs_p = (ULONG)(IPTR)CachePreDMA(unit->rx_descs, &dma_size, 0); + unit->rx_descs_p = + (ULONG)(UPINT)CachePreDMA(unit->rx_descs, &dma_size, 0); if(dma_size != sizeof(struct ath_desc) * RX_SLOT_COUNT) success = FALSE; CachePostDMA(unit->rx_descs, &dma_size, 0); @@ -316,7 +318,7 @@ struct DevUnit *CreateUnit(ULONG index, APTR io_base, UWORD id, APTR card, { dma_size = FRAME_BUFFER_SIZE; unit->rx_buffers_p[i] = - (ULONG)(IPTR)CachePreDMA(unit->rx_buffers[i], &dma_size, 0); + (ULONG)(UPINT)CachePreDMA(unit->rx_buffers[i], &dma_size, 0); if(dma_size != FRAME_BUFFER_SIZE) success = FALSE; CachePostDMA(unit->rx_buffers[i], &dma_size, 0); @@ -1541,7 +1543,7 @@ static BOOL StatusInt(REG(a1, struct DevUnit *unit), REG(a6, APTR int_code)) static VOID RXInt(REG(a1, struct DevUnit *unit), REG(a6, APTR int_code)) { UWORD ieee_length, frame_control, frame_type, slot, next_slot, - frame_subtype, encryption, key_no, buffer_no, old_length; + encryption, key_no, buffer_no, old_length; struct DevBase *base; BOOL is_good; LONG frag_no; @@ -1665,10 +1667,6 @@ static VOID RXInt(REG(a1, struct DevUnit *unit), REG(a6, APTR int_code)) frame_type = (frame_control & WIFI_FRM_CONTROLF_TYPE) >> WIFI_FRM_CONTROLB_TYPE; - frame_subtype = - (frame_control & WIFI_FRM_CONTROLF_SUBTYPE) - >> WIFI_FRM_CONTROLB_SUBTYPE; - (void)frame_subtype; /* unused */ /* If it's a management frame, process it separately; otherwise distribute it to clients after filtering */ @@ -2327,7 +2325,7 @@ static VOID TXInt(REG(a1, struct DevUnit *unit), REG(a6, APTR int_code)) /* Fill in DMA descriptor for packet transmission */ frame_size = WIFI_FRM_DATA + body_size; - tx_desc->ds_link = (ULONG)(IPTR)NULL; + tx_desc->ds_link = (ULONG)(UPINT)NULL; unit->hal->ah_setupTxDesc(unit->hal, tx_desc, frame_size + 4, // + CRC? WIFI_FRM_DATA, HAL_PKT_TYPE_NORMAL, TX_POWER, ((unit->flags & UNITF_SLOWRETRIES) != 0) ? @@ -2575,7 +2573,7 @@ static VOID MgmtTXInt(REG(a1, struct DevUnit *unit), REG(a6, APTR int_code)) /* Fill in DMA descriptor for packet transmission */ - desc->ds_link = (ULONG)(IPTR)NULL; + desc->ds_link = (ULONG)(UPINT)NULL; unit->hal->ah_setupTxDesc(unit->hal, desc, frame_size + 4, // + CRC? WIFI_FRM_DATA, HAL_PKT_TYPE_NORMAL, TX_POWER, unit->mgmt_rate_code, TX_TRIES, HAL_TXKEYIX_INVALID, -- 2.11.4.GIT