Commit a6f81aaf authored by Florian Schilhabel's avatar Florian Schilhabel Committed by Greg Kroah-Hartman

staging: rtl8192su: update to r8192S_Efuse.c, r8192xU_cmdpkt.c

cosmetics, various updates to reflect realteks upstream changes.
Signed-off-by: default avatarFlorian Schilhabel <florian.c.schilhabel@googlemail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 4203c5b7
This diff is collapsed.
/****************************************************************************** /******************************************************************************
* Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved.
* *
* (c) Copyright 2008, RealTEK Technologies Inc. All Rights Reserved. * Based on the r8180 driver, which is:
* Copyright 2004-2005 Andrea Merello <andreamrl@tiscali.it>, et al.
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
* *
* Module: Efuse.h ( Header File) * This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
* *
* Note: * You should have received a copy of the GNU General Public License along with
* * this program; if not, write to the Free Software Foundation, Inc.,
* Function: * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
*
* Export:
*
* Abbrev:
*
* History:
* Data Who Remark
*
* 09/23/2008 MHC Porting Efuse R/W API from WMAC.
* 11/10/2008 MHC Porting Efuse.h from 8712 SDIO.
* 1. We muse redefine the header file to fit our coding
* style.
* 2. THe API we export to other module, we must redefine
* for 8192S series.
* *
* The full GNU General Public License is included in this distribution in the
* file called LICENSE.
* *
* Contact Information:
* wlanfae <wlanfae@realtek.com>
******************************************************************************/ ******************************************************************************/
/* Check to see if the file has been included already. */
#ifndef __INC_EFUSE_H #ifndef __INC_EFUSE_H
#define __INC_EFUSE_H #define __INC_EFUSE_H
// Roger porting for 8192SU
#define EFUSE_FOR_92SU 1 #define EFUSE_FOR_92SU 1
/*--------------------------Define Parameters-------------------------------*/ /*--------------------------Define Parameters-------------------------------*/
#define EFUSE_MAC_LEN 0x200 #define EFUSE_MAC_LEN 0x200
#define EFUSE_REAL_CONTENT_LEN 512
#define EFUSE_MAP_LEN 128
#define EFUSE_MAX_SECTION 16
#define EFUSE_MAX_WORD_UNIT 4
#define EFUSE_INIT_MAP 0 #define EFUSE_INIT_MAP 0
#define EFUSE_MODIFY_MAP 1 #define EFUSE_MODIFY_MAP 1
...@@ -41,7 +41,6 @@ ...@@ -41,7 +41,6 @@
#define EFUSE_CLK_CTRL EFUSE_CTRL #define EFUSE_CLK_CTRL EFUSE_CTRL
#define EFUSE_BIT(x) (1 << (x)) #define EFUSE_BIT(x) (1 << (x))
// From 8712!!!!!!!!
#define PG_STATE_HEADER 0x01 #define PG_STATE_HEADER 0x01
#define PG_STATE_WORD_0 0x02 #define PG_STATE_WORD_0 0x02
#define PG_STATE_WORD_1 0x04 #define PG_STATE_WORD_1 0x04
...@@ -52,22 +51,6 @@ ...@@ -52,22 +51,6 @@
#define PG_SWBYTE_H 0x01 #define PG_SWBYTE_H 0x01
#define PG_SWBYTE_L 0x02 #define PG_SWBYTE_L 0x02
/*--------------------------Define Parameters-------------------------------*/
/*------------------------------Define structure----------------------------*/
/*------------------------------Define structure----------------------------*/
/*------------------------Export global variable----------------------------*/
/*------------------------Export global variable----------------------------*/
/*------------------------Export Marco Definition---------------------------*/
/*------------------------Export Marco Definition---------------------------*/
/*--------------------------Exported Function prototype---------------------*/ /*--------------------------Exported Function prototype---------------------*/
extern void extern void
EFUSE_Initialize(struct net_device* dev); EFUSE_Initialize(struct net_device* dev);
...@@ -81,13 +64,13 @@ extern void ...@@ -81,13 +64,13 @@ extern void
ReadEFuse(struct net_device* dev,u16 _offset,u16 _size_byte,u8* pbuf); ReadEFuse(struct net_device* dev,u16 _offset,u16 _size_byte,u8* pbuf);
extern void extern void
ReadEFuseByte(struct net_device* dev,u16 _offset,u8 *pbuf); ReadEFuseByte(struct net_device* dev,u16 _offset,u8 *pbuf);
#endif // #if (EFUSE_FOR_92SU == 1) #endif
extern void extern void
EFUSE_ShadowRead(struct net_device* dev,unsigned char Type,unsigned short Offset,u32 *Value); EFUSE_ShadowRead(struct net_device* dev,unsigned char Type,unsigned short Offset,u32 *Value);
extern void extern void
EFUSE_ShadowWrite(struct net_device* dev,unsigned char Type,unsigned short Offset,u32 Value); EFUSE_ShadowWrite(struct net_device* dev,unsigned char Type,unsigned short Offset,u32 Value);
extern void extern bool
EFUSE_ShadowUpdate(struct net_device* dev); EFUSE_ShadowUpdate(struct net_device* dev);
extern void extern void
EFUSE_ShadowMapUpdate(struct net_device* dev); EFUSE_ShadowMapUpdate(struct net_device* dev);
...@@ -96,6 +79,4 @@ extern bool ...@@ -96,6 +79,4 @@ extern bool
EFUSE_ProgramMap(struct net_device* dev,char* pFileName, u8 TableType); // 0=Shadow 1=Real Efuse EFUSE_ProgramMap(struct net_device* dev,char* pFileName, u8 TableType); // 0=Shadow 1=Real Efuse
/*--------------------------Exported Function prototype---------------------*/ /*--------------------------Exported Function prototype---------------------*/
/* End of Efuse.h */ #endif
#endif //__INC_EFUSE_H
...@@ -1268,6 +1268,9 @@ typedef struct r8192_priv ...@@ -1268,6 +1268,9 @@ typedef struct r8192_priv
bool EepromOrEfuse; bool EepromOrEfuse;
bool bBootFromEfuse; // system boot form EFUSE bool bBootFromEfuse; // system boot form EFUSE
u8 EfuseMap[2][HWSET_MAX_SIZE_92S]; u8 EfuseMap[2][HWSET_MAX_SIZE_92S];
u16 EfuseUsedBytes;
u8 EfuseUsedPercentage;
u8 EEPROMUsbOption; u8 EEPROMUsbOption;
u8 EEPROMUsbPhyParam[5]; u8 EEPROMUsbPhyParam[5];
......
/* /******************************************************************************
* (c) Copyright 2008, RealTEK Technologies Inc. All Rights Reserved. * Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved.
* Linux device driver for RTL8192U
* *
* Module: r819xusb_cmdpkt.c * This program is distributed in the hope that it will be useful, but WITHOUT
* (RTL8190 TX/RX command packet handler Source C File) * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
* *
* Note: The module is responsible for handling TX and RX command packet. * You should have received a copy of the GNU General Public License along with
* 1.TX: Send set and query configuration command packet. * this program; if not, write to the Free Software Foundation, Inc.,
* 2.RX: Receive tx feedback, beacon state, query configuration, command packet. * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
*/ *
* The full GNU General Public License is included in this distribution in the
* file called LICENSE.
*
* Contact Information:
* wlanfae <wlanfae@realtek.com>
******************************************************************************/
#include "r8192U.h" #include "r8192U.h"
#include "r819xU_cmdpkt.h" #include "r819xU_cmdpkt.h"
...@@ -19,19 +28,13 @@ bool SendTxCommandPacket(struct net_device *dev, void *pData, u32 DataLen) ...@@ -19,19 +28,13 @@ bool SendTxCommandPacket(struct net_device *dev, void *pData, u32 DataLen)
cb_desc *tcb_desc; cb_desc *tcb_desc;
unsigned char *ptr_buf; unsigned char *ptr_buf;
/* PlatformAcquireSpinLock(Adapter, RT_TX_SPINLOCK); */
/* /*
* Get TCB and local buffer from common pool. * Get TCB and local buffer from common pool.
* (It is shared by CmdQ, MgntQ, and USB coalesce DataQ) * (It is shared by CmdQ, MgntQ, and USB coalesce DataQ)
*/ */
skb = dev_alloc_skb(USB_HWDESC_HEADER_LEN + DataLen + 4); skb = dev_alloc_skb(USB_HWDESC_HEADER_LEN + DataLen + 4);
if (skb == NULL) { if (!skb)
RT_TRACE(COMP_ERR, "(%s): unable to alloc skb buffer\n", return false;
__func__);
rtStatus = false;
return rtStatus;
}
memcpy((unsigned char *)(skb->cb), &dev, sizeof(dev)); memcpy((unsigned char *)(skb->cb), &dev, sizeof(dev));
tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE); tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
tcb_desc->queue_index = TXCMD_QUEUE; tcb_desc->queue_index = TXCMD_QUEUE;
...@@ -51,7 +54,6 @@ bool SendTxCommandPacket(struct net_device *dev, void *pData, u32 DataLen) ...@@ -51,7 +54,6 @@ bool SendTxCommandPacket(struct net_device *dev, void *pData, u32 DataLen)
priv->ieee80211->softmac_hard_start_xmit(skb, dev); priv->ieee80211->softmac_hard_start_xmit(skb, dev);
} }
//PlatformReleaseSpinLock(Adapter, RT_TX_SPINLOCK);
return rtStatus; return rtStatus;
} }
...@@ -224,7 +226,6 @@ static void cmpk_handle_interrupt_status(struct net_device *dev, u8 *pmsg) ...@@ -224,7 +226,6 @@ static void cmpk_handle_interrupt_status(struct net_device *dev, u8 *pmsg)
if (priv->ieee80211->iw_mode == IW_MODE_ADHOC) { if (priv->ieee80211->iw_mode == IW_MODE_ADHOC) {
//2 maybe need endian transform? //2 maybe need endian transform?
rx_intr_status.interrupt_status = *((u32 *)(pmsg + 4)); rx_intr_status.interrupt_status = *((u32 *)(pmsg + 4));
//rx_intr_status.InterruptStatus = N2H4BYTE(*((UINT32 *)(pMsg + 4)));
DMESG("interrupt status = 0x%x\n", rx_intr_status.interrupt_status); DMESG("interrupt status = 0x%x\n", rx_intr_status.interrupt_status);
...@@ -491,6 +492,13 @@ cmpk_message_handle_rx( ...@@ -491,6 +492,13 @@ cmpk_message_handle_rx(
cmpk_handle_tx_rate_history(dev, pcmd_buff); cmpk_handle_tx_rate_history(dev, pcmd_buff);
cmd_length = CMPK_TX_RAHIS_SIZE; cmd_length = CMPK_TX_RAHIS_SIZE;
break; break;
case RX_TX_TSSI_MEAN_BACK:
{
u32 *pMsg;
pMsg = (u32 *)pcmd_buff;
}
cmd_length = 32;
break;
default: default:
RT_TRACE(COMP_ERR, "(%s): unknown CMD Element\n", RT_TRACE(COMP_ERR, "(%s): unknown CMD Element\n",
__func__); __func__);
......
...@@ -173,6 +173,7 @@ typedef enum tag_command_packet_directories { ...@@ -173,6 +173,7 @@ typedef enum tag_command_packet_directories {
RX_DBGINFO_FEEDBACK = 5, RX_DBGINFO_FEEDBACK = 5,
RX_TX_PER_PKT_FEEDBACK = 6, RX_TX_PER_PKT_FEEDBACK = 6,
RX_TX_RATE_HISTORY = 7, RX_TX_RATE_HISTORY = 7,
RX_TX_TSSI_MEAN_BACK = 8,
RX_CMD_ELE_MAX RX_CMD_ELE_MAX
} cmpk_element_e; } cmpk_element_e;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment