Commit e7c0c64e authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://gkernel.bkbits.net/net-drivers-2.6

into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents 651bea8c af39cd4d
......@@ -1874,25 +1874,12 @@ endmenu
# Gigabit Ethernet
#
menu "Gigabit Ethernet (1000/10000 Mbit)"
menu "Ethernet (1000 Mbit)"
depends on NETDEVICES
config NET_GIGE
bool "Gigabit Ethernet (1000/10000 Mbit) controller support"
depends on NETDEVICES && NET_ETHERNET && (PCI || SBUS)
help
Gigabit ethernet. It's yummy and fast, fast, fast.
Note that the answer to this question doesn't directly affect the
kernel: saying N will just cause the configurator to skip all
the questions about this class of network cards. If you say Y, you
will be asked for your specific card in the following questions.
If you are unsure, say Y.
config ACENIC
tristate "Alteon AceNIC/3Com 3C985/NetGear GA620 Gigabit support"
depends on PCI && NET_GIGE
depends on PCI
---help---
Say Y here if you have an Alteon AceNIC, 3Com 3C985(B), NetGear
GA620, SGI Gigabit or Farallon PN9000-SX PCI Gigabit Ethernet
......@@ -1919,7 +1906,7 @@ config ACENIC_OMIT_TIGON_I
config DL2K
tristate "D-Link DL2000-based Gigabit Ethernet support"
depends on PCI && NET_GIGE
depends on PCI
select CRC32
help
This driver supports D-Link 2000-based gigabit ethernet cards, which
......@@ -1932,7 +1919,7 @@ config DL2K
config E1000
tristate "Intel(R) PRO/1000 Gigabit Ethernet support"
depends on PCI && NET_GIGE
depends on PCI
---help---
This driver supports Intel(R) PRO/1000 gigabit ethernet family of
adapters, which includes:
......@@ -1979,7 +1966,7 @@ config E1000_NAPI
config MYRI_SBUS
tristate "MyriCOM Gigabit Ethernet support"
depends on SBUS && NET_GIGE
depends on SBUS
help
This driver supports MyriCOM Sbus gigabit Ethernet cards.
......@@ -1988,7 +1975,7 @@ config MYRI_SBUS
config NS83820
tristate "National Semiconduct DP83820 support"
depends on PCI && NET_GIGE
depends on PCI
help
This is a driver for the National Semiconductor DP83820 series
of gigabit ethernet MACs. Cards using this chipset include
......@@ -1998,7 +1985,7 @@ config NS83820
config HAMACHI
tristate "Packet Engines Hamachi GNIC-II support"
depends on PCI && NET_GIGE
depends on PCI
select MII
help
If you have a Gigabit Ethernet card of this type, say Y and read
......@@ -2011,7 +1998,7 @@ config HAMACHI
config YELLOWFIN
tristate "Packet Engines Yellowfin Gigabit-NIC support (EXPERIMENTAL)"
depends on PCI && EXPERIMENTAL && NET_GIGE
depends on PCI && EXPERIMENTAL
select CRC32
---help---
Say Y here if you have a Packet Engines G-NIC PCI Gigabit Ethernet
......@@ -2025,7 +2012,7 @@ config YELLOWFIN
config R8169
tristate "Realtek 8169 gigabit ethernet support"
depends on PCI && NET_GIGE
depends on PCI
select CRC32
---help---
Say Y here if you have a Realtek 8169 PCI Gigabit Ethernet adapter.
......@@ -2035,7 +2022,7 @@ config R8169
config SK98LIN
tristate "Marvell Yukon Chipset / SysKonnect SK-98xx Support"
depends on PCI && NET_GIGE
depends on PCI
---help---
Say Y here if you have a Marvell Yukon or SysKonnect SK-98xx/SK-95xx
compliant Gigabit Ethernet Adapter. The following adapters are supported
......@@ -2114,16 +2101,25 @@ config SK98LIN
config TIGON3
tristate "Broadcom Tigon3 support"
depends on PCI && NET_GIGE
depends on PCI
help
This driver supports Broadcom Tigon3 based gigabit Ethernet cards.
To compile this driver as a module, choose M here: the module
will be called tg3. This is recommended.
endmenu
#
# 10 Gigabit Ethernet
#
menu "Ethernet (10000 Mbit)"
depends on NETDEVICES
config IXGB
tristate "Intel(R) PRO/10GbE support"
depends on PCI && NET_GIGE
depends on PCI
---help---
This driver supports Intel(R) PRO/10GbE family of
adapters, which includes:
......@@ -2155,7 +2151,7 @@ config IXGB_NAPI
config S2IO
tristate "S2IO 10Gbe XFrame NIC"
depends on PCI && NET_GIGE
depends on PCI
---help---
This driver supports the 10Gbe XFrame NIC of S2IO.
For help regarding driver compilation, installation and
......
......@@ -1219,6 +1219,9 @@ plip_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
struct net_local *nl = netdev_priv(dev);
struct plipconf *pc = (struct plipconf *) &rq->ifr_data;
if (cmd != SIOCDEVPLIP)
return -EOPNOTSUPP;
switch(pc->pcmd) {
case PLIP_GET_TIMEOUT:
pc->trigger = nl->trigger;
......
......@@ -205,10 +205,10 @@ ppp_asynctty_close(struct tty_struct *tty)
{
struct asyncppp *ap;
write_lock(&disc_data_lock);
write_lock_irq(&disc_data_lock);
ap = tty->disc_data;
tty->disc_data = 0;
write_unlock(&disc_data_lock);
write_unlock_irq(&disc_data_lock);
if (ap == 0)
return;
......
......@@ -251,10 +251,10 @@ ppp_sync_close(struct tty_struct *tty)
{
struct syncppp *ap;
write_lock(&disc_data_lock);
write_lock_irq(&disc_data_lock);
ap = tty->disc_data;
tty->disc_data = 0;
write_unlock(&disc_data_lock);
write_unlock_irq(&disc_data_lock);
if (ap == 0)
return;
......
......@@ -61,6 +61,9 @@ obj-$(CONFIG_C101) += c101.o
obj-$(CONFIG_WANXL) += wanxl.o
obj-$(CONFIG_PCI200SYN) += pci200syn.o
clean-files := wanxlfw.inc
$(obj)/wanxl.o: $(obj)/wanxlfw.inc
ifeq ($(CONFIG_WANXL_BUILD_FIRMWARE),y)
ifeq ($(ARCH),m68k)
AS68K = $(AS)
......@@ -72,12 +75,12 @@ endif
quiet_cmd_build_wanxlfw = BLD FW $@
cmd_build_wanxlfw = \
$(CPP) -Wp,-MD,$(depfile) -Iinclude $(obj)/wanxlfw.S | $(AS68K) -m68360 -o $(obj)/wanxlfw.o; \
$(CPP) -Wp,-MD,$(depfile) -I$(srctree)/include $< | $(AS68K) -m68360 -o $(obj)/wanxlfw.o; \
$(LD68K) --oformat binary -Ttext 0x1000 $(obj)/wanxlfw.o -o $(obj)/wanxlfw.bin; \
hexdump -ve '"\n" 16/1 "0x%02X,"' $(obj)/wanxlfw.bin | sed 's/0x ,//g;1s/^/static u8 firmware[]={/;$$s/,$$/\n};\n/' >$(obj)/wanxlfw.inc; \
rm -f $(obj)/wanxlfw.bin $(obj)/wanxlfw.o
$(obj)/wanxlfw.inc: $(obj)/wanxlfw.S
$(obj)/wanxlfw.inc: $(src)/wanxlfw.S
$(call if_changed_dep,build_wanxlfw)
targets += wanxlfw.inc
endif
......@@ -379,8 +379,6 @@ static int __init c101_run(unsigned long irq, unsigned long winbase)
return result;
}
/* XXX: are we OK with having that done when card is already up? */
sca_init_sync_port(card); /* Set up C101 memory */
hdlc_set_carrier(!(sca_in(MSCI1_OFFSET + ST3, card) & ST3_DCD), dev);
......
......@@ -180,7 +180,8 @@ static int cisco_rx(struct sk_buff *skb)
case CISCO_KEEPALIVE_REQ:
hdlc->state.cisco.rxseq = ntohl(cisco_data->par1);
if (ntohl(cisco_data->par2)==hdlc->state.cisco.txseq) {
if (hdlc->state.cisco.request_sent &&
ntohl(cisco_data->par2)==hdlc->state.cisco.txseq) {
hdlc->state.cisco.last_poll = jiffies;
if (!hdlc->state.cisco.up) {
u32 sec, min, hrs, days;
......@@ -192,8 +193,9 @@ static int cisco_rx(struct sk_buff *skb)
"uptime %ud%uh%um%us)\n",
dev->name, days, hrs,
min, sec);
netif_carrier_on(dev);
hdlc->state.cisco.up = 1;
}
hdlc->state.cisco.up = 1;
}
dev_kfree_skb_any(skb);
......@@ -219,17 +221,18 @@ static void cisco_timer(unsigned long arg)
struct net_device *dev = (struct net_device *)arg;
hdlc_device *hdlc = dev_to_hdlc(dev);
if (hdlc->state.cisco.up && jiffies - hdlc->state.cisco.last_poll >=
hdlc->state.cisco.settings.timeout * HZ) {
if (hdlc->state.cisco.up &&
time_after(jiffies, hdlc->state.cisco.last_poll +
hdlc->state.cisco.settings.timeout * HZ)) {
hdlc->state.cisco.up = 0;
printk(KERN_INFO "%s: Link down\n", dev->name);
if (netif_carrier_ok(dev))
netif_carrier_off(dev);
netif_carrier_off(dev);
}
cisco_keepalive_send(dev, CISCO_KEEPALIVE_REQ,
++hdlc->state.cisco.txseq,
hdlc->state.cisco.rxseq);
hdlc->state.cisco.request_sent = 1;
hdlc->state.cisco.timer.expires = jiffies +
hdlc->state.cisco.settings.interval * HZ;
hdlc->state.cisco.timer.function = cisco_timer;
......@@ -242,8 +245,8 @@ static void cisco_timer(unsigned long arg)
static void cisco_start(struct net_device *dev)
{
hdlc_device *hdlc = dev_to_hdlc(dev);
hdlc->state.cisco.last_poll = 0;
hdlc->state.cisco.up = 0;
hdlc->state.cisco.request_sent = 0;
hdlc->state.cisco.txseq = hdlc->state.cisco.rxseq = 0;
init_timer(&hdlc->state.cisco.timer);
......@@ -257,9 +260,12 @@ static void cisco_start(struct net_device *dev)
static void cisco_stop(struct net_device *dev)
{
del_timer_sync(&dev_to_hdlc(dev)->state.cisco.timer);
hdlc_device *hdlc = dev_to_hdlc(dev);
del_timer_sync(&hdlc->state.cisco.timer);
if (netif_carrier_ok(dev))
netif_carrier_off(dev);
hdlc->state.cisco.up = 0;
hdlc->state.cisco.request_sent = 0;
}
......
......@@ -584,8 +584,9 @@ static void fr_timer(unsigned long arg)
u32 list;
if (hdlc->state.fr.settings.dce)
reliable = (jiffies - hdlc->state.fr.last_poll <
hdlc->state.fr.settings.t392 * HZ);
reliable = hdlc->state.fr.request &&
time_before(jiffies, hdlc->state.fr.last_poll +
hdlc->state.fr.settings.t392 * HZ);
else {
hdlc->state.fr.last_errors <<= 1; /* Shift the list */
if (hdlc->state.fr.request) {
......@@ -617,6 +618,7 @@ static void fr_timer(unsigned long arg)
fr_lmi_send(dev, hdlc->state.fr.n391cnt == 0);
hdlc->state.fr.last_poll = jiffies;
hdlc->state.fr.request = 1;
hdlc->state.fr.timer.expires = jiffies +
hdlc->state.fr.settings.t391 * HZ;
......@@ -689,6 +691,7 @@ static int fr_lmi_recv(struct net_device *dev, struct sk_buff *skb)
dev->name, reptype);
return 1;
}
hdlc->state.fr.last_poll = jiffies;
}
error = 0;
......@@ -728,7 +731,12 @@ static int fr_lmi_recv(struct net_device *dev, struct sk_buff *skb)
/* DTE */
if (reptype != LMI_FULLREP || error)
hdlc->state.fr.request = 0; /* got response, no request pending */
if (error)
return 0;
if (reptype != LMI_FULLREP)
return 0;
stat_len = 3;
......@@ -829,9 +837,6 @@ static int fr_rx(struct sk_buff *skb)
if (fr_lmi_recv(ndev, skb))
goto rx_error;
else {
/* No request pending */
hdlc->state.fr.request = 0;
hdlc->state.fr.last_poll = jiffies;
dev_kfree_skb_any(skb);
return NET_RX_SUCCESS;
}
......@@ -946,9 +951,6 @@ static void fr_start(struct net_device *dev)
printk(KERN_DEBUG "fr_start\n");
#endif
if (hdlc->state.fr.settings.lmi != LMI_NONE) {
if (netif_carrier_ok(dev))
netif_carrier_off(dev);
hdlc->state.fr.last_poll = 0;
hdlc->state.fr.reliable = 0;
hdlc->state.fr.dce_changed = 1;
hdlc->state.fr.request = 0;
......
......@@ -15,6 +15,11 @@
* * X.25
*
* Use sethdlc utility to set line parameters, protocol and PVCs
*
* How does it work:
* - proto.open(), close(), start(), stop() calls are serialized.
* The order is: open, [ start, stop ... ] close ...
* - proto.start() and stop() are called with spin_lock_irq held.
*/
#include <linux/config.h>
......@@ -33,7 +38,7 @@
#include <linux/hdlc.h>
static const char* version = "HDLC support module revision 1.16";
static const char* version = "HDLC support module revision 1.17";
#undef DEBUG_LINK
......@@ -69,51 +74,75 @@ static int hdlc_rcv(struct sk_buff *skb, struct net_device *dev,
static void __hdlc_set_carrier_on(struct net_device *dev)
{
hdlc_device *hdlc = dev_to_hdlc(dev);
if (hdlc->proto.start)
return hdlc->proto.start(dev);
#ifdef DEBUG_LINK
if (netif_carrier_ok(dev))
printk(KERN_ERR "hdlc_set_carrier_on(): already on\n");
#endif
netif_carrier_on(dev);
}
static void __hdlc_set_carrier_off(struct net_device *dev)
{
hdlc_device *hdlc = dev_to_hdlc(dev);
if (hdlc->proto.stop)
return hdlc->proto.stop(dev);
#ifdef DEBUG_LINK
if (!netif_carrier_ok(dev))
printk(KERN_ERR "hdlc_set_carrier_off(): already off\n");
#endif
netif_carrier_off(dev);
}
void hdlc_set_carrier(int on, struct net_device *dev)
{
hdlc_device *hdlc = dev_to_hdlc(dev);
unsigned long flags;
on = on ? 1 : 0;
#ifdef DEBUG_LINK
printk(KERN_DEBUG "hdlc_set_carrier %i\n", on);
#endif
spin_lock_irq(&hdlc->state_lock);
spin_lock_irqsave(&hdlc->state_lock, flags);
if (hdlc->carrier == on)
goto carrier_exit; /* no change in DCD line level */
printk(KERN_INFO "%s: carrier %s\n", dev->name,
on ? "ON" : "off");
#ifdef DEBUG_LINK
printk(KERN_INFO "%s: carrier %s\n", dev->name, on ? "ON" : "off");
#endif
hdlc->carrier = on;
if (!hdlc->open)
goto carrier_exit;
if (hdlc->carrier) {
if (hdlc->proto.start)
hdlc->proto.start(dev);
else if (!netif_carrier_ok(dev))
netif_carrier_on(dev);
} else { /* no carrier */
if (hdlc->proto.stop)
hdlc->proto.stop(dev);
else if (netif_carrier_ok(dev))
netif_carrier_off(dev);
}
if (hdlc->carrier)
__hdlc_set_carrier_on(dev);
else
__hdlc_set_carrier_off(dev);
carrier_exit:
spin_unlock_irq(&hdlc->state_lock);
carrier_exit:
spin_unlock_irqrestore(&hdlc->state_lock, flags);
}
/* Must be called by hardware driver when HDLC device is being opened */
int hdlc_open(struct net_device *dev)
{
hdlc_device *hdlc = dev_to_hdlc(dev);
#ifdef DEBUG_LINK
printk(KERN_DEBUG "hdlc_open carrier %i open %i\n",
printk(KERN_DEBUG "hdlc_open() carrier %i open %i\n",
hdlc->carrier, hdlc->open);
#endif
......@@ -128,14 +157,8 @@ int hdlc_open(struct net_device *dev)
spin_lock_irq(&hdlc->state_lock);
if (hdlc->carrier) {
if (hdlc->proto.start)
hdlc->proto.start(dev);
else if (!netif_carrier_ok(dev))
netif_carrier_on(dev);
} else if (netif_carrier_ok(dev))
netif_carrier_off(dev);
if (hdlc->carrier)
__hdlc_set_carrier_on(dev);
hdlc->open = 1;
......@@ -150,15 +173,15 @@ void hdlc_close(struct net_device *dev)
{
hdlc_device *hdlc = dev_to_hdlc(dev);
#ifdef DEBUG_LINK
printk(KERN_DEBUG "hdlc_close carrier %i open %i\n",
printk(KERN_DEBUG "hdlc_close() carrier %i open %i\n",
hdlc->carrier, hdlc->open);
#endif
spin_lock_irq(&hdlc->state_lock);
hdlc->open = 0;
if (hdlc->carrier && hdlc->proto.stop)
hdlc->proto.stop(dev);
if (hdlc->carrier)
__hdlc_set_carrier_off(dev);
spin_unlock_irq(&hdlc->state_lock);
......@@ -185,7 +208,7 @@ void hdlc_close(struct net_device *dev)
#endif
#ifndef CONFIG_HDLC_FR
#define hdlc_fr_ioctl(dev, ifr) -ENOSYS
#define hdlc_fr_ioctl(dev, ifr) -ENOSYS
#endif
#ifndef CONFIG_HDLC_X25
......@@ -257,25 +280,7 @@ struct net_device *alloc_hdlcdev(void *priv)
int register_hdlc_device(struct net_device *dev)
{
int result;
hdlc_device *hdlc = dev_to_hdlc(dev);
dev->get_stats = hdlc_get_stats;
dev->change_mtu = hdlc_change_mtu;
dev->mtu = HDLC_MAX_MTU;
dev->type = ARPHRD_RAWHDLC;
dev->hard_header_len = 16;
dev->flags = IFF_POINTOPOINT | IFF_NOARP;
hdlc->proto.id = -1;
hdlc->proto.detach = NULL;
hdlc->carrier = 1;
hdlc->open = 0;
spin_lock_init(&hdlc->state_lock);
result = dev_alloc_name(dev, "hdlc%d");
int result = dev_alloc_name(dev, "hdlc%d");
if (result < 0)
return result;
......@@ -283,6 +288,9 @@ int register_hdlc_device(struct net_device *dev)
if (result != 0)
return -EIO;
if (netif_carrier_ok(dev))
netif_carrier_off(dev); /* no carrier until DCD goes up */
return 0;
}
......
/* $Header: /var/lib/cvs/prism54-ng/ksrc/isl_38xx.c,v 1.22 2004/02/28 03:06:07 mcgrof Exp $
/*
*
* Copyright (C) 2002 Intersil Americas Inc.
* Copyright (C) 2003-2004 Luis R. Rodriguez <mcgrof@ruslug.rutgers.edu>_
......
/* $Header: /var/lib/cvs/prism54-ng/ksrc/isl_38xx.h,v 1.22 2004/02/28 03:06:07 mcgrof Exp $
/*
*
* Copyright (C) 2002 Intersil Americas Inc.
*
......
This diff is collapsed.
/* $Header: /var/lib/cvs/prism54-ng/ksrc/isl_ioctl.h,v 1.30 2004/01/30 16:24:00 ajfa Exp $
/*
*
* Copyright (C) 2002 Intersil Americas Inc.
* (C) 2003 Aurelien Alleaume <slts@free.fr>
......
/*
* $Id: isl_oid.h,v 1.3 2004/03/09 09:05:27 mcgrof Exp $
*
*
* Copyright (C) 2003 Herbert Valerio Riedel <hvr@gnu.org>
* Copyright (C) 2004 Luis R. Rodriguez <mcgrof@ruslug.rutgers.edu>
* Copyright (C) 2004 Aurelien Alleaume <slts@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -457,16 +458,29 @@ enum oid_num_t {
OID_NUM_LAST
};
/* We could add more flags. eg: in which mode are they allowed, ro, rw, ...*/
#define OID_FLAG_CACHED 0x01
#define OID_FLAG_U32 0x02
#define OID_FLAG_MLMEEX 0x04 /* this type is special because of a variable
size field when sending. Not yet implemented (not used in driver). */
#define OID_FLAG_CACHED 0x80
#define OID_FLAG_TYPE 0x7f
#define OID_TYPE_U32 0x01
#define OID_TYPE_SSID 0x02
#define OID_TYPE_KEY 0x03
#define OID_TYPE_BUFFER 0x04
#define OID_TYPE_BSS 0x05
#define OID_TYPE_BSSLIST 0x06
#define OID_TYPE_FREQUENCIES 0x07
#define OID_TYPE_MLME 0x08
#define OID_TYPE_MLMEEX 0x09
#define OID_TYPE_ADDR 0x0A
#define OID_TYPE_RAW 0x0B
/* OID_TYPE_MLMEEX is special because of a variable size field when sending.
* Not yet implemented (not used in driver anyway).
*/
struct oid_t {
enum oid_num_t oid;
short range; /* to define a range of oid */
short size; /* size of the associated data */
short size; /* max size of the associated data */
char flags;
};
......@@ -478,6 +492,7 @@ union oid_res_t {
#define IWMAX_BITRATES 20
#define IWMAX_BSS 24
#define IWMAX_FREQ 30
#define PRIV_STR_SIZE 1024
#endif /* !defined(_ISL_OID_H) */
/* EOF */
/* $Header: /var/lib/cvs/prism54-ng/ksrc/islpci_dev.c,v 1.68 2004/02/28 03:06:07 mcgrof Exp $
/*
*
* Copyright (C) 2002 Intersil Americas Inc.
* Copyright (C) 2003 Herbert Valerio Riedel <hvr@gnu.org>
......@@ -715,9 +715,9 @@ islpci_setup(struct pci_dev *pdev)
priv = netdev_priv(ndev);
priv->ndev = ndev;
priv->pdev = pdev;
priv->monitor_type = ARPHRD_IEEE80211;
priv->ndev->type = (priv->iw_mode == IW_MODE_MONITOR) ?
ARPHRD_IEEE80211: ARPHRD_ETHER;
priv->monitor_type : ARPHRD_ETHER;
/* save the start and end address of the PCI memory area */
ndev->mem_start = (unsigned long) priv->device_base;
......@@ -743,9 +743,11 @@ islpci_setup(struct pci_dev *pdev)
/* initialize workqueue's */
INIT_WORK(&priv->stats_work,
(void (*)(void *)) prism54_update_stats, priv);
priv->stats_timestamp = 0;
INIT_WORK(&priv->reset_task, islpci_do_reset_and_wake, priv);
priv->reset_task_pending = 0;
/* allocate various memory areas */
if (islpci_alloc_memory(priv))
goto do_free_netdev;
......
/* $Header: /var/lib/cvs/prism54-ng/ksrc/islpci_dev.h,v 1.53 2004/02/28 03:06:07 mcgrof Exp $
/*
*
* Copyright (C) 2002 Intersil Americas Inc.
* Copyright (C) 2003 Herbert Valerio Riedel <hvr@gnu.org>
* Copyright (C) 2003 Luis R. Rodriguez <mcgrof@ruslug.rutgers.edu>
* Copyright (C) 2003 Aurelien Alleaume <slts@free.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -25,6 +26,7 @@
#include <linux/version.h>
#include <linux/netdevice.h>
#include <linux/wireless.h>
#include <net/iw_handler.h>
#include <linux/list.h>
#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,41)
......@@ -110,6 +112,10 @@ typedef struct {
struct iw_statistics local_iwstatistics;
struct iw_statistics iwstatistics;
struct iw_spy_data spy_data; /* iwspy support */
int monitor_type; /* ARPHRD_IEEE80211 or ARPHRD_IEEE80211_PRISM */
struct islpci_acl acl;
/* PCI bus allocation & configuration members */
......@@ -187,6 +193,9 @@ typedef struct {
struct list_head bss_wpa_list;
int num_bss_wpa;
struct semaphore wpa_sem;
struct work_struct reset_task;
int reset_task_pending;
} islpci_private;
static inline islpci_state_t
......
/* $Header: /var/lib/cvs/prism54-ng/ksrc/islpci_eth.c,v 1.27 2004/01/30 16:24:00 ajfa Exp $
/*
*
* Copyright (C) 2002 Intersil Americas Inc.
*
* Copyright (C) 2004 Aurelien Alleaume <slts@free.fr>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License
......@@ -24,10 +24,12 @@
#include <linux/delay.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/if_arp.h>
#include "isl_38xx.h"
#include "islpci_eth.h"
#include "islpci_mgt.h"
#include "oid_mgt.h"
/******************************************************************************
Network Interface functions
......@@ -246,6 +248,69 @@ islpci_eth_transmit(struct sk_buff *skb, struct net_device *ndev)
return err;
}
static inline int
islpci_monitor_rx(islpci_private *priv, struct sk_buff **skb)
{
/* The card reports full 802.11 packets but with a 20 bytes
* header and without the FCS. But there a is a bit that
* indicates if the packet is corrupted :-) */
struct rfmon_header *hdr = (struct rfmon_header *) (*skb)->data;
if (hdr->flags & 0x01)
/* This one is bad. Drop it ! */
return -1;
if (priv->ndev->type == ARPHRD_IEEE80211_PRISM) {
struct avs_80211_1_header *avs;
/* extract the relevant data from the header */
u32 clock = hdr->clock;
u8 rate = hdr->rate;
u16 freq = be16_to_cpu(hdr->freq);
u8 rssi = hdr->rssi;
skb_pull(*skb, sizeof (struct rfmon_header));
if (skb_headroom(*skb) < sizeof (struct avs_80211_1_header)) {
struct sk_buff *newskb = skb_copy_expand(*skb,
sizeof (struct
avs_80211_1_header),
0, GFP_ATOMIC);
if (newskb) {
kfree_skb(*skb);
*skb = newskb;
} else
return -1;
/* This behavior is not very subtile... */
}
/* make room for the new header and fill it. */
avs =
(struct avs_80211_1_header *) skb_push(*skb,
sizeof (struct
avs_80211_1_header));
avs->version = htonl(P80211CAPTURE_VERSION);
avs->length = htonl(sizeof (struct avs_80211_1_header));
avs->mactime = __cpu_to_be64(clock);
avs->hosttime = __cpu_to_be64(jiffies);
avs->phytype = htonl(6); /*OFDM: 6 for (g), 8 for (a) */
avs->channel = htonl(channel_of_freq(freq));
avs->datarate = htonl(rate * 5);
avs->antenna = htonl(0); /*unknown */
avs->priority = htonl(0); /*unknown */
avs->ssi_type = htonl(2); /*2: dBm, 3: raw RSSI */
avs->ssi_signal = htonl(rssi);
avs->ssi_noise = htonl(priv->local_iwstatistics.qual.noise); /*better than 'undefined', I assume */
avs->preamble = htonl(0); /*unknown */
avs->encoding = htonl(0); /*unknown */
} else
skb_pull(*skb, sizeof (struct rfmon_header));
(*skb)->protocol = htons(ETH_P_802_2);
(*skb)->mac.raw = (*skb)->data;
(*skb)->pkt_type = PACKET_OTHERHOST;
return 0;
}
int
islpci_eth_receive(islpci_private *priv)
{
......@@ -266,7 +331,8 @@ islpci_eth_receive(islpci_private *priv)
index = priv->free_data_rx % ISL38XX_CB_RX_QSIZE;
size = le16_to_cpu(control_block->rx_data_low[index].size);
skb = priv->data_low_rx[index];
offset = ((unsigned long) le32_to_cpu(control_block->rx_data_low[index].address) -
offset = ((unsigned long)
le32_to_cpu(control_block->rx_data_low[index].address) -
(unsigned long) skb->data) & 3;
#if VERBOSE > SHOW_ERROR_MESSAGES
......@@ -314,29 +380,32 @@ islpci_eth_receive(islpci_private *priv)
/* do some additional sk_buff and network layer parameters */
skb->dev = ndev;
/* take care of monitor mode */
if (priv->iw_mode == IW_MODE_MONITOR) {
/* The card reports full 802.11 packets but with a 20 bytes
* header and without the FCS. But there a is a bit that
* indicates if the packet is corrupted :-) */
/* int i; */
if (skb->data[8] & 0x01){
/* This one is bad. Drop it !*/
discard = 1;
/* printk("BAD\n");*/
/* take care of monitor mode and spy monitoring. */
if (priv->iw_mode == IW_MODE_MONITOR)
discard = islpci_monitor_rx(priv, &skb);
else {
if (skb->data[2 * ETH_ALEN] == 0) {
/* The packet has a rx_annex. Read it for spy monitoring, Then
* remove it, while keeping the 2 leading MAC addr.
*/
struct iw_quality wstats;
struct rx_annex_header *annex =
(struct rx_annex_header *) skb->data;
wstats.level = annex->rfmon.rssi;
/* The noise value can be a bit outdated if nobody's
* reading wireless stats... */
wstats.noise = priv->local_iwstatistics.qual.noise;
wstats.qual = wstats.level - wstats.noise;
wstats.updated = 0x07;
/* Update spy records */
wireless_spy_update(ndev, annex->addr2, &wstats);
memcpy(skb->data + sizeof (struct rfmon_header),
skb->data, 2 * ETH_ALEN);
skb_pull(skb, sizeof (struct rfmon_header));
}
/*
for(i=0;i<50;i++)
printk("%2.2X:",skb->data[i]);
printk("\n");
*/
skb_pull(skb, 20);
skb->protocol = htons(ETH_P_802_2);
skb->mac.raw = skb->data;
skb->pkt_type = PACKET_OTHERHOST;
} else
skb->protocol = eth_type_trans(skb, ndev);
}
skb->ip_summed = CHECKSUM_NONE;
priv->statistics.rx_packets++;
priv->statistics.rx_bytes += size;
......@@ -351,8 +420,7 @@ islpci_eth_receive(islpci_private *priv)
if (discard) {
dev_kfree_skb(skb);
skb = NULL;
}
else
} else
netif_rx(skb);
/* increment the read index for the rx data low queue */
......@@ -403,7 +471,7 @@ islpci_eth_receive(islpci_private *priv)
wmb();
/* increment the driver read pointer */
add_le32p((u32 *) & control_block->
add_le32p((u32 *) &control_block->
driver_curr_frag[ISL38XX_CB_RX_DATA_LQ], 1);
}
......@@ -413,6 +481,15 @@ islpci_eth_receive(islpci_private *priv)
return 0;
}
void
islpci_do_reset_and_wake(void *data)
{
islpci_private *priv = (islpci_private *) data;
islpci_reset(priv, 1);
netif_wake_queue(priv->ndev);
priv->reset_task_pending = 0;
}
void
islpci_eth_tx_timeout(struct net_device *ndev)
{
......@@ -422,13 +499,11 @@ islpci_eth_tx_timeout(struct net_device *ndev)
/* increment the transmit error counter */
statistics->tx_errors++;
#if 0
/* don't do this here! we are not allowed to sleep since we are in interrupt context */
if (islpci_reset(priv))
printk(KERN_ERR "%s: error on TX timeout card reset!\n",
ndev->name);
#endif
if (!priv->reset_task_pending) {
priv->reset_task_pending = 1;
netif_stop_queue(ndev);
schedule_work(&priv->reset_task);
}
/* netif_wake_queue(ndev); */
return;
}
/* $Header: /var/lib/cvs/prism54-ng/ksrc/islpci_eth.h,v 1.5 2004/01/12 22:16:32 jmaurer Exp $
/*
*
* Copyright (C) 2002 Intersil Americas Inc.
*
......@@ -23,9 +23,51 @@
#include "isl_38xx.h"
#include "islpci_dev.h"
struct rfmon_header {
u16 unk0; /* = 0x0000 */
u16 length; /* = 0x1400 */
u32 clock; /* 1MHz clock */
u8 flags;
u8 unk1;
u8 rate;
u8 unk2;
u16 freq;
u16 unk3;
u8 rssi;
u8 padding[3];
} __attribute__ ((packed));
struct rx_annex_header {
u8 addr1[ETH_ALEN];
u8 addr2[ETH_ALEN];
struct rfmon_header rfmon;
} __attribute__ ((packed));
/* wlan-ng (and hopefully others) AVS header, version one. Fields in
* network byte order. */
#define P80211CAPTURE_VERSION 0x80211001
struct avs_80211_1_header {
uint32_t version;
uint32_t length;
uint64_t mactime;
uint64_t hosttime;
uint32_t phytype;
uint32_t channel;
uint32_t datarate;
uint32_t antenna;
uint32_t priority;
uint32_t ssi_type;
int32_t ssi_signal;
int32_t ssi_noise;
uint32_t preamble;
uint32_t encoding;
};
void islpci_eth_cleanup_transmit(islpci_private *, isl38xx_control_block *);
int islpci_eth_transmit(struct sk_buff *, struct net_device *);
int islpci_eth_receive(islpci_private *);
void islpci_eth_tx_timeout(struct net_device *);
void islpci_do_reset_and_wake(void *data);
#endif /* _ISL_GEN_H */
/* $Header: /var/lib/cvs/prism54-ng/ksrc/islpci_hotplug.c,v 1.56 2004/02/26 23:33:02 mcgrof Exp $
/*
*
* Copyright (C) 2002 Intersil Americas Inc.
* Copyright (C) 2003 Herbert Valerio Riedel <hvr@gnu.org>
......
/* $Header: /var/lib/cvs/prism54-ng/ksrc/islpci_mgt.c,v 1.40 2004/02/01 10:57:23 mcgrof Exp $
/*
*
* Copyright (C) 2002 Intersil Americas Inc.
* Copyright 2004 Jens Maurer <Jens.Maurer@gmx.net>
......
/* $Header: /var/lib/cvs/prism54-ng/ksrc/islpci_mgt.h,v 1.22 2004/01/30 16:24:00 ajfa Exp $
/*
*
* Copyright (C) 2002 Intersil Americas Inc.
* Copyright (C) 2003 Luis R. Rodriguez <mcgrof@ruslug.rutgers.edu>
......
This diff is collapsed.
/*
/*
* Copyright (C) 2003 Aurelien Alleaume <slts@free.fr>
*
* This program is free software; you can redistribute it and/or modify
......@@ -28,9 +28,12 @@ int mgt_init(islpci_private *);
void mgt_clean(islpci_private *);
/* I don't know where to put these 3 */
extern const int frequency_list_bg[];
extern const int frequency_list_a[];
int channel_of_freq(int);
void mgt_le_to_cpu(int, void *);
int mgt_set_request(islpci_private *, enum oid_num_t, int, void *);
......@@ -41,11 +44,15 @@ int mgt_commit_list(islpci_private *, enum oid_num_t *, int);
void mgt_set(islpci_private *, enum oid_num_t, void *);
void mgt_get(islpci_private *, enum oid_num_t, void *);
void mgt_commit(islpci_private *);
int mgt_mlme_answer(islpci_private *);
enum oid_num_t mgt_oidtonum(u32 oid);
int mgt_response_to_str(enum oid_num_t, union oid_res_t *, char *);
#endif /* !defined(_OID_MGT_H) */
/* EOF */
......@@ -134,7 +134,7 @@ typedef struct hdlc_device_struct {
int dce_pvc_count;
struct timer_list timer;
int last_poll;
unsigned long last_poll;
int reliable;
int dce_changed;
int request;
......@@ -149,8 +149,9 @@ typedef struct hdlc_device_struct {
cisco_proto settings;
struct timer_list timer;
int last_poll;
unsigned long last_poll;
int up;
int request_sent;
u32 txseq; /* TX sequence number */
u32 rxseq; /* RX sequence number */
}cisco;
......
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