Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 126597
b: refs/heads/master
c: 68a193e
h: refs/heads/master
i:
  126595: caced3d
v: v3
  • Loading branch information
Solomon Peachy authored and Greg Kroah-Hartman committed Jan 6, 2009
1 parent 9ef5621 commit 8b1fec5
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 233 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: 187a769636b6d06d8bd31b273df5ab50eb45d344
refs/heads/master: 68a193e4bb4e96fa58d11566b75bb9bcc34ea50b
86 changes: 1 addition & 85 deletions trunk/drivers/staging/wlan-ng/hfa384x_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,23 +171,7 @@ wait_for_completion_interruptible(struct completion *x)
}
#endif

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,69)
static void
usb_init_urb(struct urb *urb)
{
memset(urb, 0, sizeof(*urb));
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) /* tune me! */
urb->count = (atomic_t)ATOMIC_INIT(1);
#endif
spin_lock_init(&urb->lock);
}
#endif

#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) /* tune me! */
# define SUBMIT_URB(u,f) usb_submit_urb(u,f)
#else
# define SUBMIT_URB(u,f) usb_submit_urb(u)
#endif
#define SUBMIT_URB(u,f) usb_submit_urb(u,f)

/*================================================================*/
/* Project Includes */
Expand Down Expand Up @@ -1594,78 +1578,10 @@ hfa384x_copy_to_aux(
----------------------------------------------------------------*/
int hfa384x_corereset(hfa384x_t *hw, int holdtime, int settletime, int genesis)
{
#if 0
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
struct usb_device *parent = hw->usb->parent;
int i;
int port = -1;
#endif
#endif
int result = 0;


#define P2_USB_RT_PORT (USB_TYPE_CLASS | USB_RECIP_OTHER)
#define P2_USB_FEAT_RESET 4
#define P2_USB_FEAT_C_RESET 20

DBFENTER;

#if 0
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
/* Find the hub port */
for ( i = 0; i < parent->maxchild; i++) {
if (parent->children[i] == hw->usb) {
port = i;
break;
}
}
if (port < 0) return -ENOENT;

/* Set and clear the reset */
usb_control_msg(parent, usb_sndctrlpipe(parent, 0),
USB_REQ_SET_FEATURE, P2_USB_RT_PORT, P2_USB_FEAT_RESET,
port+1, NULL, 0, 1*HZ);
wait_ms(holdtime);
usb_control_msg(parent, usb_sndctrlpipe(parent, 0),
USB_REQ_CLEAR_FEATURE, P2_USB_RT_PORT, P2_USB_FEAT_C_RESET,
port+1, NULL, 0, 1*HZ);
wait_ms(settletime);

/* Set the device address */
result=usb_set_address(hw->usb);
if (result < 0) {
WLAN_LOG_ERROR("reset_usbdev: Dev not accepting address, "
"result=%d\n", result);
clear_bit(hw->usb->devnum, &hw->usb->bus->devmap.devicemap);
hw->usb->devnum = -1;
goto done;
}
/* Let the address settle */
wait_ms(20);

/* Assume we're reusing the original descriptor data */

/* Set the configuration. */
WLAN_LOG_DEBUG(3, "Setting Configuration %d\n",
hw->usb->config[0].bConfigurationValue);
result=usb_set_configuration(hw->usb, hw->usb->config[0].bConfigurationValue);
if ( result ) {
WLAN_LOG_ERROR("usb_set_configuration() failed, result=%d.\n",
result);
goto done;
}
/* Let the configuration settle */
wait_ms(20);

done:
#else
result=usb_reset_device(hw->usb);
if(result<0) {
WLAN_LOG_ERROR("usb_reset_device() failed, result=%d.\n",result);
}
#endif
#endif

result=usb_reset_device(hw->usb);
if(result<0) {
WLAN_LOG_ERROR("usb_reset_device() failed, result=%d.\n",result);
Expand Down
13 changes: 0 additions & 13 deletions trunk/drivers/staging/wlan-ng/p80211mod.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@
#include <linux/version.h>

#include <linux/module.h>
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,25))
#include <linux/moduleparam.h>
#endif

#include <linux/kernel.h>
#include <linux/sched.h>
Expand Down Expand Up @@ -154,14 +152,7 @@ int init_module(void)
{
DBFENTER;

#if 0
printk(KERN_NOTICE "%s (%s) Loaded\n", version, WLAN_BUILD_DATE);
#endif

p80211netdev_startup();
#ifdef CONFIG_HOTPLUG
p80211_run_sbin_hotplug(NULL, WLAN_HOTPLUG_STARTUP);
#endif

DBFEXIT;
return 0;
Expand Down Expand Up @@ -191,11 +182,7 @@ void cleanup_module(void)
{
DBFENTER;

#ifdef CONFIG_HOTPLUG
p80211_run_sbin_hotplug(NULL, WLAN_HOTPLUG_SHUTDOWN);
#endif
p80211netdev_shutdown();
printk(KERN_NOTICE "%s Unloaded\n", version);

DBFEXIT;
return;
Expand Down
95 changes: 0 additions & 95 deletions trunk/drivers/staging/wlan-ng/p80211netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,6 @@ static int p80211knetdev_open( netdevice_t *netdev )
if ( wlandev->open != NULL) {
result = wlandev->open(wlandev);
if ( result == 0 ) {
#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,3,43) )
netdev->interrupt = 0;
#endif
p80211netdev_start_queue(wlandev);
wlandev->state = WLAN_DEVICE_OPEN;
}
Expand Down Expand Up @@ -478,15 +475,6 @@ static int p80211knetdev_hard_start_xmit( struct sk_buff *skb, netdevice_t *netd
memset(&p80211_hdr, 0, sizeof(p80211_hdr_t));
memset(&p80211_wep, 0, sizeof(p80211_metawep_t));

#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,38) )
if ( test_and_set_bit(0, (void*)&(netdev->tbusy)) != 0 ) {
/* We've been called w/ tbusy set, has the tx */
/* path stalled? */
WLAN_LOG_DEBUG(1, "called when tbusy set\n");
result = 1;
goto failed;
}
#else
if ( netif_queue_stopped(netdev) ) {
WLAN_LOG_DEBUG(1, "called when queue stopped.\n");
result = 1;
Expand All @@ -495,12 +483,6 @@ static int p80211knetdev_hard_start_xmit( struct sk_buff *skb, netdevice_t *netd

netif_stop_queue(netdev);

/* No timeout handling here, 2.3.38+ kernels call the
* timeout function directly.
* TODO: Add timeout handling.
*/
#endif

/* Check to see that a valid mode is set */
switch( wlandev->macmode ) {
case WLAN_MACMODE_IBSS_STA:
Expand Down Expand Up @@ -792,15 +774,9 @@ static int p80211knetdev_set_mac_address(netdevice_t *dev, void *addr)

DBFENTER;
/* If we're running, we don't allow MAC address changes */
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,38) )
if ( dev->start) {
return -EBUSY;
}
#else
if (netif_running(dev)) {
return -EBUSY;
}
#endif

/* Set up some convenience pointers. */
mibattr = &dot11req.mibattribute;
Expand Down Expand Up @@ -939,12 +915,7 @@ int wlan_setup(wlandevice_t *wlandev)
#endif
#endif

#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,38) )
dev->tbusy = 1;
dev->start = 0;
#else
netif_stop_queue(dev);
#endif
#ifdef HAVE_CHANGE_MTU
dev->change_mtu = wlan_change_mtu;
#endif
Expand Down Expand Up @@ -1039,11 +1010,7 @@ int register_wlandev(wlandevice_t *wlandev)
return -EIO;
}

#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0) )
dev->name = wlandev->name;
#else
strcpy(wlandev->name, dev->name);
#endif

#ifdef CONFIG_PROC_FS
if (proc_p80211) {
Expand All @@ -1062,10 +1029,6 @@ int register_wlandev(wlandevice_t *wlandev)
}
#endif

#ifdef CONFIG_HOTPLUG
p80211_run_sbin_hotplug(wlandev, WLAN_HOTPLUG_REGISTER);
#endif

DBFEXIT;
return 0;
}
Expand Down Expand Up @@ -1094,10 +1057,6 @@ int unregister_wlandev(wlandevice_t *wlandev)

DBFENTER;

#ifdef CONFIG_HOTPLUG
p80211_run_sbin_hotplug(wlandev, WLAN_HOTPLUG_REMOVE);
#endif

#ifdef CONFIG_PROC_FS
if ( wlandev->procwlandev ) {
remove_proc_entry("wlandev", wlandev->procdir);
Expand Down Expand Up @@ -1416,72 +1375,18 @@ static int p80211_rx_typedrop( wlandevice_t *wlandev, UINT16 fc)
return drop;
}

#ifdef CONFIG_HOTPLUG
/* Notify userspace when a netdevice event occurs,
* by running '/sbin/hotplug net' with certain
* environment variables set.
*/
int p80211_run_sbin_hotplug(wlandevice_t *wlandev, char *action)
{
char *argv[3], *envp[7], ifname[12 + IFNAMSIZ], action_str[32];
char nsdname[32], wlan_wext[32];
int i;

if (wlandev) {
sprintf(ifname, "INTERFACE=%s", wlandev->name);
sprintf(nsdname, "NSDNAME=%s", wlandev->nsdname);
} else {
sprintf(ifname, "INTERFACE=null");
sprintf(nsdname, "NSDNAME=null");
}

sprintf(wlan_wext, "WLAN_WEXT=%s", wlan_wext_write ? "y" : "");
sprintf(action_str, "ACTION=%s", action);

i = 0;
argv[i++] = hotplug_path;
argv[i++] = "wlan";
argv[i] = NULL;

i = 0;
/* minimal command environment */
envp [i++] = "HOME=/";
envp [i++] = "PATH=/sbin:/bin:/usr/sbin:/usr/bin";
envp [i++] = ifname;
envp [i++] = action_str;
envp [i++] = nsdname;
envp [i++] = wlan_wext;
envp [i] = NULL;

#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,62))
return call_usermodehelper(argv [0], argv, envp);
#else
return call_usermodehelper(argv [0], argv, envp, 0);
#endif
}

#endif


void p80211_suspend(wlandevice_t *wlandev)
{
DBFENTER;

#ifdef CONFIG_HOTPLUG
p80211_run_sbin_hotplug(wlandev, WLAN_HOTPLUG_SUSPEND);
#endif

DBFEXIT;
}

void p80211_resume(wlandevice_t *wlandev)
{
DBFENTER;

#ifdef CONFIG_HOTPLUG
p80211_run_sbin_hotplug(wlandev, WLAN_HOTPLUG_RESUME);
#endif

DBFEXIT;
}

Expand Down
25 changes: 0 additions & 25 deletions trunk/drivers/staging/wlan-ng/p80211netdev.h
Original file line number Diff line number Diff line change
Expand Up @@ -289,48 +289,23 @@ p80211netdev_stop_queue(wlandevice_t *wlandev)
{
if ( !wlandev ) return;
if ( !wlandev->netdev ) return;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,38) )
wlandev->netdev->tbusy = 1;
wlandev->netdev->start = 0;
#else
netif_stop_queue(wlandev->netdev);
#endif
}

static inline void
p80211netdev_start_queue(wlandevice_t *wlandev)
{
if ( !wlandev ) return;
if ( !wlandev->netdev ) return;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,38) )
wlandev->netdev->tbusy = 0;
wlandev->netdev->start = 1;
#else
netif_start_queue(wlandev->netdev);
#endif
}

static inline void
p80211netdev_wake_queue(wlandevice_t *wlandev)
{
if ( !wlandev ) return;
if ( !wlandev->netdev ) return;
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,38) )
wlandev->netdev->tbusy = 0;
mark_bh(NET_BH);
#else
netif_wake_queue(wlandev->netdev);
#endif
}

#ifdef CONFIG_HOTPLUG
#define WLAN_HOTPLUG_REGISTER "register"
#define WLAN_HOTPLUG_REMOVE "remove"
#define WLAN_HOTPLUG_STARTUP "startup"
#define WLAN_HOTPLUG_SHUTDOWN "shutdown"
#define WLAN_HOTPLUG_SUSPEND "suspend"
#define WLAN_HOTPLUG_RESUME "resume"
int p80211_run_sbin_hotplug(wlandevice_t *wlandev, char *action);
#endif

#endif
10 changes: 0 additions & 10 deletions trunk/drivers/staging/wlan-ng/prism2sta.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,27 +56,17 @@

#include "version.h"


#include <linux/version.h>

#include <linux/module.h>
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,25))
#include <linux/moduleparam.h>
#endif

#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/types.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/wireless.h>
#include <linux/netdevice.h>

#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
#include <linux/tqueue.h>
#else
#include <linux/workqueue.h>
#endif

#include <asm/io.h>
#include <linux/delay.h>
Expand Down
Loading

0 comments on commit 8b1fec5

Please sign in to comment.