Skip to content

Commit

Permalink
staging: rtl8192e: Fix sparse (non-endian) warnings - Part II
Browse files Browse the repository at this point in the history
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Larry Finger authored and Greg Kroah-Hartman committed Aug 25, 2011
1 parent ec0dc6b commit 49aab5f
Show file tree
Hide file tree
Showing 11 changed files with 152 additions and 455 deletions.
10 changes: 4 additions & 6 deletions drivers/staging/rtl8192e/r8192E_cmdpkt.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
}

/*---------------------------Define functions---------------------------------*/
extern bool cmpk_message_handle_tx(
bool cmpk_message_handle_tx(
struct net_device *dev,
u8 *code_virtual_address,
u32 packettype,
Expand Down Expand Up @@ -167,7 +167,7 @@ static void cmpk_handle_tx_feedback(struct net_device *dev, u8 *pmsg)

} /* cmpk_Handle_Tx_Feedback */

void cmdpkt_beacontimerinterrupt_819xusb(struct net_device *dev)
static void cmdpkt_beacontimerinterrupt_819xusb(struct net_device *dev)
{
struct r8192_priv *priv = rtllib_priv(dev);
u16 tx_rate;
Expand Down Expand Up @@ -339,10 +339,8 @@ static void cmpk_handle_tx_rate_history(struct net_device *dev, u8 *pmsg)
}


extern u32
cmpk_message_handle_rx(
struct net_device *dev,
struct rtllib_rx_stats *pstats)
u32 cmpk_message_handle_rx(struct net_device *dev,
struct rtllib_rx_stats *pstats)
{
struct r8192_priv *priv = rtllib_priv(dev);
int total_length;
Expand Down
43 changes: 17 additions & 26 deletions drivers/staging/rtl8192e/r8192E_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void rtl8192e_start_beacon(struct net_device *dev)
rtl8192_irq_enable(dev);
}

void rtl8192e_update_msr(struct net_device *dev)
static void rtl8192e_update_msr(struct net_device *dev)
{
struct r8192_priv *priv = rtllib_priv(dev);
u8 msr;
Expand Down Expand Up @@ -952,7 +952,7 @@ bool rtl8192_adapter_start(struct net_device *dev)
return rtStatus;
}

void rtl8192_net_update(struct net_device *dev)
static void rtl8192_net_update(struct net_device *dev)
{

struct r8192_priv *priv = rtllib_priv(dev);
Expand Down Expand Up @@ -1127,7 +1127,7 @@ static u8 MRateToHwRate8190Pci(u8 rate)
return ret;
}

u8 rtl8192_MapHwQueueToFirmwareQueue(u8 QueueID, u8 priority)
static u8 rtl8192_MapHwQueueToFirmwareQueue(u8 QueueID, u8 priority)
{
u8 QueueSelect = 0x0;

Expand Down Expand Up @@ -1301,7 +1301,7 @@ void rtl8192_tx_fill_cmd_desc(struct net_device *dev,
entry->OWN = 1;
}

u8 HwRateToMRate90(bool bIsHT, u8 rate)
static u8 HwRateToMRate90(bool bIsHT, u8 rate)
{
u8 ret_rate = 0x02;

Expand Down Expand Up @@ -1414,7 +1414,7 @@ u8 HwRateToMRate90(bool bIsHT, u8 rate)
return ret_rate;
}

long rtl8192_signal_scale_mapping(struct r8192_priv *priv, long currsig)
static long rtl8192_signal_scale_mapping(struct r8192_priv *priv, long currsig)
{
long retsig;

Expand Down Expand Up @@ -1450,7 +1450,7 @@ long rtl8192_signal_scale_mapping(struct r8192_priv *priv, long currsig)
_pdrvinfo->RxRate == DESC90_RATE11M) &&\
!_pdrvinfo->RxHT)

void rtl8192_query_rxphystatus(
static void rtl8192_query_rxphystatus(
struct r8192_priv *priv,
struct rtllib_rx_stats *pstats,
struct rx_desc *pdesc,
Expand Down Expand Up @@ -1664,9 +1664,9 @@ void rtl8192_query_rxphystatus(
}
}

void rtl8192_process_phyinfo(struct r8192_priv *priv, u8 *buffer,
struct rtllib_rx_stats *prev_st,
struct rtllib_rx_stats *curr_st)
static void rtl8192_process_phyinfo(struct r8192_priv *priv, u8 *buffer,
struct rtllib_rx_stats *prev_st,
struct rtllib_rx_stats *curr_st)
{
bool bcheck = false;
u8 rfpath;
Expand Down Expand Up @@ -1839,10 +1839,11 @@ void rtl8192_process_phyinfo(struct r8192_priv *priv, u8 *buffer,
}
}

void rtl8192_TranslateRxSignalStuff(struct net_device *dev, struct sk_buff *skb,
struct rtllib_rx_stats *pstats,
struct rx_desc *pdesc,
struct rx_fwinfo *pdrvinfo)
static void rtl8192_TranslateRxSignalStuff(struct net_device *dev,
struct sk_buff *skb,
struct rtllib_rx_stats *pstats,
struct rx_desc *pdesc,
struct rx_fwinfo *pdrvinfo)
{
struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev);
bool bpacket_match_bssid, bpacket_toself;
Expand All @@ -1867,7 +1868,7 @@ void rtl8192_TranslateRxSignalStuff(struct net_device *dev, struct sk_buff *skb,
(fc & RTLLIB_FCTL_TODS) ? hdr->addr1 :
(fc & RTLLIB_FCTL_FROMDS) ? hdr->addr2 : hdr->addr3))
&& (!pstats->bHwError) && (!pstats->bCRC) && (!pstats->bICV));
bpacket_toself = bpacket_match_bssid &
bpacket_toself = bpacket_match_bssid && /* check this */
(!compare_ether_addr(praddr,
priv->rtllib->dev->dev_addr));
if (WLAN_FC_GET_FRAMETYPE(fc) == RTLLIB_STYPE_BEACON)
Expand All @@ -1883,7 +1884,8 @@ void rtl8192_TranslateRxSignalStuff(struct net_device *dev, struct sk_buff *skb,
rtl8192_record_rxdesc_forlateruse(pstats, &previous_stats);
}

void rtl8192_UpdateReceivedRateHistogramStatistics(struct net_device *dev,
static void rtl8192_UpdateReceivedRateHistogramStatistics(
struct net_device *dev,
struct rtllib_rx_stats *pstats)
{
struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev);
Expand Down Expand Up @@ -2255,17 +2257,6 @@ void rtl8192_enable_tx(struct net_device *dev)
}


void rtl8192_beacon_disable(struct net_device *dev)
{
struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev);
u32 reg;

reg = read_nic_dword(priv->rtllib->dev, INTA_MASK);

reg &= ~(IMR_BcnInt | IMR_BcnInt | IMR_TBDOK | IMR_TBDER);
write_nic_dword(priv->rtllib->dev, INTA_MASK, reg);
}

void rtl8192_interrupt_recognized(struct net_device *dev, u32 *p_inta,
u32 *p_intb)
{
Expand Down
45 changes: 5 additions & 40 deletions drivers/staging/rtl8192e/r8192E_firmware.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include "r8192E_firmware.h"
#include <linux/firmware.h>

extern void firmware_init_param(struct net_device *dev)
void firmware_init_param(struct net_device *dev)
{
struct r8192_priv *priv = rtllib_priv(dev);
struct rt_firmware *pfirmware = priv->pFirmware;
Expand All @@ -32,8 +32,8 @@ extern void firmware_init_param(struct net_device *dev)
MAX_TRANSMIT_BUFFER_SIZE);
}

bool fw_download_code(struct net_device *dev, u8 *code_virtual_address,
u32 buffer_len)
static bool fw_download_code(struct net_device *dev, u8 *code_virtual_address,
u32 buffer_len)
{
struct r8192_priv *priv = rtllib_priv(dev);
bool rt_status = true;
Expand Down Expand Up @@ -102,42 +102,7 @@ bool fw_download_code(struct net_device *dev, u8 *code_virtual_address,
return rt_status;
}

bool fwSendNullPacket(struct net_device *dev, u32 Length)
{
bool rtStatus = true;
struct r8192_priv *priv = rtllib_priv(dev);
struct sk_buff *skb;
struct cb_desc *tcb_desc;
unsigned char *ptr_buf;
bool bLastInitPacket = false;


skb = dev_alloc_skb(Length + 4);
memcpy((unsigned char *)(skb->cb), &dev, sizeof(dev));
tcb_desc = (struct cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
tcb_desc->queue_index = TXCMD_QUEUE;
tcb_desc->bCmdOrInit = DESC_PACKET_TYPE_INIT;
tcb_desc->bLastIniPkt = bLastInitPacket;
ptr_buf = skb_put(skb, Length);
memset(ptr_buf, 0, Length);
tcb_desc->txbuf_size = (u16)Length;

if (!priv->rtllib->check_nic_enough_desc(dev, tcb_desc->queue_index) ||
(!skb_queue_empty(&priv->rtllib->skb_waitQ[tcb_desc->
queue_index])) || (priv->rtllib->queue_stop)) {
RT_TRACE(COMP_FIRMWARE, "===================NULL packet========"
"========> tx full!\n");
skb_queue_tail(&priv->rtllib->skb_waitQ[tcb_desc->queue_index],
skb);
} else {
priv->rtllib->softmac_hard_start_xmit(skb, dev);
}

write_nic_byte(dev, TPPoll, TPPoll_CQ);
return rtStatus;
}

bool CPUcheck_maincodeok_turnonCPU(struct net_device *dev)
static bool CPUcheck_maincodeok_turnonCPU(struct net_device *dev)
{
bool rt_status = true;
u32 CPU_status = 0;
Expand Down Expand Up @@ -184,7 +149,7 @@ bool CPUcheck_maincodeok_turnonCPU(struct net_device *dev)
return rt_status;
}

bool CPUcheck_firmware_ready(struct net_device *dev)
static bool CPUcheck_firmware_ready(struct net_device *dev)
{

bool rt_status = true;
Expand Down
38 changes: 20 additions & 18 deletions drivers/staging/rtl8192e/r8192E_phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ static u32 phy_FwRFSerialRead(struct net_device *dev,
static void phy_FwRFSerialWrite(struct net_device *dev,
enum rf90_radio_path eRFPath,
u32 Offset, u32 Data);
u32 rtl8192_CalculateBitShift(u32 dwBitMask)

static u32 rtl8192_CalculateBitShift(u32 dwBitMask)
{
u32 i;
for (i = 0; i <= 31; i++) {
Expand Down Expand Up @@ -105,8 +106,8 @@ u32 rtl8192_QueryBBReg(struct net_device *dev, u32 dwRegAddr, u32 dwBitMask)

return Ret;
}
u32 rtl8192_phy_RFSerialRead(struct net_device *dev,
enum rf90_radio_path eRFPath, u32 Offset)
static u32 rtl8192_phy_RFSerialRead(struct net_device *dev,
enum rf90_radio_path eRFPath, u32 Offset)
{
struct r8192_priv *priv = rtllib_priv(dev);
u32 ret = 0;
Expand Down Expand Up @@ -161,9 +162,9 @@ u32 rtl8192_phy_RFSerialRead(struct net_device *dev,

}

void rtl8192_phy_RFSerialWrite(struct net_device *dev,
enum rf90_radio_path eRFPath, u32 Offset,
u32 Data)
static void rtl8192_phy_RFSerialWrite(struct net_device *dev,
enum rf90_radio_path eRFPath, u32 Offset,
u32 Data)
{
struct r8192_priv *priv = rtllib_priv(dev);
u32 DataAndAddr = 0, NewOffset = 0;
Expand Down Expand Up @@ -400,7 +401,7 @@ void rtl8192_phyConfigBB(struct net_device *dev, u8 ConfigType)
return;
}

void rtl8192_InitBBRFRegDef(struct net_device *dev)
static void rtl8192_InitBBRFRegDef(struct net_device *dev)
{
struct r8192_priv *priv = rtllib_priv(dev);

Expand Down Expand Up @@ -549,7 +550,7 @@ bool rtl8192_phy_checkBBAndRF(struct net_device *dev,
return ret;
}

bool rtl8192_BB_Config_ParaFile(struct net_device *dev)
static bool rtl8192_BB_Config_ParaFile(struct net_device *dev)
{
struct r8192_priv *priv = rtllib_priv(dev);
bool rtStatus = true;
Expand Down Expand Up @@ -790,7 +791,7 @@ u8 rtl8192_phy_ConfigRFWithHeaderFile(struct net_device *dev,
return ret;

}
void rtl8192_SetTxPowerLevel(struct net_device *dev, u8 channel)
static void rtl8192_SetTxPowerLevel(struct net_device *dev, u8 channel)
{
struct r8192_priv *priv = rtllib_priv(dev);
u8 powerlevel = priv->TxPowerLevelCCK[channel-1];
Expand All @@ -815,9 +816,10 @@ void rtl8192_SetTxPowerLevel(struct net_device *dev, u8 channel)
return;
}

u8 rtl8192_phy_SetSwChnlCmdArray(struct sw_chnl_cmd *CmdTable, u32 CmdTableIdx,
u32 CmdTableSz, enum sw_chnl_cmd_id CmdID,
u32 Para1, u32 Para2, u32 msDelay)
static u8 rtl8192_phy_SetSwChnlCmdArray(struct sw_chnl_cmd *CmdTable,
u32 CmdTableIdx, u32 CmdTableSz,
enum sw_chnl_cmd_id CmdID,
u32 Para1, u32 Para2, u32 msDelay)
{
struct sw_chnl_cmd *pCmd;

Expand All @@ -843,8 +845,8 @@ u8 rtl8192_phy_SetSwChnlCmdArray(struct sw_chnl_cmd *CmdTable, u32 CmdTableIdx,
return true;
}

u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel, u8 *stage,
u8 *step, u32 *delay)
static u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel,
u8 *stage, u8 *step, u32 *delay)
{
struct r8192_priv *priv = rtllib_priv(dev);
struct sw_chnl_cmd PreCommonCmd[MAX_PRECMD_CNT];
Expand Down Expand Up @@ -983,7 +985,7 @@ u8 rtl8192_phy_SwChnlStepByStep(struct net_device *dev, u8 channel, u8 *stage,
return false;
}

void rtl8192_phy_FinishSwChnlNow(struct net_device *dev, u8 channel)
static void rtl8192_phy_FinishSwChnlNow(struct net_device *dev, u8 channel)
{
struct r8192_priv *priv = rtllib_priv(dev);
u32 delay = 0;
Expand Down Expand Up @@ -1410,8 +1412,8 @@ void PHY_SetRtl8192eRfOff(struct net_device *dev)

}

bool SetRFPowerState8190(struct net_device *dev,
enum rt_rf_power_state eRFPowerState)
static bool SetRFPowerState8190(struct net_device *dev,
enum rt_rf_power_state eRFPowerState)
{
struct r8192_priv *priv = rtllib_priv(dev);
struct rt_pwr_save_ctrl *pPSC = (struct rt_pwr_save_ctrl *)
Expand Down Expand Up @@ -1608,7 +1610,7 @@ bool SetRFPowerState(struct net_device *dev,
return bResult;
}

extern void PHY_ScanOperationBackup8192(struct net_device *dev, u8 Operation)
void PHY_ScanOperationBackup8192(struct net_device *dev, u8 Operation)
{
struct r8192_priv *priv = rtllib_priv(dev);

Expand Down
Loading

0 comments on commit 49aab5f

Please sign in to comment.