Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 161954
b: refs/heads/master
c: 0370453
h: refs/heads/master
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz authored and Greg Kroah-Hartman committed Sep 15, 2009
1 parent f7015de commit 5b99b31
Show file tree
Hide file tree
Showing 15 changed files with 55 additions and 725 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f8450cf62cec9f3db424956664a11bf29244f968
refs/heads/master: 0370453f6cc0e2d8fab5cb0001127798eb1ddeb6
67 changes: 3 additions & 64 deletions trunk/drivers/staging/rtl8187se/ieee80211/ieee80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@
#include <linux/jiffies.h>
#include <linux/timer.h>
#include <linux/sched.h>

#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13))
#include <linux/wireless.h>
#endif

/*
#ifndef bool
Expand All @@ -47,11 +44,7 @@
#define false 0
#endif
*/
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20))
#ifndef bool
typedef enum{false = 0, true} bool;
#endif
#endif

//#ifdef JOHN_HWSEC
#define KEY_TYPE_NA 0x0
#define KEY_TYPE_WEP40 0x1
Expand Down Expand Up @@ -112,7 +105,6 @@ typedef enum{false = 0, true} bool;

#define IEEE_CRYPT_ALG_NAME_LEN 16

#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,10))
#define ieee80211_wx_get_scan ieee80211_wx_get_scan_rtl
#define ieee80211_wx_set_encode ieee80211_wx_set_encode_rtl
#define ieee80211_wx_get_encode ieee80211_wx_get_encode_rtl
Expand All @@ -122,7 +114,7 @@ typedef enum{false = 0, true} bool;
#define free_ieee80211 free_ieee80211_rtl
#define alloc_ieee80211 alloc_ieee80211_rtl
///////////////////////////////
#endif

//error in ubuntu2.6.22,so add these
#define ieee80211_wake_queue ieee80211_wake_queue_rtl
#define ieee80211_stop_queue ieee80211_stop_queue_rtl
Expand Down Expand Up @@ -205,23 +197,8 @@ typedef struct ieee_param {
#define IW_QUAL_NOISE_UPDATED 0x4
#endif

// linux under 2.6.9 release may not support it, so modify it for common use
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,9))
#define MSECS(t) (1000 * ((t) / HZ) + 1000 * ((t) % HZ) / HZ)
static inline unsigned long msleep_interruptible_rtl(unsigned int msecs)
{
unsigned long timeout = MSECS(msecs) + 1;

while (timeout) {
set_current_state(TASK_UNINTERRUPTIBLE);
timeout = schedule_timeout(timeout);
}
return timeout;
}
#else
#define MSECS(t) msecs_to_jiffies(t)
#define msleep_interruptible_rtl msleep_interruptible
#endif

#define IEEE80211_DATA_LEN 2304
/* Maximum size for the MA-UNITDATA primitive, 802.11 standard section
Expand Down Expand Up @@ -1097,22 +1074,6 @@ enum ieee80211_state {
#define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x"
#define MAC_ARG(x) ((u8*)(x))[0],((u8*)(x))[1],((u8*)(x))[2],((u8*)(x))[3],((u8*)(x))[4],((u8*)(x))[5]


#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,11))
extern inline int is_multicast_ether_addr(const u8 *addr)
{
return ((addr[0] != 0xff) && (0x01 & addr[0]));
}
#endif

#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,13))
extern inline int is_broadcast_ether_addr(const u8 *addr)
{
return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && \
(addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff));
}
#endif

#define CFG_IEEE80211_RESERVE_FCS (1<<0)
#define CFG_IEEE80211_COMPUTE_FCS (1<<1)

Expand Down Expand Up @@ -1313,7 +1274,6 @@ struct ieee80211_device {
unsigned long NumRxOkTotal;
unsigned long NumRxUnicast;//YJ,add,080828,for keep alive
bool bHwRadioOff;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
struct delayed_work softmac_scan_wq;
struct delayed_work associate_retry_wq;
struct delayed_work hw_wakeup_wq;
Expand All @@ -1329,24 +1289,7 @@ struct ieee80211_device {

//Added for RF power on power off by lizhaoming 080512
struct delayed_work GPIOChangeRFWorkItem;
#else

struct work_struct start_ibss_wq;
struct work_struct softmac_scan_wq;
struct work_struct associate_retry_wq;
struct work_struct hw_wakeup_wq;
struct work_struct hw_sleep_wq;
struct work_struct watch_dog_wq;
struct work_struct sw_antenna_wq;
//by amy for rate adaptive 080312
struct work_struct rate_adapter_wq;
//by amy for rate adaptive
struct work_struct hw_dig_wq;
struct work_struct tx_pw_wq;

//Added for RF power on power off by lizhaoming 080512
struct work_struct GPIOChangeRFWorkItem;
#endif
struct workqueue_struct *wq;

/* Callback functions */
Expand Down Expand Up @@ -1690,12 +1633,8 @@ extern int ieee80211_wx_set_freq(struct ieee80211_device *ieee, struct iw_reques

extern int ieee80211_wx_get_freq(struct ieee80211_device *ieee, struct iw_request_info *a,
union iwreq_data *wrqu, char *b);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20))

extern void ieee80211_wx_sync_scan_wq(struct work_struct *work);
#else
extern void ieee80211_wx_sync_scan_wq(struct ieee80211_device *ieee);
#endif
//extern void ieee80211_wx_sync_scan_wq(struct ieee80211_device *ieee);

extern int ieee80211_wx_set_rawtx(struct ieee80211_device *ieee,
struct iw_request_info *info,
Expand Down
4 changes: 0 additions & 4 deletions trunk/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@
#include <asm/string.h>
#include <asm/errno.h>

#if (LINUX_VERSION_CODE<KERNEL_VERSION(2,6,18))
#include<linux/config.h>
#endif

#include "ieee80211.h"

MODULE_AUTHOR("Jouni Malinen");
Expand Down
53 changes: 4 additions & 49 deletions trunk/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt_ccmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,8 @@

#include "ieee80211.h"

#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
#include "rtl_crypto.h"
#else
#include <linux/crypto.h>
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
#include <asm/scatterlist.h>
#else
#include <linux/scatterlist.h>
#endif

//#include <asm/scatterlist.h>
#include <linux/scatterlist.h>

MODULE_AUTHOR("Jouni Malinen");
MODULE_DESCRIPTION("Host AP crypt: CCMP");
Expand Down Expand Up @@ -77,21 +67,7 @@ struct ieee80211_ccmp_data {
void ieee80211_ccmp_aes_encrypt(struct crypto_tfm *tfm,
const u8 pt[16], u8 ct[16])
{
#if((LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21))||(IN_OPENSUSE_SLED))
crypto_cipher_encrypt_one((void *)tfm, ct, pt);
#else
struct scatterlist src, dst;

src.page = virt_to_page(pt);
src.offset = offset_in_page(pt);
src.length = AES_BLOCK_LEN;

dst.page = virt_to_page(ct);
dst.offset = offset_in_page(ct);
dst.length = AES_BLOCK_LEN;

crypto_cipher_encrypt(tfm, &dst, &src, AES_BLOCK_LEN);
#endif
}

static void * ieee80211_ccmp_init(int key_idx)
Expand All @@ -104,33 +80,20 @@ static void * ieee80211_ccmp_init(int key_idx)
memset(priv, 0, sizeof(*priv));
priv->key_idx = key_idx;

#if((LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)) && (!IN_OPENSUSE_SLED))
priv->tfm = crypto_alloc_tfm("aes", 0);
if (priv->tfm == NULL) {
printk(KERN_DEBUG "ieee80211_crypt_ccmp: could not allocate "
"crypto API aes\n");
goto fail;
}
#else
priv->tfm = (void *)crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC);
priv->tfm = (void *)crypto_alloc_cipher("aes", 0, CRYPTO_ALG_ASYNC);
if (IS_ERR(priv->tfm)) {
printk(KERN_DEBUG "ieee80211_crypt_ccmp: could not allocate "
"crypto API aes\n");
priv->tfm = NULL;
goto fail;
}
#endif

return priv;

fail:
if (priv) {
if (priv->tfm)
//#if(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21))
#if((LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)) && (!IN_OPENSUSE_SLED))
crypto_free_tfm(priv->tfm);
#else
crypto_free_cipher((void *)priv->tfm);
#endif
kfree(priv);
}

Expand All @@ -141,13 +104,9 @@ static void * ieee80211_ccmp_init(int key_idx)
static void ieee80211_ccmp_deinit(void *priv)
{
struct ieee80211_ccmp_data *_priv = priv;

if (_priv && _priv->tfm)
//#if(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21))
#if((LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21)) && (!IN_OPENSUSE_SLED))
crypto_free_tfm(_priv->tfm);
#else
crypto_free_cipher((void *)_priv->tfm);
#endif
kfree(priv);
}

Expand Down Expand Up @@ -522,11 +481,7 @@ void ieee80211_crypto_ccmp_exit(void)
}

#if 0
#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
EXPORT_SYMBOL(ieee80211_ccmp_null);
#else
EXPORT_SYMBOL_NOVERS(ieee80211_ccmp_null);
#endif
#endif

//module_init(ieee80211_crypto_ccmp_init);
Expand Down
Loading

0 comments on commit 5b99b31

Please sign in to comment.