* [PATCH] Slowly update in-kernel orinoco drivers to upstream current CVS
@ 2004-07-12 19:33 Francois Romieu
2004-07-14 18:37 ` Jeff Garzik
2004-07-14 20:15 ` [PATCH] Slowly update in-kernel orinoco drivers to upstream current CVS Pavel Roskin
0 siblings, 2 replies; 31+ messages in thread
From: Francois Romieu @ 2004-07-12 19:33 UTC (permalink / raw)
To: Linux kernel mailing list
Cc: Jeff Garzik, David Gibson, jt, Dan Williams, Pavel Roskin
A serie of patches is available for at:
http://www.fr.zoreil.com/linux/kernel/2.6.x/2.6.7-mm7
It contains 12 patches and applies against 2.6.7-mm7. The patches are
commented. The comments are partly taken from the cvs log by Pavel Roskin.
Tarball available at:
http://www.fr.zoreil.com/linux/kernel/2.6.x/2.6.7-mm7/orinoco.tar.bz2
Please review/comment/suggest a target to patch-bomb.
The remaining 30~35 patches are on the way.
If nobody minds, I'll move the thread to netdev.
--
Ueimor
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH] Slowly update in-kernel orinoco drivers to upstream current CVS
2004-07-12 19:33 [PATCH] Slowly update in-kernel orinoco drivers to upstream current CVS Francois Romieu
@ 2004-07-14 18:37 ` Jeff Garzik
2004-07-15 1:01 ` David Gibson
2004-07-14 20:15 ` [PATCH] Slowly update in-kernel orinoco drivers to upstream current CVS Pavel Roskin
1 sibling, 1 reply; 31+ messages in thread
From: Jeff Garzik @ 2004-07-14 18:37 UTC (permalink / raw)
To: Francois Romieu
Cc: Linux kernel mailing list, David Gibson, jt, Dan Williams,
Pavel Roskin
Francois Romieu wrote:
> A serie of patches is available for at:
> http://www.fr.zoreil.com/linux/kernel/2.6.x/2.6.7-mm7
>
> It contains 12 patches and applies against 2.6.7-mm7. The patches are
> commented. The comments are partly taken from the cvs log by Pavel Roskin.
>
> Tarball available at:
> http://www.fr.zoreil.com/linux/kernel/2.6.x/2.6.7-mm7/orinoco.tar.bz2
>
> Please review/comment/suggest a target to patch-bomb.
Feel free to patchbomb me in private.
Ideally the obvious, simple-to-review changes come first?
Jeff
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH] Slowly update in-kernel orinoco drivers to upstream current CVS
2004-07-12 19:33 [PATCH] Slowly update in-kernel orinoco drivers to upstream current CVS Francois Romieu
2004-07-14 18:37 ` Jeff Garzik
@ 2004-07-14 20:15 ` Pavel Roskin
2004-07-15 1:26 ` David Gibson
1 sibling, 1 reply; 31+ messages in thread
From: Pavel Roskin @ 2004-07-14 20:15 UTC (permalink / raw)
To: Francois Romieu
Cc: Linux kernel mailing list, Jeff Garzik, David Gibson, jt,
Dan Williams
On Mon, 12 Jul 2004, Francois Romieu wrote:
> A serie of patches is available for at:
> http://www.fr.zoreil.com/linux/kernel/2.6.x/2.6.7-mm7
>
> It contains 12 patches and applies against 2.6.7-mm7. The patches are
> commented. The comments are partly taken from the cvs log by Pavel Roskin.
I hope the patches lead to the CVS version on the "for_linus" branch which
has no compatibility code. I'm quite comfortable with the "for_linus" and
"Standalone" branches.
As for the HEAD branch, it has unfinished (skeleton only) prism_usb driver
meant for Intersil Prism USB devices (such as DWL-122). It also has
working orinoco_usb driver. Unfortunately, I don't feel good about that
code. The way how this code is integrated with the common code is
questionable. A lot of work would be needed to handle USB better.
That's not something that could be done before the next release.
I'm very busy now and I don't have time to finish the little bits I
planned for the 0.15 release. However, the CVS version on the "for_linus"
branch is releasable and has no known regressions compared to any previous
version. Feel free to apply the patches to the kernel now. I expect to
have more time for free software in the end of August.
If David is OK, we could release the current code as version 0.15. I'm OK
with it. I have to adapt my ambitions to my time constraints. I'll
appreciate if my name is added to the MAINTAINERS file once the new driver
is committed.
--
Regards,
Pavel Roskin
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH] Slowly update in-kernel orinoco drivers to upstream current CVS
2004-07-14 18:37 ` Jeff Garzik
@ 2004-07-15 1:01 ` David Gibson
2004-07-17 11:45 ` Francois Romieu
2004-07-27 17:18 ` Jeff Garzik
0 siblings, 2 replies; 31+ messages in thread
From: David Gibson @ 2004-07-15 1:01 UTC (permalink / raw)
To: Jeff Garzik
Cc: Francois Romieu, Linux kernel mailing list, jt, Dan Williams,
Pavel Roskin
On Wed, Jul 14, 2004 at 02:37:44PM -0400, Jeff Garzik wrote:
> Francois Romieu wrote:
> >A serie of patches is available for at:
> >http://www.fr.zoreil.com/linux/kernel/2.6.x/2.6.7-mm7
> >
> >It contains 12 patches and applies against 2.6.7-mm7. The patches are
> >commented. The comments are partly taken from the cvs log by Pavel Roskin.
> >
> >Tarball available at:
> >http://www.fr.zoreil.com/linux/kernel/2.6.x/2.6.7-mm7/orinoco.tar.bz2
> >
> >Please review/comment/suggest a target to patch-bomb.
>
> Feel free to patchbomb me in private.
>
> Ideally the obvious, simple-to-review changes come first?
I've started to have a look at the patches. Unfortunately, they're
still not really as logically separated as they should be. Which I
guess means I wasn't sufficiently disciplined putting them into CVS in
the first place.
I've started working on my own series of logical patches, starting
with, as you say the "content free" ones first. Initial set with
series file at
http://www.ozlabs.org/people/dgibson/orinoco-patches
Nothing there so far that should cause any functional change.
--
David Gibson | For every complex problem there is a
david AT gibson.dropbear.id.au | solution which is simple, neat and
| wrong.
http://www.ozlabs.org/people/dgibson
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH] Slowly update in-kernel orinoco drivers to upstream current CVS
2004-07-14 20:15 ` [PATCH] Slowly update in-kernel orinoco drivers to upstream current CVS Pavel Roskin
@ 2004-07-15 1:26 ` David Gibson
0 siblings, 0 replies; 31+ messages in thread
From: David Gibson @ 2004-07-15 1:26 UTC (permalink / raw)
To: Pavel Roskin
Cc: Francois Romieu, Linux kernel mailing list, Jeff Garzik, jt,
Dan Williams
On Wed, Jul 14, 2004 at 04:15:59PM -0400, Pavel Roskin wrote:
> On Mon, 12 Jul 2004, Francois Romieu wrote:
>
> >A serie of patches is available for at:
> >http://www.fr.zoreil.com/linux/kernel/2.6.x/2.6.7-mm7
> >
> >It contains 12 patches and applies against 2.6.7-mm7. The patches are
> >commented. The comments are partly taken from the cvs log by Pavel Roskin.
>
> I hope the patches lead to the CVS version on the "for_linus" branch which
> has no compatibility code. I'm quite comfortable with the "for_linus" and
> "Standalone" branches.
>
> As for the HEAD branch, it has unfinished (skeleton only) prism_usb driver
> meant for Intersil Prism USB devices (such as DWL-122). It also has
> working orinoco_usb driver. Unfortunately, I don't feel good about that
> code. The way how this code is integrated with the common code is
> questionable. A lot of work would be needed to handle USB better.
> That's not something that could be done before the next release.
I concur.
> I'm very busy now and I don't have time to finish the little bits I
> planned for the 0.15 release. However, the CVS version on the "for_linus"
> branch is releasable and has no known regressions compared to any previous
> version. Feel free to apply the patches to the kernel now. I expect to
> have more time for free software in the end of August.
Good to hear.
> If David is OK, we could release the current code as version 0.15. I'm OK
> with it. I have to adapt my ambitions to my time constraints.
I'm reasonably comfortable with that. I now have a handful of things
to commit before 0.15 which I've picked up while doing the merge with
mainline, but it's just whitespace and other trivialities.
> I'll
> appreciate if my name is added to the MAINTAINERS file once the new driver
> is committed.
Absolutely. Haven't put that patch together yet, but it's coming :)
--
David Gibson | For every complex problem there is a
david AT gibson.dropbear.id.au | solution which is simple, neat and
| wrong.
http://www.ozlabs.org/people/dgibson
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH] Slowly update in-kernel orinoco drivers to upstream current CVS
2004-07-15 1:01 ` David Gibson
@ 2004-07-17 11:45 ` Francois Romieu
2004-07-27 17:18 ` Jeff Garzik
1 sibling, 0 replies; 31+ messages in thread
From: Francois Romieu @ 2004-07-17 11:45 UTC (permalink / raw)
To: David Gibson, Jeff Garzik, Linux kernel mailing list, jt,
Dan Williams, Pavel Roskin
David Gibson <hermes@gibson.dropbear.id.au> :
[...]
> I've started to have a look at the patches. Unfortunately, they're
> still not really as logically separated as they should be. Which I
Point taken. Thanks for the review/comment.
> guess means I wasn't sufficiently disciplined putting them into CVS in
> the first place.
Not at all. It is simply due to the fact that
- I started working on the giant diff;
- patch-scripts (TM) is not too bad to rework (insert/split) patches so
I do not try to make the patches perfect from the start.
If there is a specfic tag in the cvs tree which is supposed to be synced
with the kernel tree at a given time, it could make my life easier though.
> I've started working on my own series of logical patches, starting
> with, as you say the "content free" ones first. Initial set with
> series file at
> http://www.ozlabs.org/people/dgibson/orinoco-patches
orinoco-rearrange apart, they look nice.
Minor nit:
--- working-2.6.orig/drivers/net/wireless/orinoco.c
+++ working-2.6/drivers/net/wireless/orinoco.c
@@ -2327,7 +2327,7 @@
priv = netdev_priv(dev);
priv->ndev = dev;
if (sizeof_card)
- priv->card = (void *)((unsigned long)dev->priv + sizeof(struct orinoco_private));
+ priv->card = (void *)((unsigned long)netdev_priv(dev) + sizeof(struct orinoco_private));
-> I'd simply turn 'dev->priv' into 'priv'.
--
Ueimor
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [PATCH] Slowly update in-kernel orinoco drivers to upstream current CVS
2004-07-15 1:01 ` David Gibson
2004-07-17 11:45 ` Francois Romieu
@ 2004-07-27 17:18 ` Jeff Garzik
2004-07-28 6:51 ` [0/15] orinoco merge preliminaries David Gibson
1 sibling, 1 reply; 31+ messages in thread
From: Jeff Garzik @ 2004-07-27 17:18 UTC (permalink / raw)
To: David Gibson
Cc: Francois Romieu, Linux kernel mailing list, jt, Dan Williams,
Pavel Roskin
> I've started to have a look at the patches. Unfortunately, they're
> still not really as logically separated as they should be. Which I
> guess means I wasn't sufficiently disciplined putting them into CVS in
> the first place.
>
> I've started working on my own series of logical patches, starting
> with, as you say the "content free" ones first. Initial set with
> series file at
> http://www.ozlabs.org/people/dgibson/orinoco-patches
>
> Nothing there so far that should cause any functional change.
Feel free to start emailing them, so I can queue them up.
One email per patch, please.
Jeff
^ permalink raw reply [flat|nested] 31+ messages in thread
* [0/15] orinoco merge preliminaries
2004-07-27 17:18 ` Jeff Garzik
@ 2004-07-28 6:51 ` David Gibson
2004-07-28 6:53 ` [1/15] orinoco merge preliminaries - squash backwards compatibility David Gibson
2004-07-28 22:50 ` [0/15] orinoco merge preliminaries Francois Romieu
0 siblings, 2 replies; 31+ messages in thread
From: David Gibson @ 2004-07-28 6:51 UTC (permalink / raw)
To: Jeff Garzik
Cc: Francois Romieu, Linux kernel mailing list, jt, Dan Williams,
Pavel Roskin, Orinoco Development List
On Tue, Jul 27, 2004 at 01:18:03PM -0400, Jeff Garzik wrote:
> >I've started to have a look at the patches. Unfortunately, they're
> >still not really as logically separated as they should be. Which I
> >guess means I wasn't sufficiently disciplined putting them into CVS in
> >the first place.
> >
> >I've started working on my own series of logical patches, starting
> >with, as you say the "content free" ones first. Initial set with
> >series file at
> > http://www.ozlabs.org/people/dgibson/orinoco-patches
> >
> >Nothing there so far that should cause any functional change.
>
>
> Feel free to start emailing them, so I can queue them up.
>
> One email per patch, please.
Ok, patchbombing commences.
Following are 15 patches which make a start on merging the current CVS
orinoco driver into the mainline tree. This batch of patches is only
preliminaries - patches which cause no behavioural change, but which
should be easy to review and which will reduce meaningless noise in
the later functional patches.
They all represent essentially trivial changes, and with the exception
of the rearrange patch (which is large because it moves big chunks of
code around) they should be obvious. This batch of patches is
supposed to represent all the trivial, non-behaviour-changing
differences between orinoco CVS and mainline, though the merge is so
large, inevitably I will have missed a few.
Summary of the patches:
1/15 orinoco-squash-backwards-compat:
Removes old unnecessary backwards compatibility code
2/15 orinoco-rearrange:
Rearrange code so function order matches new versions
3/15 orinoco-netdev-priv:
Use netdev_priv() instead of direct dev->priv access
4/15 orinoco-ALIGN:
Use standard ALIGN macro instead of local versions
5/15 orinoco-ARRAY-SIZE:
Use ARRAY_SIZE macro instead of local version
6/15 orinoco-spam-stoppers:
Anti-spam obfuscate email addresses in source
7/15 orinoco-comments-whitespace-spelling
Whitespace/spelling/capitalisation updates
8/15 orinoco-BUG-ON:
Use BUG_ON() instead of explicit if () BUG() logic
9/15 orinoco-add-statics:
Make some functions static that always should have been
10/15 orinoco-trivial-cleanup:
Tiny changes than don't belong with anything else
11/15 orinoco-driver-name-version:
Reduce duplication of the driver names/version
12/15 orinoco-uneeded-includes:
Remove unnecessary #includes
13/15 orinoco-no-struct-typedef:
Don't use typedefs on simple structues
14/15 orinoco-more-hw-data:
Extra hw related #defines and structures
15/15 orinoco-update-authorship:
Update MAINTAINERS, copyright banners, etc.
--
David Gibson | For every complex problem there is a
david AT gibson.dropbear.id.au | solution which is simple, neat and
| wrong.
http://www.ozlabs.org/people/dgibson
^ permalink raw reply [flat|nested] 31+ messages in thread
* [1/15] orinoco merge preliminaries - squash backwards compatibility
2004-07-28 6:51 ` [0/15] orinoco merge preliminaries David Gibson
@ 2004-07-28 6:53 ` David Gibson
2004-07-28 6:53 ` [2/15] orinoco merge preliminaries - rearrange code David Gibson
2004-07-28 22:50 ` [0/15] orinoco merge preliminaries Francois Romieu
1 sibling, 1 reply; 31+ messages in thread
From: David Gibson @ 2004-07-28 6:53 UTC (permalink / raw)
To: Jeff Garzik, Francois Romieu, Linux kernel mailing list, jt,
Dan Williams, Pavel Roskin, Orinoco Development List
Remove various bits of code in the orinoco driver for backwards
compatibility with older kernels: old versions of the wireless
extensions, lack of MODULE_LICENSE, older PCMCIA interfaces.
Signed-off-by: David Gibson <hermes@gibson.dropbear.id.au>
Index: working-2.6/drivers/net/wireless/orinoco.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco.c
+++ working-2.6/drivers/net/wireless/orinoco.c
@@ -446,9 +446,7 @@
MODULE_AUTHOR("David Gibson <hermes@gibson.dropbear.id.au>");
MODULE_DESCRIPTION("Driver for Lucent Orinoco, Prism II based and similar wireless cards");
-#ifdef MODULE_LICENSE
MODULE_LICENSE("Dual MPL/GPL");
-#endif
/* Level of debugging. Used in the macros in orinoco.h */
#ifdef ORINOCO_DEBUG
@@ -464,11 +462,6 @@
/* Compile time configuration and compatibility stuff */
/********************************************************************/
-/* Wireless extensions backwards compatibility */
-#ifndef SIOCIWFIRSTPRIV
-#define SIOCIWFIRSTPRIV SIOCDEVPRIVATE
-#endif /* SIOCIWFIRSTPRIV */
-
/* We do this this way to avoid ifdefs in the actual code */
#ifdef WIRELESS_SPY
#define SPY_NUMBER(priv) (priv->spy_number)
@@ -1614,13 +1607,11 @@
le16_to_cpu(tallies.RxDiscards_WEPExcluded);
wstats->discard.misc +=
le16_to_cpu(tallies.TxDiscardsWrongSA);
-#if WIRELESS_EXT > 11
wstats->discard.fragment +=
le16_to_cpu(tallies.RxMsgInBadMsgFragments);
wstats->discard.retries +=
le16_to_cpu(tallies.TxRetryLimitExceeded);
/* wstats->miss.beacon - no match */
-#endif /* WIRELESS_EXT > 11 */
}
break;
case HERMES_INQ_LINKSTATUS: {
@@ -2582,10 +2573,8 @@
/* Much of this shamelessly taken from wvlan_cs.c. No idea
* what it all means -dgibson */
-#if WIRELESS_EXT > 10
range.we_version_compiled = WIRELESS_EXT;
range.we_version_source = 11;
-#endif /* WIRELESS_EXT > 10 */
range.min_nwid = range.max_nwid = 0; /* We don't use nwids */
@@ -2612,22 +2601,17 @@
range.max_qual.qual = 0;
range.max_qual.level = 0;
range.max_qual.noise = 0;
-#if WIRELESS_EXT > 11
range.avg_qual.qual = 0;
range.avg_qual.level = 0;
range.avg_qual.noise = 0;
-#endif /* WIRELESS_EXT > 11 */
-
} else {
range.max_qual.qual = 0x8b - 0x2f;
range.max_qual.level = 0x2f - 0x95 - 1;
range.max_qual.noise = 0x2f - 0x95 - 1;
-#if WIRELESS_EXT > 11
/* Need to get better values */
range.avg_qual.qual = 0x24;
range.avg_qual.level = 0xC2;
range.avg_qual.noise = 0x9E;
-#endif /* WIRELESS_EXT > 11 */
}
err = orinoco_hw_get_bitratelist(priv, &numrates,
@@ -2680,7 +2664,6 @@
range.txpower[0] = 15; /* 15dBm */
range.txpower_capa = IW_TXPOW_DBM;
-#if WIRELESS_EXT > 10
range.retry_capa = IW_RETRY_LIMIT | IW_RETRY_LIFETIME;
range.retry_flags = IW_RETRY_LIMIT;
range.r_time_flags = IW_RETRY_LIFETIME;
@@ -2688,7 +2671,6 @@
range.max_retry = 65535; /* ??? */
range.min_r_time = 0;
range.max_r_time = 65535 * 1000; /* ??? */
-#endif /* WIRELESS_EXT > 10 */
if (copy_to_user(rrq->pointer, &range, sizeof(range)))
return -EFAULT;
@@ -3354,7 +3336,6 @@
return err;
}
-#if WIRELESS_EXT > 10
static int orinoco_ioctl_getretry(struct net_device *dev, struct iw_param *rrq)
{
struct orinoco_private *priv = netdev_priv(dev);
@@ -3406,7 +3387,6 @@
return err;
}
-#endif /* WIRELESS_EXT > 10 */
static int orinoco_ioctl_setibssport(struct net_device *dev, struct iwreq *wrq)
{
@@ -3790,7 +3770,6 @@
wrq->u.txpower.flags = IW_TXPOW_DBM;
break;
-#if WIRELESS_EXT > 10
case SIOCSIWRETRY:
err = -EOPNOTSUPP;
break;
@@ -3798,7 +3777,6 @@
case SIOCGIWRETRY:
err = orinoco_ioctl_getretry(dev, &wrq->u.retry);
break;
-#endif /* WIRELESS_EXT > 10 */
case SIOCSIWSPY:
err = orinoco_ioctl_setspy(dev, &wrq->u.data);
Index: working-2.6/drivers/net/wireless/orinoco.h
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco.h
+++ working-2.6/drivers/net/wireless/orinoco.h
@@ -14,32 +14,9 @@
#include <linux/version.h>
#include "hermes.h"
-/* Workqueue / task queue backwards compatibility stuff */
-
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,5,41)
-#include <linux/workqueue.h>
-#else
-#include <linux/tqueue.h>
-#define work_struct tq_struct
-#define INIT_WORK INIT_TQUEUE
-#define schedule_work schedule_task
-#endif
-
-/* Interrupt handler backwards compatibility stuff */
-#ifndef IRQ_NONE
-
-#define IRQ_NONE
-#define IRQ_HANDLED
-typedef void irqreturn_t;
-
-#endif
-
/* To enable debug messages */
//#define ORINOCO_DEBUG 3
-#if (! defined (WIRELESS_EXT)) || (WIRELESS_EXT < 10)
-#error "orinoco driver requires Wireless extensions v10 or later."
-#endif /* (! defined (WIRELESS_EXT)) || (WIRELESS_EXT < 10) */
#define WIRELESS_SPY // enable iwspy support
#define ORINOCO_MAX_KEY_SIZE 14
Index: working-2.6/drivers/net/wireless/hermes.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/hermes.c
+++ working-2.6/drivers/net/wireless/hermes.c
@@ -54,9 +54,7 @@
MODULE_DESCRIPTION("Low-level driver helper for Lucent Hermes chipset and Prism II HFA384x wireless MAC controller");
MODULE_AUTHOR("David Gibson <hermes@gibson.dropbear.id.au>");
-#ifdef MODULE_LICENSE
MODULE_LICENSE("Dual MPL/GPL");
-#endif
/* These are maximum timeouts. Most often, card wil react much faster */
#define CMD_BUSY_TIMEOUT (100) /* In iterations of ~1us */
Index: working-2.6/drivers/net/wireless/orinoco_tmd.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco_tmd.c
+++ working-2.6/drivers/net/wireless/orinoco_tmd.c
@@ -207,9 +207,7 @@
static char version[] __initdata = "orinoco_tmd.c 0.01 (Joerg Dorchain <joerg@dorchain.net>)";
MODULE_AUTHOR("Joerg Dorchain <joerg@dorchain.net>");
MODULE_DESCRIPTION("Driver for wireless LAN cards using the TMD7160 PCI bridge");
-#ifdef MODULE_LICENSE
MODULE_LICENSE("Dual MPL/GPL");
-#endif
static int __init orinoco_tmd_init(void)
{
Index: working-2.6/drivers/net/wireless/orinoco_cs.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco_cs.c
+++ working-2.6/drivers/net/wireless/orinoco_cs.c
@@ -47,9 +47,7 @@
MODULE_AUTHOR("David Gibson <hermes@gibson.dropbear.id.au>");
MODULE_DESCRIPTION("Driver for PCMCIA Lucent Orinoco, Prism II based and similar wireless cards");
-#ifdef MODULE_LICENSE
MODULE_LICENSE("Dual MPL/GPL");
-#endif
/* Module parameters */
@@ -144,15 +142,6 @@
/* PCMCIA stuff */
/********************************************************************/
-/* In 2.5 (as of 2.5.69 at least) there is a cs_error exported which
- * does this, but it's not in 2.4 so we do our own for now. */
-static void
-orinoco_cs_error(client_handle_t handle, int func, int ret)
-{
- error_info_t err = { func, ret };
- pcmcia_report_error(handle, &err);
-}
-
/*
* This creates an "instance" of the driver, allocating local data
* structures for one device. The device is registered with Card
@@ -216,7 +205,7 @@
ret = pcmcia_register_client(&link->handle, &client_reg);
if (ret != CS_SUCCESS) {
- orinoco_cs_error(link->handle, RegisterClient, ret);
+ cs_error(link->handle, RegisterClient, ret);
orinoco_cs_detach(link);
return NULL;
}
@@ -495,7 +484,7 @@
return;
cs_failed:
- orinoco_cs_error(link->handle, last_fn, last_ret);
+ cs_error(link->handle, last_fn, last_ret);
failed:
orinoco_cs_release(link);
Index: working-2.6/drivers/net/wireless/orinoco_plx.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco_plx.c
+++ working-2.6/drivers/net/wireless/orinoco_plx.c
@@ -329,9 +329,7 @@
static char version[] __initdata = "orinoco_plx.c 0.13e (Daniel Barlow <dan@telent.net>, David Gibson <hermes@gibson.dropbear.id.au>)";
MODULE_AUTHOR("Daniel Barlow <dan@telent.net>");
MODULE_DESCRIPTION("Driver for wireless LAN cards using the PLX9052 PCI bridge");
-#ifdef MODULE_LICENSE
MODULE_LICENSE("Dual MPL/GPL");
-#endif
static int __init orinoco_plx_init(void)
{
--
David Gibson | For every complex problem there is a
david AT gibson.dropbear.id.au | solution which is simple, neat and
| wrong.
http://www.ozlabs.org/people/dgibson
^ permalink raw reply [flat|nested] 31+ messages in thread
* [2/15] orinoco merge preliminaries - rearrange code
2004-07-28 6:53 ` [1/15] orinoco merge preliminaries - squash backwards compatibility David Gibson
@ 2004-07-28 6:53 ` David Gibson
2004-07-28 6:54 ` [3/15] orinoco merge preliminaries - use netdev_priv() David Gibson
0 siblings, 1 reply; 31+ messages in thread
From: David Gibson @ 2004-07-28 6:53 UTC (permalink / raw)
To: Jeff Garzik, Francois Romieu, Linux kernel mailing list, jt,
Dan Williams, Pavel Roskin, Orinoco Development List
Rearrange functions in the orinoco driver in a more logical order.
This patch is large and looks complicated, but in fact only moves code
around (within or between files) without changing it. The only
exceptions are some extra comments describing the file's layout, and
updated prototypes for the new function order.
This makes the order of functions match the 0.15rc1 version, so later
patches have a fighting chance of being meaningful.
Signed-off-by: David Gibson <hermes@gibson.dropbear.id.au>
Index: working-2.6/drivers/net/wireless/orinoco.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco.c 2004-07-28 14:56:32.924732992 +1000
+++ working-2.6/drivers/net/wireless/orinoco.c 2004-07-28 14:57:00.030612272 +1000
@@ -496,6 +496,10 @@
HERMES_MAX_MULTICAST : 0)*/
#define MAX_MULTICAST(priv) (HERMES_MAX_MULTICAST)
+#define ORINOCO_INTEN ( HERMES_EV_RX | HERMES_EV_ALLOC | HERMES_EV_TX | \
+ HERMES_EV_TXEXC | HERMES_EV_WTERR | HERMES_EV_INFO | \
+ HERMES_EV_INFDROP )
+
/********************************************************************/
/* Data tables */
/********************************************************************/
@@ -548,133 +552,55 @@
#define ENCAPS_OVERHEAD (sizeof(encaps_hdr) + 2)
+struct hermes_rx_descriptor {
+ u16 status;
+ u32 time;
+ u8 silence;
+ u8 signal;
+ u8 rate;
+ u8 rxflow;
+ u32 reserved;
+} __attribute__ ((packed));
+
/********************************************************************/
/* Function prototypes */
/********************************************************************/
-static void orinoco_stat_gather(struct net_device *dev,
- struct sk_buff *skb,
- struct hermes_rx_descriptor *desc);
-
-static struct net_device_stats *orinoco_get_stats(struct net_device *dev);
-static struct iw_statistics *orinoco_get_wireless_stats(struct net_device *dev);
-
-/* Hardware control routines */
-
+static int orinoco_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
static int __orinoco_program_rids(struct net_device *dev);
-
-static int __orinoco_hw_set_bitrate(struct orinoco_private *priv);
-static int __orinoco_hw_setup_wep(struct orinoco_private *priv);
-static int orinoco_hw_get_bssid(struct orinoco_private *priv, char buf[ETH_ALEN]);
-static int orinoco_hw_get_essid(struct orinoco_private *priv, int *active,
- char buf[IW_ESSID_MAX_SIZE+1]);
-static long orinoco_hw_get_freq(struct orinoco_private *priv);
-static int orinoco_hw_get_bitratelist(struct orinoco_private *priv, int *numrates,
- s32 *rates, int max);
static void __orinoco_set_multicast_list(struct net_device *dev);
-
-/* Interrupt handling routines */
-static void __orinoco_ev_tick(struct net_device *dev, hermes_t *hw);
-static void __orinoco_ev_wterr(struct net_device *dev, hermes_t *hw);
-static void __orinoco_ev_infdrop(struct net_device *dev, hermes_t *hw);
-static void __orinoco_ev_info(struct net_device *dev, hermes_t *hw);
-static void __orinoco_ev_rx(struct net_device *dev, hermes_t *hw);
-static void __orinoco_ev_txexc(struct net_device *dev, hermes_t *hw);
-static void __orinoco_ev_tx(struct net_device *dev, hermes_t *hw);
-static void __orinoco_ev_alloc(struct net_device *dev, hermes_t *hw);
-
-/* ioctl() routines */
static int orinoco_debug_dump_recs(struct net_device *dev);
/********************************************************************/
-/* Function prototypes */
+/* Internal helper functions */
/********************************************************************/
-int __orinoco_up(struct net_device *dev)
-{
- struct orinoco_private *priv = netdev_priv(dev);
- struct hermes *hw = &priv->hw;
- int err;
-
- err = __orinoco_program_rids(dev);
- if (err) {
- printk(KERN_ERR "%s: Error %d configuring card\n",
- dev->name, err);
- return err;
- }
-
- /* Fire things up again */
- hermes_set_irqmask(hw, ORINOCO_INTEN);
- err = hermes_enable_port(hw, 0);
- if (err) {
- printk(KERN_ERR "%s: Error %d enabling MAC port\n",
- dev->name, err);
- return err;
- }
-
- netif_start_queue(dev);
-
- return 0;
-}
-
-int __orinoco_down(struct net_device *dev)
+static inline void
+set_port_type(struct orinoco_private *priv)
{
- struct orinoco_private *priv = netdev_priv(dev);
- struct hermes *hw = &priv->hw;
- int err;
-
- netif_stop_queue(dev);
-
- if (! priv->hw_unavailable) {
- if (! priv->broken_disableport) {
- err = hermes_disable_port(hw, 0);
- if (err) {
- /* Some firmwares (e.g. Intersil 1.3.x) seem
- * to have problems disabling the port, oh
- * well, too bad. */
- printk(KERN_WARNING "%s: Error %d disabling MAC port\n",
- dev->name, err);
- priv->broken_disableport = 1;
- }
+ switch (priv->iw_mode) {
+ case IW_MODE_INFRA:
+ priv->port_type = 1;
+ priv->createibss = 0;
+ break;
+ case IW_MODE_ADHOC:
+ if (priv->prefer_port3) {
+ priv->port_type = 3;
+ priv->createibss = 0;
+ } else {
+ priv->port_type = priv->ibss_port;
+ priv->createibss = 1;
}
- hermes_set_irqmask(hw, 0);
- hermes_write_regn(hw, EVACK, 0xffff);
+ break;
+ default:
+ printk(KERN_ERR "%s: Invalid priv->iw_mode in set_port_type()\n",
+ priv->ndev->name);
}
-
- /* firmware will have to reassociate */
- priv->last_linkstatus = 0xffff;
- priv->connected = 0;
-
- return 0;
}
-int orinoco_reinit_firmware(struct net_device *dev)
-{
- struct orinoco_private *priv = netdev_priv(dev);
- struct hermes *hw = &priv->hw;
- int err;
-
- err = hermes_init(hw);
- if (err)
- return err;
-
- err = hermes_allocate(hw, priv->nicbuf_size, &priv->txfid);
- if (err == -EIO) {
- /* Try workaround for old Symbol firmware bug */
- printk(KERN_WARNING "%s: firmware ALLOC bug detected "
- "(old Symbol firmware?). Trying to work around... ",
- dev->name);
-
- priv->nicbuf_size = TX_NICBUF_SIZE_BUG;
- err = hermes_allocate(hw, priv->nicbuf_size, &priv->txfid);
- if (err)
- printk("failed!\n");
- else
- printk("ok.\n");
- }
-
- return err;
-}
+/********************************************************************/
+/* Device methods */
+/********************************************************************/
static int orinoco_open(struct net_device *dev)
{
@@ -715,337 +641,323 @@
return err;
}
-static int __orinoco_program_rids(struct net_device *dev)
+struct net_device_stats *
+orinoco_get_stats(struct net_device *dev)
+{
+ struct orinoco_private *priv = netdev_priv(dev);
+
+ return &priv->stats;
+}
+
+struct iw_statistics *
+orinoco_get_wireless_stats(struct net_device *dev)
{
struct orinoco_private *priv = netdev_priv(dev);
hermes_t *hw = &priv->hw;
- int err;
- struct hermes_idstring idbuf;
+ struct iw_statistics *wstats = &priv->wstats;
+ int err = 0;
+ unsigned long flags;
- /* Set the MAC address */
- err = hermes_write_ltv(hw, USER_BAP, HERMES_RID_CNFOWNMACADDR,
- HERMES_BYTES_TO_RECLEN(ETH_ALEN), dev->dev_addr);
- if (err) {
- printk(KERN_ERR "%s: Error %d setting MAC address\n", dev->name, err);
- return err;
+ if (! netif_device_present(dev)) {
+ printk(KERN_WARNING "%s: get_wireless_stats() called while device not present\n",
+ dev->name);
+ return NULL; /* FIXME: Can we do better than this? */
}
- /* Set up the link mode */
- err = hermes_write_wordrec(hw, USER_BAP, HERMES_RID_CNFPORTTYPE, priv->port_type);
- if (err) {
- printk(KERN_ERR "%s: Error %d setting port type\n", dev->name, err);
- return err;
- }
- /* Set the channel/frequency */
- if (priv->channel == 0) {
- printk(KERN_DEBUG "%s: Channel is 0 in __orinoco_program_rids()\n", dev->name);
- if (priv->createibss)
- priv->channel = 10;
- }
- err = hermes_write_wordrec(hw, USER_BAP, HERMES_RID_CNFOWNCHANNEL, priv->channel);
- if (err) {
- printk(KERN_ERR "%s: Error %d setting channel\n", dev->name, err);
- return err;
- }
+ err = orinoco_lock(priv, &flags);
+ if (err)
+ return NULL; /* FIXME: Erg, we've been signalled, how
+ * do we propagate this back up? */
- if (priv->has_ibss) {
- err = hermes_write_wordrec(hw, USER_BAP, HERMES_RID_CNFCREATEIBSS,
- priv->createibss);
- if (err) {
- printk(KERN_ERR "%s: Error %d setting CREATEIBSS\n", dev->name, err);
- return err;
+ if (priv->iw_mode == IW_MODE_ADHOC) {
+ memset(&wstats->qual, 0, sizeof(wstats->qual));
+ /* If a spy address is defined, we report stats of the
+ * first spy address - Jean II */
+ if (SPY_NUMBER(priv)) {
+ wstats->qual.qual = priv->spy_stat[0].qual;
+ wstats->qual.level = priv->spy_stat[0].level;
+ wstats->qual.noise = priv->spy_stat[0].noise;
+ wstats->qual.updated = priv->spy_stat[0].updated;
}
+ } else {
+ struct {
+ u16 qual, signal, noise;
+ } __attribute__ ((packed)) cq;
- if ((strlen(priv->desired_essid) == 0) && (priv->createibss)
- && (!priv->has_ibss_any)) {
- printk(KERN_WARNING "%s: This firmware requires an \
-ESSID in IBSS-Ad-Hoc mode.\n", dev->name);
- /* With wvlan_cs, in this case, we would crash.
- * hopefully, this driver will behave better...
- * Jean II */
- }
+ err = HERMES_READ_RECORD(hw, USER_BAP,
+ HERMES_RID_COMMSQUALITY, &cq);
+
+ wstats->qual.qual = (int)le16_to_cpu(cq.qual);
+ wstats->qual.level = (int)le16_to_cpu(cq.signal) - 0x95;
+ wstats->qual.noise = (int)le16_to_cpu(cq.noise) - 0x95;
+ wstats->qual.updated = 7;
}
- /* Set the desired ESSID */
- idbuf.len = cpu_to_le16(strlen(priv->desired_essid));
- memcpy(&idbuf.val, priv->desired_essid, sizeof(idbuf.val));
- /* WinXP wants partner to configure OWNSSID even in IBSS mode. (jimc) */
- err = hermes_write_ltv(hw, USER_BAP, HERMES_RID_CNFOWNSSID,
- HERMES_BYTES_TO_RECLEN(strlen(priv->desired_essid)+2),
- &idbuf);
- if (err) {
- printk(KERN_ERR "%s: Error %d setting OWNSSID\n", dev->name, err);
- return err;
- }
- err = hermes_write_ltv(hw, USER_BAP, HERMES_RID_CNFDESIREDSSID,
- HERMES_BYTES_TO_RECLEN(strlen(priv->desired_essid)+2),
- &idbuf);
- if (err) {
- printk(KERN_ERR "%s: Error %d setting DESIREDSSID\n", dev->name, err);
- return err;
- }
+ /* We can't really wait for the tallies inquiry command to
+ * complete, so we just use the previous results and trigger
+ * a new tallies inquiry command for next time - Jean II */
+ /* FIXME: We're in user context (I think?), so we should just
+ wait for the tallies to come through */
+ err = hermes_inquire(hw, HERMES_INQ_TALLIES);
+
+ orinoco_unlock(priv, &flags);
- /* Set the station name */
- idbuf.len = cpu_to_le16(strlen(priv->nick));
- memcpy(&idbuf.val, priv->nick, sizeof(idbuf.val));
- err = hermes_write_ltv(hw, USER_BAP, HERMES_RID_CNFOWNNAME,
- HERMES_BYTES_TO_RECLEN(strlen(priv->nick)+2),
- &idbuf);
- if (err) {
- printk(KERN_ERR "%s: Error %d setting nickname\n", dev->name, err);
- return err;
- }
+ if (err)
+ return NULL;
+
+ return wstats;
+}
- /* Set AP density */
- if (priv->has_sensitivity) {
- err = hermes_write_wordrec(hw, USER_BAP, HERMES_RID_CNFSYSTEMSCALE,
- priv->ap_density);
- if (err) {
- printk(KERN_WARNING "%s: Error %d setting SYSTEMSCALE. "
- "Disabling sensitivity control\n", dev->name, err);
+static void
+orinoco_set_multicast_list(struct net_device *dev)
+{
+ struct orinoco_private *priv = netdev_priv(dev);
+ unsigned long flags;
- priv->has_sensitivity = 0;
- }
+ if (orinoco_lock(priv, &flags) != 0) {
+ printk(KERN_DEBUG "%s: orinoco_set_multicast_list() "
+ "called when hw_unavailable\n", dev->name);
+ return;
}
- /* Set RTS threshold */
- err = hermes_write_wordrec(hw, USER_BAP, HERMES_RID_CNFRTSTHRESHOLD, priv->rts_thresh);
- if (err) {
- printk(KERN_ERR "%s: Error %d setting RTS threshold\n", dev->name, err);
- return err;
- }
-
- /* Set fragmentation threshold or MWO robustness */
- if (priv->has_mwo)
- err = hermes_write_wordrec(hw, USER_BAP,
- HERMES_RID_CNFMWOROBUST_AGERE,
- priv->mwo_robust);
- else
- err = hermes_write_wordrec(hw, USER_BAP,
- HERMES_RID_CNFFRAGMENTATIONTHRESHOLD,
- priv->frag_thresh);
- if (err) {
- printk(KERN_ERR "%s: Error %d setting framentation\n", dev->name, err);
- return err;
- }
-
- /* Set bitrate */
- err = __orinoco_hw_set_bitrate(priv);
- if (err) {
- printk(KERN_ERR "%s: Error %d setting bitrate\n", dev->name, err);
- return err;
- }
-
- /* Set power management */
- if (priv->has_pm) {
- err = hermes_write_wordrec(hw, USER_BAP, HERMES_RID_CNFPMENABLED,
- priv->pm_on);
- if (err) {
- printk(KERN_ERR "%s: Error %d setting up PM\n",
- dev->name, err);
- return err;
- }
+ __orinoco_set_multicast_list(dev);
+ orinoco_unlock(priv, &flags);
+}
- err = hermes_write_wordrec(hw, USER_BAP,
- HERMES_RID_CNFMULTICASTRECEIVE,
- priv->pm_mcast);
- if (err) {
- printk(KERN_ERR "%s: Error %d setting up PM\n",
- dev->name, err);
- return err;
- }
- err = hermes_write_wordrec(hw, USER_BAP,
- HERMES_RID_CNFMAXSLEEPDURATION,
- priv->pm_period);
- if (err) {
- printk(KERN_ERR "%s: Error %d setting up PM\n",
- dev->name, err);
- return err;
- }
- err = hermes_write_wordrec(hw, USER_BAP,
- HERMES_RID_CNFPMHOLDOVERDURATION,
- priv->pm_timeout);
- if (err) {
- printk(KERN_ERR "%s: Error %d setting up PM\n",
- dev->name, err);
- return err;
- }
- }
+static int
+orinoco_change_mtu(struct net_device *dev, int new_mtu)
+{
+ struct orinoco_private *priv = netdev_priv(dev);
- /* Set preamble - only for Symbol so far... */
- if (priv->has_preamble) {
- err = hermes_write_wordrec(hw, USER_BAP,
- HERMES_RID_CNFPREAMBLE_SYMBOL,
- priv->preamble);
- if (err) {
- printk(KERN_ERR "%s: Error %d setting preamble\n",
- dev->name, err);
- return err;
- }
- }
+ if ( (new_mtu < ORINOCO_MIN_MTU) || (new_mtu > ORINOCO_MAX_MTU) )
+ return -EINVAL;
- /* Set up encryption */
- if (priv->has_wep) {
- err = __orinoco_hw_setup_wep(priv);
- if (err) {
- printk(KERN_ERR "%s: Error %d activating WEP\n",
- dev->name, err);
- return err;
- }
- }
+ if ( (new_mtu + ENCAPS_OVERHEAD + IEEE802_11_HLEN) >
+ (priv->nicbuf_size - ETH_HLEN) )
+ return -EINVAL;
- /* Set promiscuity / multicast*/
- priv->promiscuous = 0;
- priv->mc_count = 0;
- __orinoco_set_multicast_list(dev); /* FIXME: what about the xmit_lock */
+ dev->mtu = new_mtu;
return 0;
}
-/* xyzzy */
-static int orinoco_reconfigure(struct net_device *dev)
+/********************************************************************/
+/* Tx path */
+/********************************************************************/
+
+static int
+orinoco_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct orinoco_private *priv = netdev_priv(dev);
- struct hermes *hw = &priv->hw;
- unsigned long flags;
+ struct net_device_stats *stats = &priv->stats;
+ hermes_t *hw = &priv->hw;
int err = 0;
+ u16 txfid = priv->txfid;
+ char *p;
+ struct ethhdr *eh;
+ int len, data_len, data_off;
+ struct hermes_tx_descriptor desc;
+ unsigned long flags;
- if (priv->broken_disableport) {
- schedule_work(&priv->reset_work);
+ TRACE_ENTER(dev->name);
+
+ if (! netif_running(dev)) {
+ printk(KERN_ERR "%s: Tx on stopped device!\n",
+ dev->name);
+ TRACE_EXIT(dev->name);
+ return 1;
+ }
+
+ if (netif_queue_stopped(dev)) {
+ printk(KERN_DEBUG "%s: Tx while transmitter busy!\n",
+ dev->name);
+ TRACE_EXIT(dev->name);
+ return 1;
+ }
+
+ if (orinoco_lock(priv, &flags) != 0) {
+ printk(KERN_ERR "%s: orinoco_xmit() called while hw_unavailable\n",
+ dev->name);
+ TRACE_EXIT(dev->name);
+/* BUG(); */
+ return 1;
+ }
+
+ if (! priv->connected) {
+ /* Oops, the firmware hasn't established a connection,
+ silently drop the packet (this seems to be the
+ safest approach). */
+ stats->tx_errors++;
+ orinoco_unlock(priv, &flags);
+ dev_kfree_skb(skb);
+ TRACE_EXIT(dev->name);
return 0;
}
- err = orinoco_lock(priv, &flags);
- if (err)
- return err;
+ /* Length of the packet body */
+ /* FIXME: what if the skb is smaller than this? */
+ len = max_t(int,skb->len - ETH_HLEN, ETH_ZLEN - ETH_HLEN);
-
- err = hermes_disable_port(hw, 0);
+ eh = (struct ethhdr *)skb->data;
+
+ memset(&desc, 0, sizeof(desc));
+ desc.tx_control = cpu_to_le16(HERMES_TXCTRL_TX_OK | HERMES_TXCTRL_TX_EX);
+ err = hermes_bap_pwrite(hw, USER_BAP, &desc, sizeof(desc), txfid, 0);
if (err) {
- printk(KERN_WARNING "%s: Unable to disable port while reconfiguring card\n",
- dev->name);
- priv->broken_disableport = 1;
- goto out;
+ printk(KERN_ERR "%s: Error %d writing Tx descriptor to BAP\n",
+ dev->name, err);
+ stats->tx_errors++;
+ goto fail;
}
- err = __orinoco_program_rids(dev);
- if (err) {
- printk(KERN_WARNING "%s: Unable to reconfigure card\n",
- dev->name);
- goto out;
+ /* Clear the 802.11 header and data length fields - some
+ * firmwares (e.g. Lucent/Agere 8.xx) appear to get confused
+ * if this isn't done. */
+ hermes_clear_words(hw, HERMES_DATA0,
+ HERMES_802_3_OFFSET - HERMES_802_11_OFFSET);
+
+ /* Encapsulate Ethernet-II frames */
+ if (ntohs(eh->h_proto) > 1500) { /* Ethernet-II frame */
+ struct header_struct hdr;
+ data_len = len;
+ data_off = HERMES_802_3_OFFSET + sizeof(hdr);
+ p = skb->data + ETH_HLEN;
+
+ /* 802.3 header */
+ memcpy(hdr.dest, eh->h_dest, ETH_ALEN);
+ memcpy(hdr.src, eh->h_source, ETH_ALEN);
+ hdr.len = htons(data_len + ENCAPS_OVERHEAD);
+
+ /* 802.2 header */
+ memcpy(&hdr.dsap, &encaps_hdr, sizeof(encaps_hdr));
+
+ hdr.ethertype = eh->h_proto;
+ err = hermes_bap_pwrite(hw, USER_BAP, &hdr, sizeof(hdr),
+ txfid, HERMES_802_3_OFFSET);
+ if (err) {
+ printk(KERN_ERR "%s: Error %d writing packet header to BAP\n",
+ dev->name, err);
+ stats->tx_errors++;
+ goto fail;
+ }
+ } else { /* IEEE 802.3 frame */
+ data_len = len + ETH_HLEN;
+ data_off = HERMES_802_3_OFFSET;
+ p = skb->data;
}
- err = hermes_enable_port(hw, 0);
+ /* Round up for odd length packets */
+ err = hermes_bap_pwrite(hw, USER_BAP, p, RUP_EVEN(data_len), txfid, data_off);
if (err) {
- printk(KERN_WARNING "%s: Unable to enable port while reconfiguring card\n",
- dev->name);
- goto out;
+ printk(KERN_ERR "%s: Error %d writing packet to BAP\n",
+ dev->name, err);
+ stats->tx_errors++;
+ goto fail;
}
- out:
+ /* Finally, we actually initiate the send */
+ netif_stop_queue(dev);
+
+ err = hermes_docmd_wait(hw, HERMES_CMD_TX | HERMES_CMD_RECL, txfid, NULL);
if (err) {
- printk(KERN_WARNING "%s: Resetting instead...\n", dev->name);
- schedule_work(&priv->reset_work);
- err = 0;
+ netif_start_queue(dev);
+ printk(KERN_ERR "%s: Error %d transmitting packet\n", dev->name, err);
+ stats->tx_errors++;
+ goto fail;
}
+ dev->trans_start = jiffies;
+ stats->tx_bytes += data_off + data_len;
+
orinoco_unlock(priv, &flags);
- return err;
+ dev_kfree_skb(skb);
+
+ TRACE_EXIT(dev->name);
+
+ return 0;
+ fail:
+ TRACE_EXIT(dev->name);
+
+ orinoco_unlock(priv, &flags);
+ return err;
}
-/* This must be called from user context, without locks held - use
- * schedule_work() */
-static void orinoco_reset(struct net_device *dev)
+static void __orinoco_ev_alloc(struct net_device *dev, hermes_t *hw)
{
struct orinoco_private *priv = netdev_priv(dev);
- struct hermes *hw = &priv->hw;
- int err;
- unsigned long flags;
- err = orinoco_lock(priv, &flags);
- if (err)
- /* When the hardware becomes available again, whatever
- * detects that is responsible for re-initializing
- * it. So no need for anything further*/
- return;
+ u16 fid = hermes_read_regn(hw, ALLOCFID);
- netif_stop_queue(dev);
+ if (fid != priv->txfid) {
+ if (fid != DUMMY_FID)
+ printk(KERN_WARNING "%s: Allocate event on unexpected fid (%04X)\n",
+ dev->name, fid);
+ return;
+ } else {
+ netif_wake_queue(dev);
+ }
- /* Shut off interrupts. Depending on what state the hardware
- * is in, this might not work, but we'll try anyway */
- hermes_set_irqmask(hw, 0);
- hermes_write_regn(hw, EVACK, 0xffff);
+ hermes_write_regn(hw, ALLOCFID, DUMMY_FID);
+}
- priv->hw_unavailable++;
- priv->last_linkstatus = 0xffff; /* firmware will have to reassociate */
- priv->connected = 0;
+static void __orinoco_ev_tx(struct net_device *dev, hermes_t *hw)
+{
+ struct orinoco_private *priv = netdev_priv(dev);
+ struct net_device_stats *stats = &priv->stats;
- orinoco_unlock(priv, &flags);
+ stats->tx_packets++;
- if (priv->hard_reset)
- err = (*priv->hard_reset)(priv);
- if (err) {
- printk(KERN_ERR "%s: orinoco_reset: Error %d performing hard reset\n",
- dev->name, err);
- /* FIXME: shutdown of some sort */
- return;
- }
+ hermes_write_regn(hw, TXCOMPLFID, DUMMY_FID);
+}
- err = orinoco_reinit_firmware(dev);
+static void __orinoco_ev_txexc(struct net_device *dev, hermes_t *hw)
+{
+ struct orinoco_private *priv = netdev_priv(dev);
+ struct net_device_stats *stats = &priv->stats;
+ u16 fid = hermes_read_regn(hw, TXCOMPLFID);
+ struct hermes_tx_descriptor desc;
+ int err = 0;
+
+ if (fid == DUMMY_FID)
+ return; /* Nothing's really happened */
+
+ err = hermes_bap_pread(hw, IRQ_BAP, &desc, sizeof(desc), fid, 0);
if (err) {
- printk(KERN_ERR "%s: orinoco_reset: Error %d re-initializing firmware\n",
- dev->name, err);
- return;
+ printk(KERN_WARNING "%s: Unable to read descriptor on Tx error "
+ "(FID=%04X error %d)\n",
+ dev->name, fid, err);
+ } else {
+ DEBUG(1, "%s: Tx error, status %d\n",
+ dev->name, le16_to_cpu(desc.status));
}
+
+ stats->tx_errors++;
- spin_lock_irq(&priv->lock); /* This has to be called from user context */
+ hermes_write_regn(hw, TXCOMPLFID, DUMMY_FID);
+}
- priv->hw_unavailable--;
+static void
+orinoco_tx_timeout(struct net_device *dev)
+{
+ struct orinoco_private *priv = netdev_priv(dev);
+ struct net_device_stats *stats = &priv->stats;
+ struct hermes *hw = &priv->hw;
- /* priv->open or priv->hw_unavailable might have changed while
- * we dropped the lock */
- if (priv->open && (! priv->hw_unavailable)) {
- err = __orinoco_up(dev);
- if (err) {
- printk(KERN_ERR "%s: orinoco_reset: Error %d reenabling card\n",
- dev->name, err);
- } else
- dev->trans_start = jiffies;
- }
+ printk(KERN_WARNING "%s: Tx timeout! "
+ "ALLOCFID=%04x, TXCOMPLFID=%04x, EVSTAT=%04x\n",
+ dev->name, hermes_read_regn(hw, ALLOCFID),
+ hermes_read_regn(hw, TXCOMPLFID), hermes_read_regn(hw, EVSTAT));
- spin_unlock_irq(&priv->lock);
+ stats->tx_errors++;
- return;
+ schedule_work(&priv->reset_work);
}
/********************************************************************/
-/* Internal helper functions */
+/* Rx path (data frames) */
/********************************************************************/
-static inline void
-set_port_type(struct orinoco_private *priv)
-{
- switch (priv->iw_mode) {
- case IW_MODE_INFRA:
- priv->port_type = 1;
- priv->createibss = 0;
- break;
- case IW_MODE_ADHOC:
- if (priv->prefer_port3) {
- priv->port_type = 3;
- priv->createibss = 0;
- } else {
- priv->port_type = priv->ibss_port;
- priv->createibss = 1;
- }
- break;
- default:
- printk(KERN_ERR "%s: Invalid priv->iw_mode in set_port_type()\n",
- priv->ndev->name);
- }
-}
-
/* Does the frame have a SNAP header indicating it should be
* de-encapsulated to Ethernet-II? */
static inline int
@@ -1060,804 +972,1033 @@
&& ( (hdr->oui[2] == 0x00) || (hdr->oui[2] == 0xf8) );
}
-static void
-orinoco_set_multicast_list(struct net_device *dev)
+static inline void orinoco_spy_gather(struct net_device *dev, u_char *mac,
+ int level, int noise)
{
struct orinoco_private *priv = netdev_priv(dev);
- unsigned long flags;
-
- if (orinoco_lock(priv, &flags) != 0) {
- printk(KERN_DEBUG "%s: orinoco_set_multicast_list() "
- "called when hw_unavailable\n", dev->name);
- return;
- }
+ int i;
- __orinoco_set_multicast_list(dev);
- orinoco_unlock(priv, &flags);
+ /* Gather wireless spy statistics: for each packet, compare the
+ * source address with out list, and if match, get the stats... */
+ for (i = 0; i < priv->spy_number; i++)
+ if (!memcmp(mac, priv->spy_address[i], ETH_ALEN)) {
+ priv->spy_stat[i].level = level - 0x95;
+ priv->spy_stat[i].noise = noise - 0x95;
+ priv->spy_stat[i].qual = (level > noise) ? (level - noise) : 0;
+ priv->spy_stat[i].updated = 7;
+ }
}
-/********************************************************************/
-/* Hardware control functions */
-/********************************************************************/
+void
+orinoco_stat_gather(struct net_device *dev,
+ struct sk_buff *skb,
+ struct hermes_rx_descriptor *desc)
+{
+ struct orinoco_private *priv = netdev_priv(dev);
+ /* Using spy support with lots of Rx packets, like in an
+ * infrastructure (AP), will really slow down everything, because
+ * the MAC address must be compared to each entry of the spy list.
+ * If the user really asks for it (set some address in the
+ * spy list), we do it, but he will pay the price.
+ * Note that to get here, you need both WIRELESS_SPY
+ * compiled in AND some addresses in the list !!!
+ */
+ /* Note : gcc will optimise the whole section away if
+ * WIRELESS_SPY is not defined... - Jean II */
+ if (SPY_NUMBER(priv)) {
+ orinoco_spy_gather(dev, skb->mac.raw + ETH_ALEN,
+ desc->signal, desc->silence);
+ }
+}
-static int __orinoco_hw_set_bitrate(struct orinoco_private *priv)
+static void __orinoco_ev_rx(struct net_device *dev, hermes_t *hw)
{
- hermes_t *hw = &priv->hw;
- int err = 0;
+ struct orinoco_private *priv = netdev_priv(dev);
+ struct net_device_stats *stats = &priv->stats;
+ struct iw_statistics *wstats = &priv->wstats;
+ struct sk_buff *skb = NULL;
+ u16 rxfid, status;
+ int length, data_len, data_off;
+ char *p;
+ struct hermes_rx_descriptor desc;
+ struct header_struct hdr;
+ struct ethhdr *eh;
+ int err;
- if (priv->bitratemode >= BITRATE_TABLE_SIZE) {
- printk(KERN_ERR "%s: BUG: Invalid bitrate mode %d\n",
- priv->ndev->name, priv->bitratemode);
- return -EINVAL;
+ rxfid = hermes_read_regn(hw, RXFID);
+
+ err = hermes_bap_pread(hw, IRQ_BAP, &desc, sizeof(desc),
+ rxfid, 0);
+ if (err) {
+ printk(KERN_ERR "%s: error %d reading Rx descriptor. "
+ "Frame dropped.\n", dev->name, err);
+ stats->rx_errors++;
+ goto drop;
}
- switch (priv->firmware_type) {
- case FIRMWARE_TYPE_AGERE:
- err = hermes_write_wordrec(hw, USER_BAP,
- HERMES_RID_CNFTXRATECONTROL,
- bitrate_table[priv->bitratemode].agere_txratectrl);
- break;
- case FIRMWARE_TYPE_INTERSIL:
- case FIRMWARE_TYPE_SYMBOL:
- err = hermes_write_wordrec(hw, USER_BAP,
- HERMES_RID_CNFTXRATECONTROL,
- bitrate_table[priv->bitratemode].intersil_txratectrl);
- break;
- default:
- BUG();
+ status = le16_to_cpu(desc.status);
+
+ if (status & HERMES_RXSTAT_ERR) {
+ if (status & HERMES_RXSTAT_UNDECRYPTABLE) {
+ wstats->discard.code++;
+ DEBUG(1, "%s: Undecryptable frame on Rx. Frame dropped.\n",
+ dev->name);
+ } else {
+ stats->rx_crc_errors++;
+ DEBUG(1, "%s: Bad CRC on Rx. Frame dropped.\n", dev->name);
+ }
+ stats->rx_errors++;
+ goto drop;
}
- return err;
-}
+ /* For now we ignore the 802.11 header completely, assuming
+ that the card's firmware has handled anything vital */
+ err = hermes_bap_pread(hw, IRQ_BAP, &hdr, sizeof(hdr),
+ rxfid, HERMES_802_3_OFFSET);
+ if (err) {
+ printk(KERN_ERR "%s: error %d reading frame header. "
+ "Frame dropped.\n", dev->name, err);
+ stats->rx_errors++;
+ goto drop;
+ }
-static int __orinoco_hw_setup_wep(struct orinoco_private *priv)
-{
- hermes_t *hw = &priv->hw;
- int err = 0;
- int master_wep_flag;
- int auth_flag;
+ length = ntohs(hdr.len);
+
+ /* Sanity checks */
+ if (length < 3) { /* No for even an 802.2 LLC header */
+ /* At least on Symbol firmware with PCF we get quite a
+ lot of these legitimately - Poll frames with no
+ data. */
+ stats->rx_dropped++;
+ goto drop;
+ }
+ if (length > IEEE802_11_DATA_LEN) {
+ printk(KERN_WARNING "%s: Oversized frame received (%d bytes)\n",
+ dev->name, length);
+ stats->rx_length_errors++;
+ stats->rx_errors++;
+ goto drop;
+ }
- switch (priv->firmware_type) {
- case FIRMWARE_TYPE_AGERE: /* Agere style WEP */
- if (priv->wep_on) {
- err = hermes_write_wordrec(hw, USER_BAP,
- HERMES_RID_CNFTXKEY_AGERE,
- priv->tx_key);
- if (err)
- return err;
-
- err = HERMES_WRITE_RECORD(hw, USER_BAP,
- HERMES_RID_CNFWEPKEYS_AGERE,
- &priv->keys);
- if (err)
- return err;
- }
- err = hermes_write_wordrec(hw, USER_BAP,
- HERMES_RID_CNFWEPENABLED_AGERE,
- priv->wep_on);
- if (err)
- return err;
- break;
-
- case FIRMWARE_TYPE_INTERSIL: /* Intersil style WEP */
- case FIRMWARE_TYPE_SYMBOL: /* Symbol style WEP */
- master_wep_flag = 0; /* Off */
- if (priv->wep_on) {
- int keylen;
- int i;
-
- /* Fudge around firmware weirdness */
- keylen = le16_to_cpu(priv->keys[priv->tx_key].len);
-
- /* Write all 4 keys */
- for(i = 0; i < ORINOCO_MAX_KEYS; i++) {
-/* int keylen = le16_to_cpu(priv->keys[i].len); */
-
- if (keylen > LARGE_KEY_SIZE) {
- printk(KERN_ERR "%s: BUG: Key %d has oversize length %d.\n",
- priv->ndev->name, i, keylen);
- return -E2BIG;
- }
-
- err = hermes_write_ltv(hw, USER_BAP,
- HERMES_RID_CNFDEFAULTKEY0 + i,
- HERMES_BYTES_TO_RECLEN(keylen),
- priv->keys[i].data);
- if (err)
- return err;
- }
+ /* We need space for the packet data itself, plus an ethernet
+ header, plus 2 bytes so we can align the IP header on a
+ 32bit boundary, plus 1 byte so we can read in odd length
+ packets from the card, which has an IO granularity of 16
+ bits */
+ skb = dev_alloc_skb(length+ETH_HLEN+2+1);
+ if (!skb) {
+ printk(KERN_WARNING "%s: Can't allocate skb for Rx\n",
+ dev->name);
+ goto drop;
+ }
- /* Write the index of the key used in transmission */
- err = hermes_write_wordrec(hw, USER_BAP, HERMES_RID_CNFWEPDEFAULTKEYID,
- priv->tx_key);
- if (err)
- return err;
-
- if (priv->wep_restrict) {
- auth_flag = 2;
- master_wep_flag = 3;
- } else {
- /* Authentication is where Intersil and Symbol
- * firmware differ... */
- auth_flag = 1;
- if (priv->firmware_type == FIRMWARE_TYPE_SYMBOL)
- master_wep_flag = 3; /* Symbol */
- else
- master_wep_flag = 1; /* Intersil */
- }
+ skb_reserve(skb, 2); /* This way the IP header is aligned */
+ /* Handle decapsulation
+ * In most cases, the firmware tell us about SNAP frames.
+ * For some reason, the SNAP frames sent by LinkSys APs
+ * are not properly recognised by most firmwares.
+ * So, check ourselves */
+ if(((status & HERMES_RXSTAT_MSGTYPE) == HERMES_RXSTAT_1042) ||
+ ((status & HERMES_RXSTAT_MSGTYPE) == HERMES_RXSTAT_TUNNEL) ||
+ is_ethersnap(&hdr)) {
+ /* These indicate a SNAP within 802.2 LLC within
+ 802.11 frame which we'll need to de-encapsulate to
+ the original EthernetII frame. */
- err = hermes_write_wordrec(hw, USER_BAP,
- HERMES_RID_CNFAUTHENTICATION, auth_flag);
- if (err)
- return err;
+ if (length < ENCAPS_OVERHEAD) { /* No room for full LLC+SNAP */
+ stats->rx_length_errors++;
+ goto drop;
}
-
- /* Master WEP setting : on/off */
- err = hermes_write_wordrec(hw, USER_BAP,
- HERMES_RID_CNFWEPFLAGS_INTERSIL,
- master_wep_flag);
- if (err)
- return err;
- break;
+ /* Remove SNAP header, reconstruct EthernetII frame */
+ data_len = length - ENCAPS_OVERHEAD;
+ data_off = HERMES_802_3_OFFSET + sizeof(hdr);
- default:
- if (priv->wep_on) {
- printk(KERN_ERR "%s: WEP enabled, although not supported!\n",
- priv->ndev->name);
- return -EINVAL;
- }
+ eh = (struct ethhdr *)skb_put(skb, ETH_HLEN);
+
+ memcpy(eh, &hdr, 2 * ETH_ALEN);
+ eh->h_proto = hdr.ethertype;
+ } else {
+ /* All other cases indicate a genuine 802.3 frame. No
+ decapsulation needed. We just throw the whole
+ thing in, and hope the protocol layer can deal with
+ it as 802.3 */
+ data_len = length;
+ data_off = HERMES_802_3_OFFSET;
+ /* FIXME: we re-read from the card data we already read here */
}
- return 0;
-}
+ p = skb_put(skb, data_len);
+ err = hermes_bap_pread(hw, IRQ_BAP, p, RUP_EVEN(data_len),
+ rxfid, data_off);
+ if (err) {
+ printk(KERN_ERR "%s: error %d reading frame. "
+ "Frame dropped.\n", dev->name, err);
+ stats->rx_errors++;
+ goto drop;
+ }
-static int orinoco_hw_get_bssid(struct orinoco_private *priv,
- char buf[ETH_ALEN])
-{
- hermes_t *hw = &priv->hw;
- int err = 0;
- unsigned long flags;
+ dev->last_rx = jiffies;
+ skb->dev = dev;
+ skb->protocol = eth_type_trans(skb, dev);
+ skb->ip_summed = CHECKSUM_NONE;
+
+ /* Process the wireless stats if needed */
+ orinoco_stat_gather(dev, skb, &desc);
- err = orinoco_lock(priv, &flags);
- if (err)
- return err;
+ /* Pass the packet to the networking stack */
+ netif_rx(skb);
+ stats->rx_packets++;
+ stats->rx_bytes += length;
- err = hermes_read_ltv(hw, USER_BAP, HERMES_RID_CURRENTBSSID,
- ETH_ALEN, NULL, buf);
+ return;
- orinoco_unlock(priv, &flags);
+ drop:
+ stats->rx_dropped++;
- return err;
+ if (skb)
+ dev_kfree_skb_irq(skb);
+ return;
}
-static int orinoco_hw_get_essid(struct orinoco_private *priv, int *active,
- char buf[IW_ESSID_MAX_SIZE+1])
-{
- hermes_t *hw = &priv->hw;
- int err = 0;
- struct hermes_idstring essidbuf;
- char *p = (char *)(&essidbuf.val);
- int len;
- unsigned long flags;
-
- err = orinoco_lock(priv, &flags);
- if (err)
- return err;
-
- if (strlen(priv->desired_essid) > 0) {
- /* We read the desired SSID from the hardware rather
- than from priv->desired_essid, just in case the
- firmware is allowed to change it on us. I'm not
- sure about this */
- /* My guess is that the OWNSSID should always be whatever
- * we set to the card, whereas CURRENT_SSID is the one that
- * may change... - Jean II */
- u16 rid;
+/********************************************************************/
+/* Rx path (info frames) */
+/********************************************************************/
- *active = 1;
+static void print_linkstatus(struct net_device *dev, u16 status)
+{
+ char * s;
- rid = (priv->port_type == 3) ? HERMES_RID_CNFOWNSSID :
- HERMES_RID_CNFDESIREDSSID;
-
- err = hermes_read_ltv(hw, USER_BAP, rid, sizeof(essidbuf),
- NULL, &essidbuf);
- if (err)
- goto fail_unlock;
- } else {
- *active = 0;
+ if (suppress_linkstatus)
+ return;
- err = hermes_read_ltv(hw, USER_BAP, HERMES_RID_CURRENTSSID,
- sizeof(essidbuf), NULL, &essidbuf);
- if (err)
- goto fail_unlock;
+ switch (status) {
+ case HERMES_LINKSTATUS_NOT_CONNECTED:
+ s = "Not Connected";
+ break;
+ case HERMES_LINKSTATUS_CONNECTED:
+ s = "Connected";
+ break;
+ case HERMES_LINKSTATUS_DISCONNECTED:
+ s = "Disconnected";
+ break;
+ case HERMES_LINKSTATUS_AP_CHANGE:
+ s = "AP Changed";
+ break;
+ case HERMES_LINKSTATUS_AP_OUT_OF_RANGE:
+ s = "AP Out of Range";
+ break;
+ case HERMES_LINKSTATUS_AP_IN_RANGE:
+ s = "AP In Range";
+ break;
+ case HERMES_LINKSTATUS_ASSOC_FAILED:
+ s = "Association Failed";
+ break;
+ default:
+ s = "UNKNOWN";
}
-
- len = le16_to_cpu(essidbuf.len);
-
- memset(buf, 0, IW_ESSID_MAX_SIZE+1);
- memcpy(buf, p, len);
- buf[len] = '\0';
-
- fail_unlock:
- orinoco_unlock(priv, &flags);
-
- return err;
+
+ printk(KERN_INFO "%s: New link status: %s (%04x)\n",
+ dev->name, s, status);
}
-static long orinoco_hw_get_freq(struct orinoco_private *priv)
+static void __orinoco_ev_info(struct net_device *dev, hermes_t *hw)
{
-
- hermes_t *hw = &priv->hw;
- int err = 0;
- u16 channel;
- long freq = 0;
- unsigned long flags;
+ struct orinoco_private *priv = netdev_priv(dev);
+ u16 infofid;
+ struct {
+ u16 len;
+ u16 type;
+ } __attribute__ ((packed)) info;
+ int len, type;
+ int err;
- err = orinoco_lock(priv, &flags);
- if (err)
- return err;
+ /* This is an answer to an INQUIRE command that we did earlier,
+ * or an information "event" generated by the card
+ * The controller return to us a pseudo frame containing
+ * the information in question - Jean II */
+ infofid = hermes_read_regn(hw, INFOFID);
+
+ /* Read the info frame header - don't try too hard */
+ err = hermes_bap_pread(hw, IRQ_BAP, &info, sizeof(info),
+ infofid, 0);
+ if (err) {
+ printk(KERN_ERR "%s: error %d reading info frame. "
+ "Frame dropped.\n", dev->name, err);
+ return;
+ }
- err = hermes_read_wordrec(hw, USER_BAP, HERMES_RID_CURRENTCHANNEL, &channel);
- if (err)
- goto out;
+ len = HERMES_RECLEN_TO_BYTES(le16_to_cpu(info.len));
+ type = le16_to_cpu(info.type);
- /* Intersil firmware 1.3.5 returns 0 when the interface is down */
- if (channel == 0) {
- err = -EBUSY;
- goto out;
+ switch (type) {
+ case HERMES_INQ_TALLIES: {
+ struct hermes_tallies_frame tallies;
+ struct iw_statistics *wstats = &priv->wstats;
+
+ if (len > sizeof(tallies)) {
+ printk(KERN_WARNING "%s: Tallies frame too long (%d bytes)\n",
+ dev->name, len);
+ len = sizeof(tallies);
+ }
+
+ /* Read directly the data (no seek) */
+ hermes_read_words(hw, HERMES_DATA1, (void *) &tallies,
+ len / 2); /* FIXME: blech! */
+
+ /* Increment our various counters */
+ /* wstats->discard.nwid - no wrong BSSID stuff */
+ wstats->discard.code +=
+ le16_to_cpu(tallies.RxWEPUndecryptable);
+ if (len == sizeof(tallies))
+ wstats->discard.code +=
+ le16_to_cpu(tallies.RxDiscards_WEPICVError) +
+ le16_to_cpu(tallies.RxDiscards_WEPExcluded);
+ wstats->discard.misc +=
+ le16_to_cpu(tallies.TxDiscardsWrongSA);
+ wstats->discard.fragment +=
+ le16_to_cpu(tallies.RxMsgInBadMsgFragments);
+ wstats->discard.retries +=
+ le16_to_cpu(tallies.TxRetryLimitExceeded);
+ /* wstats->miss.beacon - no match */
}
+ break;
+ case HERMES_INQ_LINKSTATUS: {
+ struct hermes_linkstatus linkstatus;
+ u16 newstatus;
+
+ if (len != sizeof(linkstatus)) {
+ printk(KERN_WARNING "%s: Unexpected size for linkstatus frame (%d bytes)\n",
+ dev->name, len);
+ break;
+ }
- if ( (channel < 1) || (channel > NUM_CHANNELS) ) {
- printk(KERN_WARNING "%s: Channel out of range (%d)!\n",
- priv->ndev->name, channel);
- err = -EBUSY;
- goto out;
+ hermes_read_words(hw, HERMES_DATA1, (void *) &linkstatus,
+ len / 2);
+ newstatus = le16_to_cpu(linkstatus.linkstatus);
- }
- freq = channel_frequency[channel-1] * 100000;
+ if ( (newstatus == HERMES_LINKSTATUS_CONNECTED)
+ || (newstatus == HERMES_LINKSTATUS_AP_CHANGE)
+ || (newstatus == HERMES_LINKSTATUS_AP_IN_RANGE) )
+ priv->connected = 1;
+ else if ( (newstatus == HERMES_LINKSTATUS_NOT_CONNECTED)
+ || (newstatus == HERMES_LINKSTATUS_DISCONNECTED)
+ || (newstatus == HERMES_LINKSTATUS_AP_OUT_OF_RANGE)
+ || (newstatus == HERMES_LINKSTATUS_ASSOC_FAILED) )
+ priv->connected = 0;
- out:
- orinoco_unlock(priv, &flags);
+ if (newstatus != priv->last_linkstatus)
+ print_linkstatus(dev, newstatus);
- if (err > 0)
- err = -EBUSY;
- return err ? err : freq;
+ priv->last_linkstatus = newstatus;
+ }
+ break;
+ default:
+ printk(KERN_DEBUG "%s: Unknown information frame received (type %04x).\n",
+ dev->name, type);
+ /* We don't actually do anything about it */
+ break;
+ }
}
-static int orinoco_hw_get_bitratelist(struct orinoco_private *priv,
- int *numrates, s32 *rates, int max)
+static void __orinoco_ev_infdrop(struct net_device *dev, hermes_t *hw)
{
- hermes_t *hw = &priv->hw;
- struct hermes_idstring list;
- unsigned char *p = (unsigned char *)&list.val;
- int err = 0;
- int num;
- int i;
- unsigned long flags;
+ if (net_ratelimit())
+ printk(KERN_WARNING "%s: Information frame lost.\n", dev->name);
+}
- err = orinoco_lock(priv, &flags);
- if (err)
- return err;
+/********************************************************************/
+/* Internal hardware control routines */
+/********************************************************************/
- err = hermes_read_ltv(hw, USER_BAP, HERMES_RID_SUPPORTEDDATARATES,
- sizeof(list), NULL, &list);
- orinoco_unlock(priv, &flags);
+int __orinoco_up(struct net_device *dev)
+{
+ struct orinoco_private *priv = netdev_priv(dev);
+ struct hermes *hw = &priv->hw;
+ int err;
- if (err)
+ err = __orinoco_program_rids(dev);
+ if (err) {
+ printk(KERN_ERR "%s: Error %d configuring card\n",
+ dev->name, err);
return err;
-
- num = le16_to_cpu(list.len);
- *numrates = num;
- num = min(num, max);
+ }
- for (i = 0; i < num; i++) {
- rates[i] = (p[i] & 0x7f) * 500000; /* convert to bps */
+ /* Fire things up again */
+ hermes_set_irqmask(hw, ORINOCO_INTEN);
+ err = hermes_enable_port(hw, 0);
+ if (err) {
+ printk(KERN_ERR "%s: Error %d enabling MAC port\n",
+ dev->name, err);
+ return err;
}
+ netif_start_queue(dev);
+
return 0;
}
-#if 0
-static void show_rx_frame(struct orinoco_rxframe_hdr *frame)
+int __orinoco_down(struct net_device *dev)
{
- printk(KERN_DEBUG "RX descriptor:\n");
- printk(KERN_DEBUG " status = 0x%04x\n", frame->desc.status);
- printk(KERN_DEBUG " time = 0x%08x\n", frame->desc.time);
- printk(KERN_DEBUG " silence = 0x%02x\n", frame->desc.silence);
- printk(KERN_DEBUG " signal = 0x%02x\n", frame->desc.signal);
- printk(KERN_DEBUG " rate = 0x%02x\n", frame->desc.rate);
- printk(KERN_DEBUG " rxflow = 0x%02x\n", frame->desc.rxflow);
- printk(KERN_DEBUG " reserved = 0x%08x\n", frame->desc.reserved);
+ struct orinoco_private *priv = netdev_priv(dev);
+ struct hermes *hw = &priv->hw;
+ int err;
- printk(KERN_DEBUG "IEEE 802.11 header:\n");
- printk(KERN_DEBUG " frame_ctl = 0x%04x\n",
- frame->p80211.frame_ctl);
- printk(KERN_DEBUG " duration_id = 0x%04x\n",
- frame->p80211.duration_id);
- printk(KERN_DEBUG " addr1 = %02x:%02x:%02x:%02x:%02x:%02x\n",
- frame->p80211.addr1[0], frame->p80211.addr1[1],
- frame->p80211.addr1[2], frame->p80211.addr1[3],
- frame->p80211.addr1[4], frame->p80211.addr1[5]);
- printk(KERN_DEBUG " addr2 = %02x:%02x:%02x:%02x:%02x:%02x\n",
- frame->p80211.addr2[0], frame->p80211.addr2[1],
- frame->p80211.addr2[2], frame->p80211.addr2[3],
- frame->p80211.addr2[4], frame->p80211.addr2[5]);
- printk(KERN_DEBUG " addr3 = %02x:%02x:%02x:%02x:%02x:%02x\n",
- frame->p80211.addr3[0], frame->p80211.addr3[1],
- frame->p80211.addr3[2], frame->p80211.addr3[3],
- frame->p80211.addr3[4], frame->p80211.addr3[5]);
- printk(KERN_DEBUG " seq_ctl = 0x%04x\n",
- frame->p80211.seq_ctl);
- printk(KERN_DEBUG " addr4 = %02x:%02x:%02x:%02x:%02x:%02x\n",
- frame->p80211.addr4[0], frame->p80211.addr4[1],
- frame->p80211.addr4[2], frame->p80211.addr4[3],
- frame->p80211.addr4[4], frame->p80211.addr4[5]);
- printk(KERN_DEBUG " data_len = 0x%04x\n",
- frame->p80211.data_len);
+ netif_stop_queue(dev);
- printk(KERN_DEBUG "IEEE 802.3 header:\n");
- printk(KERN_DEBUG " dest = %02x:%02x:%02x:%02x:%02x:%02x\n",
- frame->p8023.h_dest[0], frame->p8023.h_dest[1],
- frame->p8023.h_dest[2], frame->p8023.h_dest[3],
- frame->p8023.h_dest[4], frame->p8023.h_dest[5]);
- printk(KERN_DEBUG " src = %02x:%02x:%02x:%02x:%02x:%02x\n",
- frame->p8023.h_source[0], frame->p8023.h_source[1],
- frame->p8023.h_source[2], frame->p8023.h_source[3],
- frame->p8023.h_source[4], frame->p8023.h_source[5]);
- printk(KERN_DEBUG " len = 0x%04x\n", frame->p8023.h_proto);
+ if (! priv->hw_unavailable) {
+ if (! priv->broken_disableport) {
+ err = hermes_disable_port(hw, 0);
+ if (err) {
+ /* Some firmwares (e.g. Intersil 1.3.x) seem
+ * to have problems disabling the port, oh
+ * well, too bad. */
+ printk(KERN_WARNING "%s: Error %d disabling MAC port\n",
+ dev->name, err);
+ priv->broken_disableport = 1;
+ }
+ }
+ hermes_set_irqmask(hw, 0);
+ hermes_write_regn(hw, EVACK, 0xffff);
+ }
+
+ /* firmware will have to reassociate */
+ priv->last_linkstatus = 0xffff;
+ priv->connected = 0;
- printk(KERN_DEBUG "IEEE 802.2 LLC/SNAP header:\n");
- printk(KERN_DEBUG " DSAP = 0x%02x\n", frame->p8022.dsap);
- printk(KERN_DEBUG " SSAP = 0x%02x\n", frame->p8022.ssap);
- printk(KERN_DEBUG " ctrl = 0x%02x\n", frame->p8022.ctrl);
- printk(KERN_DEBUG " OUI = %02x:%02x:%02x\n",
- frame->p8022.oui[0], frame->p8022.oui[1], frame->p8022.oui[2]);
- printk(KERN_DEBUG " ethertype = 0x%04x\n", frame->ethertype);
+ return 0;
}
-#endif /* 0 */
-/*
- * Interrupt handler
- */
-irqreturn_t orinoco_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+int orinoco_reinit_firmware(struct net_device *dev)
{
- struct net_device *dev = (struct net_device *)dev_id;
struct orinoco_private *priv = netdev_priv(dev);
- hermes_t *hw = &priv->hw;
- int count = MAX_IRQLOOPS_PER_IRQ;
- u16 evstat, events;
- /* These are used to detect a runaway interrupt situation */
- /* If we get more than MAX_IRQLOOPS_PER_JIFFY iterations in a jiffy,
- * we panic and shut down the hardware */
- static int last_irq_jiffy = 0; /* jiffies value the last time we were called */
- static int loops_this_jiffy = 0;
- unsigned long flags;
+ struct hermes *hw = &priv->hw;
+ int err;
- if (orinoco_lock(priv, &flags) != 0) {
- /* If hw is unavailable - we don't know if the irq was
- * for us or not */
- return IRQ_HANDLED;
- }
+ err = hermes_init(hw);
+ if (err)
+ return err;
- evstat = hermes_read_regn(hw, EVSTAT);
- events = evstat & hw->inten;
- if (! events) {
- orinoco_unlock(priv, &flags);
- return IRQ_NONE;
- }
-
- if (jiffies != last_irq_jiffy)
- loops_this_jiffy = 0;
- last_irq_jiffy = jiffies;
+ err = hermes_allocate(hw, priv->nicbuf_size, &priv->txfid);
+ if (err == -EIO) {
+ /* Try workaround for old Symbol firmware bug */
+ printk(KERN_WARNING "%s: firmware ALLOC bug detected "
+ "(old Symbol firmware?). Trying to work around... ",
+ dev->name);
+
+ priv->nicbuf_size = TX_NICBUF_SIZE_BUG;
+ err = hermes_allocate(hw, priv->nicbuf_size, &priv->txfid);
+ if (err)
+ printk("failed!\n");
+ else
+ printk("ok.\n");
+ }
- while (events && count--) {
- if (++loops_this_jiffy > MAX_IRQLOOPS_PER_JIFFY) {
- printk(KERN_WARNING "%s: IRQ handler is looping too "
- "much! Resetting.\n", dev->name);
- /* Disable interrupts for now */
- hermes_set_irqmask(hw, 0);
- schedule_work(&priv->reset_work);
- break;
- }
+ return err;
+}
- /* Check the card hasn't been removed */
- if (! hermes_present(hw)) {
- DEBUG(0, "orinoco_interrupt(): card removed\n");
- break;
- }
+static int __orinoco_hw_set_bitrate(struct orinoco_private *priv)
+{
+ hermes_t *hw = &priv->hw;
+ int err = 0;
- if (events & HERMES_EV_TICK)
- __orinoco_ev_tick(dev, hw);
- if (events & HERMES_EV_WTERR)
- __orinoco_ev_wterr(dev, hw);
- if (events & HERMES_EV_INFDROP)
- __orinoco_ev_infdrop(dev, hw);
- if (events & HERMES_EV_INFO)
- __orinoco_ev_info(dev, hw);
- if (events & HERMES_EV_RX)
- __orinoco_ev_rx(dev, hw);
- if (events & HERMES_EV_TXEXC)
- __orinoco_ev_txexc(dev, hw);
- if (events & HERMES_EV_TX)
- __orinoco_ev_tx(dev, hw);
- if (events & HERMES_EV_ALLOC)
- __orinoco_ev_alloc(dev, hw);
-
- hermes_write_regn(hw, EVACK, events);
+ if (priv->bitratemode >= BITRATE_TABLE_SIZE) {
+ printk(KERN_ERR "%s: BUG: Invalid bitrate mode %d\n",
+ priv->ndev->name, priv->bitratemode);
+ return -EINVAL;
+ }
- evstat = hermes_read_regn(hw, EVSTAT);
- events = evstat & hw->inten;
- };
+ switch (priv->firmware_type) {
+ case FIRMWARE_TYPE_AGERE:
+ err = hermes_write_wordrec(hw, USER_BAP,
+ HERMES_RID_CNFTXRATECONTROL,
+ bitrate_table[priv->bitratemode].agere_txratectrl);
+ break;
+ case FIRMWARE_TYPE_INTERSIL:
+ case FIRMWARE_TYPE_SYMBOL:
+ err = hermes_write_wordrec(hw, USER_BAP,
+ HERMES_RID_CNFTXRATECONTROL,
+ bitrate_table[priv->bitratemode].intersil_txratectrl);
+ break;
+ default:
+ BUG();
+ }
- orinoco_unlock(priv, &flags);
- return IRQ_HANDLED;
+ return err;
}
-static void __orinoco_ev_tick(struct net_device *dev, hermes_t *hw)
+static int __orinoco_hw_setup_wep(struct orinoco_private *priv)
{
- printk(KERN_DEBUG "%s: TICK\n", dev->name);
-}
+ hermes_t *hw = &priv->hw;
+ int err = 0;
+ int master_wep_flag;
+ int auth_flag;
-static void __orinoco_ev_wterr(struct net_device *dev, hermes_t *hw)
-{
- /* This seems to happen a fair bit under load, but ignoring it
- seems to work fine...*/
- printk(KERN_DEBUG "%s: MAC controller error (WTERR). Ignoring.\n",
- dev->name);
-}
+ switch (priv->firmware_type) {
+ case FIRMWARE_TYPE_AGERE: /* Agere style WEP */
+ if (priv->wep_on) {
+ err = hermes_write_wordrec(hw, USER_BAP,
+ HERMES_RID_CNFTXKEY_AGERE,
+ priv->tx_key);
+ if (err)
+ return err;
+
+ err = HERMES_WRITE_RECORD(hw, USER_BAP,
+ HERMES_RID_CNFWEPKEYS_AGERE,
+ &priv->keys);
+ if (err)
+ return err;
+ }
+ err = hermes_write_wordrec(hw, USER_BAP,
+ HERMES_RID_CNFWEPENABLED_AGERE,
+ priv->wep_on);
+ if (err)
+ return err;
+ break;
-static void __orinoco_ev_infdrop(struct net_device *dev, hermes_t *hw)
-{
- if (net_ratelimit())
- printk(KERN_WARNING "%s: Information frame lost.\n", dev->name);
-}
+ case FIRMWARE_TYPE_INTERSIL: /* Intersil style WEP */
+ case FIRMWARE_TYPE_SYMBOL: /* Symbol style WEP */
+ master_wep_flag = 0; /* Off */
+ if (priv->wep_on) {
+ int keylen;
+ int i;
-static void print_linkstatus(struct net_device *dev, u16 status)
-{
- char * s;
+ /* Fudge around firmware weirdness */
+ keylen = le16_to_cpu(priv->keys[priv->tx_key].len);
+
+ /* Write all 4 keys */
+ for(i = 0; i < ORINOCO_MAX_KEYS; i++) {
+/* int keylen = le16_to_cpu(priv->keys[i].len); */
+
+ if (keylen > LARGE_KEY_SIZE) {
+ printk(KERN_ERR "%s: BUG: Key %d has oversize length %d.\n",
+ priv->ndev->name, i, keylen);
+ return -E2BIG;
+ }
- if (suppress_linkstatus)
- return;
+ err = hermes_write_ltv(hw, USER_BAP,
+ HERMES_RID_CNFDEFAULTKEY0 + i,
+ HERMES_BYTES_TO_RECLEN(keylen),
+ priv->keys[i].data);
+ if (err)
+ return err;
+ }
+
+ /* Write the index of the key used in transmission */
+ err = hermes_write_wordrec(hw, USER_BAP, HERMES_RID_CNFWEPDEFAULTKEYID,
+ priv->tx_key);
+ if (err)
+ return err;
+
+ if (priv->wep_restrict) {
+ auth_flag = 2;
+ master_wep_flag = 3;
+ } else {
+ /* Authentication is where Intersil and Symbol
+ * firmware differ... */
+ auth_flag = 1;
+ if (priv->firmware_type == FIRMWARE_TYPE_SYMBOL)
+ master_wep_flag = 3; /* Symbol */
+ else
+ master_wep_flag = 1; /* Intersil */
+ }
+
+
+ err = hermes_write_wordrec(hw, USER_BAP,
+ HERMES_RID_CNFAUTHENTICATION, auth_flag);
+ if (err)
+ return err;
+ }
+
+ /* Master WEP setting : on/off */
+ err = hermes_write_wordrec(hw, USER_BAP,
+ HERMES_RID_CNFWEPFLAGS_INTERSIL,
+ master_wep_flag);
+ if (err)
+ return err;
- switch (status) {
- case HERMES_LINKSTATUS_NOT_CONNECTED:
- s = "Not Connected";
- break;
- case HERMES_LINKSTATUS_CONNECTED:
- s = "Connected";
- break;
- case HERMES_LINKSTATUS_DISCONNECTED:
- s = "Disconnected";
- break;
- case HERMES_LINKSTATUS_AP_CHANGE:
- s = "AP Changed";
- break;
- case HERMES_LINKSTATUS_AP_OUT_OF_RANGE:
- s = "AP Out of Range";
- break;
- case HERMES_LINKSTATUS_AP_IN_RANGE:
- s = "AP In Range";
- break;
- case HERMES_LINKSTATUS_ASSOC_FAILED:
- s = "Association Failed";
break;
+
default:
- s = "UNKNOWN";
+ if (priv->wep_on) {
+ printk(KERN_ERR "%s: WEP enabled, although not supported!\n",
+ priv->ndev->name);
+ return -EINVAL;
+ }
}
-
- printk(KERN_INFO "%s: New link status: %s (%04x)\n",
- dev->name, s, status);
+
+ return 0;
}
-static void __orinoco_ev_info(struct net_device *dev, hermes_t *hw)
+static int __orinoco_program_rids(struct net_device *dev)
{
struct orinoco_private *priv = netdev_priv(dev);
- u16 infofid;
- struct {
- u16 len;
- u16 type;
- } __attribute__ ((packed)) info;
- int len, type;
+ hermes_t *hw = &priv->hw;
int err;
+ struct hermes_idstring idbuf;
- /* This is an answer to an INQUIRE command that we did earlier,
- * or an information "event" generated by the card
- * The controller return to us a pseudo frame containing
- * the information in question - Jean II */
- infofid = hermes_read_regn(hw, INFOFID);
+ /* Set the MAC address */
+ err = hermes_write_ltv(hw, USER_BAP, HERMES_RID_CNFOWNMACADDR,
+ HERMES_BYTES_TO_RECLEN(ETH_ALEN), dev->dev_addr);
+ if (err) {
+ printk(KERN_ERR "%s: Error %d setting MAC address\n", dev->name, err);
+ return err;
+ }
- /* Read the info frame header - don't try too hard */
- err = hermes_bap_pread(hw, IRQ_BAP, &info, sizeof(info),
- infofid, 0);
+ /* Set up the link mode */
+ err = hermes_write_wordrec(hw, USER_BAP, HERMES_RID_CNFPORTTYPE, priv->port_type);
if (err) {
- printk(KERN_ERR "%s: error %d reading info frame. "
- "Frame dropped.\n", dev->name, err);
- return;
+ printk(KERN_ERR "%s: Error %d setting port type\n", dev->name, err);
+ return err;
+ }
+ /* Set the channel/frequency */
+ if (priv->channel == 0) {
+ printk(KERN_DEBUG "%s: Channel is 0 in __orinoco_program_rids()\n", dev->name);
+ if (priv->createibss)
+ priv->channel = 10;
+ }
+ err = hermes_write_wordrec(hw, USER_BAP, HERMES_RID_CNFOWNCHANNEL, priv->channel);
+ if (err) {
+ printk(KERN_ERR "%s: Error %d setting channel\n", dev->name, err);
+ return err;
+ }
+
+ if (priv->has_ibss) {
+ err = hermes_write_wordrec(hw, USER_BAP, HERMES_RID_CNFCREATEIBSS,
+ priv->createibss);
+ if (err) {
+ printk(KERN_ERR "%s: Error %d setting CREATEIBSS\n", dev->name, err);
+ return err;
+ }
+
+ if ((strlen(priv->desired_essid) == 0) && (priv->createibss)
+ && (!priv->has_ibss_any)) {
+ printk(KERN_WARNING "%s: This firmware requires an \
+ESSID in IBSS-Ad-Hoc mode.\n", dev->name);
+ /* With wvlan_cs, in this case, we would crash.
+ * hopefully, this driver will behave better...
+ * Jean II */
+ }
+ }
+
+ /* Set the desired ESSID */
+ idbuf.len = cpu_to_le16(strlen(priv->desired_essid));
+ memcpy(&idbuf.val, priv->desired_essid, sizeof(idbuf.val));
+ /* WinXP wants partner to configure OWNSSID even in IBSS mode. (jimc) */
+ err = hermes_write_ltv(hw, USER_BAP, HERMES_RID_CNFOWNSSID,
+ HERMES_BYTES_TO_RECLEN(strlen(priv->desired_essid)+2),
+ &idbuf);
+ if (err) {
+ printk(KERN_ERR "%s: Error %d setting OWNSSID\n", dev->name, err);
+ return err;
+ }
+ err = hermes_write_ltv(hw, USER_BAP, HERMES_RID_CNFDESIREDSSID,
+ HERMES_BYTES_TO_RECLEN(strlen(priv->desired_essid)+2),
+ &idbuf);
+ if (err) {
+ printk(KERN_ERR "%s: Error %d setting DESIREDSSID\n", dev->name, err);
+ return err;
+ }
+
+ /* Set the station name */
+ idbuf.len = cpu_to_le16(strlen(priv->nick));
+ memcpy(&idbuf.val, priv->nick, sizeof(idbuf.val));
+ err = hermes_write_ltv(hw, USER_BAP, HERMES_RID_CNFOWNNAME,
+ HERMES_BYTES_TO_RECLEN(strlen(priv->nick)+2),
+ &idbuf);
+ if (err) {
+ printk(KERN_ERR "%s: Error %d setting nickname\n", dev->name, err);
+ return err;
+ }
+
+ /* Set AP density */
+ if (priv->has_sensitivity) {
+ err = hermes_write_wordrec(hw, USER_BAP, HERMES_RID_CNFSYSTEMSCALE,
+ priv->ap_density);
+ if (err) {
+ printk(KERN_WARNING "%s: Error %d setting SYSTEMSCALE. "
+ "Disabling sensitivity control\n", dev->name, err);
+
+ priv->has_sensitivity = 0;
+ }
+ }
+
+ /* Set RTS threshold */
+ err = hermes_write_wordrec(hw, USER_BAP, HERMES_RID_CNFRTSTHRESHOLD, priv->rts_thresh);
+ if (err) {
+ printk(KERN_ERR "%s: Error %d setting RTS threshold\n", dev->name, err);
+ return err;
+ }
+
+ /* Set fragmentation threshold or MWO robustness */
+ if (priv->has_mwo)
+ err = hermes_write_wordrec(hw, USER_BAP,
+ HERMES_RID_CNFMWOROBUST_AGERE,
+ priv->mwo_robust);
+ else
+ err = hermes_write_wordrec(hw, USER_BAP,
+ HERMES_RID_CNFFRAGMENTATIONTHRESHOLD,
+ priv->frag_thresh);
+ if (err) {
+ printk(KERN_ERR "%s: Error %d setting framentation\n", dev->name, err);
+ return err;
+ }
+
+ /* Set bitrate */
+ err = __orinoco_hw_set_bitrate(priv);
+ if (err) {
+ printk(KERN_ERR "%s: Error %d setting bitrate\n", dev->name, err);
+ return err;
+ }
+
+ /* Set power management */
+ if (priv->has_pm) {
+ err = hermes_write_wordrec(hw, USER_BAP, HERMES_RID_CNFPMENABLED,
+ priv->pm_on);
+ if (err) {
+ printk(KERN_ERR "%s: Error %d setting up PM\n",
+ dev->name, err);
+ return err;
+ }
+
+ err = hermes_write_wordrec(hw, USER_BAP,
+ HERMES_RID_CNFMULTICASTRECEIVE,
+ priv->pm_mcast);
+ if (err) {
+ printk(KERN_ERR "%s: Error %d setting up PM\n",
+ dev->name, err);
+ return err;
+ }
+ err = hermes_write_wordrec(hw, USER_BAP,
+ HERMES_RID_CNFMAXSLEEPDURATION,
+ priv->pm_period);
+ if (err) {
+ printk(KERN_ERR "%s: Error %d setting up PM\n",
+ dev->name, err);
+ return err;
+ }
+ err = hermes_write_wordrec(hw, USER_BAP,
+ HERMES_RID_CNFPMHOLDOVERDURATION,
+ priv->pm_timeout);
+ if (err) {
+ printk(KERN_ERR "%s: Error %d setting up PM\n",
+ dev->name, err);
+ return err;
+ }
+ }
+
+ /* Set preamble - only for Symbol so far... */
+ if (priv->has_preamble) {
+ err = hermes_write_wordrec(hw, USER_BAP,
+ HERMES_RID_CNFPREAMBLE_SYMBOL,
+ priv->preamble);
+ if (err) {
+ printk(KERN_ERR "%s: Error %d setting preamble\n",
+ dev->name, err);
+ return err;
+ }
}
-
- len = HERMES_RECLEN_TO_BYTES(le16_to_cpu(info.len));
- type = le16_to_cpu(info.type);
- switch (type) {
- case HERMES_INQ_TALLIES: {
- struct hermes_tallies_frame tallies;
- struct iw_statistics *wstats = &priv->wstats;
-
- if (len > sizeof(tallies)) {
- printk(KERN_WARNING "%s: Tallies frame too long (%d bytes)\n",
- dev->name, len);
- len = sizeof(tallies);
+ /* Set up encryption */
+ if (priv->has_wep) {
+ err = __orinoco_hw_setup_wep(priv);
+ if (err) {
+ printk(KERN_ERR "%s: Error %d activating WEP\n",
+ dev->name, err);
+ return err;
}
-
- /* Read directly the data (no seek) */
- hermes_read_words(hw, HERMES_DATA1, (void *) &tallies,
- len / 2); /* FIXME: blech! */
-
- /* Increment our various counters */
- /* wstats->discard.nwid - no wrong BSSID stuff */
- wstats->discard.code +=
- le16_to_cpu(tallies.RxWEPUndecryptable);
- if (len == sizeof(tallies))
- wstats->discard.code +=
- le16_to_cpu(tallies.RxDiscards_WEPICVError) +
- le16_to_cpu(tallies.RxDiscards_WEPExcluded);
- wstats->discard.misc +=
- le16_to_cpu(tallies.TxDiscardsWrongSA);
- wstats->discard.fragment +=
- le16_to_cpu(tallies.RxMsgInBadMsgFragments);
- wstats->discard.retries +=
- le16_to_cpu(tallies.TxRetryLimitExceeded);
- /* wstats->miss.beacon - no match */
}
- break;
- case HERMES_INQ_LINKSTATUS: {
- struct hermes_linkstatus linkstatus;
- u16 newstatus;
-
- if (len != sizeof(linkstatus)) {
- printk(KERN_WARNING "%s: Unexpected size for linkstatus frame (%d bytes)\n",
- dev->name, len);
- break;
- }
- hermes_read_words(hw, HERMES_DATA1, (void *) &linkstatus,
- len / 2);
- newstatus = le16_to_cpu(linkstatus.linkstatus);
+ /* Set promiscuity / multicast*/
+ priv->promiscuous = 0;
+ priv->mc_count = 0;
+ __orinoco_set_multicast_list(dev); /* FIXME: what about the xmit_lock */
- if ( (newstatus == HERMES_LINKSTATUS_CONNECTED)
- || (newstatus == HERMES_LINKSTATUS_AP_CHANGE)
- || (newstatus == HERMES_LINKSTATUS_AP_IN_RANGE) )
- priv->connected = 1;
- else if ( (newstatus == HERMES_LINKSTATUS_NOT_CONNECTED)
- || (newstatus == HERMES_LINKSTATUS_DISCONNECTED)
- || (newstatus == HERMES_LINKSTATUS_AP_OUT_OF_RANGE)
- || (newstatus == HERMES_LINKSTATUS_ASSOC_FAILED) )
- priv->connected = 0;
+ return 0;
+}
- if (newstatus != priv->last_linkstatus)
- print_linkstatus(dev, newstatus);
+/* FIXME: return int? */
+static void
+__orinoco_set_multicast_list(struct net_device *dev)
+{
+ struct orinoco_private *priv = netdev_priv(dev);
+ hermes_t *hw = &priv->hw;
+ int err = 0;
+ int promisc, mc_count;
- priv->last_linkstatus = newstatus;
+ /* The Hermes doesn't seem to have an allmulti mode, so we go
+ * into promiscuous mode and let the upper levels deal. */
+ if ( (dev->flags & IFF_PROMISC) || (dev->flags & IFF_ALLMULTI) ||
+ (dev->mc_count > MAX_MULTICAST(priv)) ) {
+ promisc = 1;
+ mc_count = 0;
+ } else {
+ promisc = 0;
+ mc_count = dev->mc_count;
}
- break;
- default:
- printk(KERN_DEBUG "%s: Unknown information frame received (type %04x).\n",
- dev->name, type);
- /* We don't actually do anything about it */
- break;
+
+ if (promisc != priv->promiscuous) {
+ err = hermes_write_wordrec(hw, USER_BAP,
+ HERMES_RID_CNFPROMISCUOUSMODE,
+ promisc);
+ if (err) {
+ printk(KERN_ERR "%s: Error %d setting PROMISCUOUSMODE to 1.\n",
+ dev->name, err);
+ } else
+ priv->promiscuous = promisc;
+ }
+
+ if (! promisc && (mc_count || priv->mc_count) ) {
+ struct dev_mc_list *p = dev->mc_list;
+ hermes_multicast_t mclist;
+ int i;
+
+ for (i = 0; i < mc_count; i++) {
+ /* Paranoia: */
+ if (! p)
+ BUG(); /* Multicast list shorter than mc_count */
+ if (p->dmi_addrlen != ETH_ALEN)
+ BUG(); /* Bad address size in multicast list */
+
+ memcpy(mclist.addr[i], p->dmi_addr, ETH_ALEN);
+ p = p->next;
+ }
+
+ if (p)
+ printk(KERN_WARNING "Multicast list is longer than mc_count\n");
+
+ err = hermes_write_ltv(hw, USER_BAP, HERMES_RID_CNFGROUPADDRESSES,
+ HERMES_BYTES_TO_RECLEN(priv->mc_count * ETH_ALEN),
+ &mclist);
+ if (err)
+ printk(KERN_ERR "%s: Error %d setting multicast list.\n",
+ dev->name, err);
+ else
+ priv->mc_count = mc_count;
}
+
+ /* Since we can set the promiscuous flag when it wasn't asked
+ for, make sure the net_device knows about it. */
+ if (priv->promiscuous)
+ dev->flags |= IFF_PROMISC;
+ else
+ dev->flags &= ~IFF_PROMISC;
}
-static void __orinoco_ev_rx(struct net_device *dev, hermes_t *hw)
+static int orinoco_reconfigure(struct net_device *dev)
{
struct orinoco_private *priv = netdev_priv(dev);
- struct net_device_stats *stats = &priv->stats;
- struct iw_statistics *wstats = &priv->wstats;
- struct sk_buff *skb = NULL;
- u16 rxfid, status;
- int length, data_len, data_off;
- char *p;
- struct hermes_rx_descriptor desc;
- struct header_struct hdr;
- struct ethhdr *eh;
- int err;
+ struct hermes *hw = &priv->hw;
+ unsigned long flags;
+ int err = 0;
- rxfid = hermes_read_regn(hw, RXFID);
+ if (priv->broken_disableport) {
+ schedule_work(&priv->reset_work);
+ return 0;
+ }
- err = hermes_bap_pread(hw, IRQ_BAP, &desc, sizeof(desc),
- rxfid, 0);
+ err = orinoco_lock(priv, &flags);
+ if (err)
+ return err;
+
+
+ err = hermes_disable_port(hw, 0);
if (err) {
- printk(KERN_ERR "%s: error %d reading Rx descriptor. "
- "Frame dropped.\n", dev->name, err);
- stats->rx_errors++;
- goto drop;
+ printk(KERN_WARNING "%s: Unable to disable port while reconfiguring card\n",
+ dev->name);
+ priv->broken_disableport = 1;
+ goto out;
}
- status = le16_to_cpu(desc.status);
-
- if (status & HERMES_RXSTAT_ERR) {
- if (status & HERMES_RXSTAT_UNDECRYPTABLE) {
- wstats->discard.code++;
- DEBUG(1, "%s: Undecryptable frame on Rx. Frame dropped.\n",
- dev->name);
- } else {
- stats->rx_crc_errors++;
- DEBUG(1, "%s: Bad CRC on Rx. Frame dropped.\n", dev->name);
- }
- stats->rx_errors++;
- goto drop;
+ err = __orinoco_program_rids(dev);
+ if (err) {
+ printk(KERN_WARNING "%s: Unable to reconfigure card\n",
+ dev->name);
+ goto out;
}
- /* For now we ignore the 802.11 header completely, assuming
- that the card's firmware has handled anything vital */
-
- err = hermes_bap_pread(hw, IRQ_BAP, &hdr, sizeof(hdr),
- rxfid, HERMES_802_3_OFFSET);
+ err = hermes_enable_port(hw, 0);
if (err) {
- printk(KERN_ERR "%s: error %d reading frame header. "
- "Frame dropped.\n", dev->name, err);
- stats->rx_errors++;
- goto drop;
+ printk(KERN_WARNING "%s: Unable to enable port while reconfiguring card\n",
+ dev->name);
+ goto out;
}
- length = ntohs(hdr.len);
-
- /* Sanity checks */
- if (length < 3) { /* No for even an 802.2 LLC header */
- /* At least on Symbol firmware with PCF we get quite a
- lot of these legitimately - Poll frames with no
- data. */
- stats->rx_dropped++;
- goto drop;
- }
- if (length > IEEE802_11_DATA_LEN) {
- printk(KERN_WARNING "%s: Oversized frame received (%d bytes)\n",
- dev->name, length);
- stats->rx_length_errors++;
- stats->rx_errors++;
- goto drop;
+ out:
+ if (err) {
+ printk(KERN_WARNING "%s: Resetting instead...\n", dev->name);
+ schedule_work(&priv->reset_work);
+ err = 0;
}
- /* We need space for the packet data itself, plus an ethernet
- header, plus 2 bytes so we can align the IP header on a
- 32bit boundary, plus 1 byte so we can read in odd length
- packets from the card, which has an IO granularity of 16
- bits */
- skb = dev_alloc_skb(length+ETH_HLEN+2+1);
- if (!skb) {
- printk(KERN_WARNING "%s: Can't allocate skb for Rx\n",
- dev->name);
- goto drop;
- }
+ orinoco_unlock(priv, &flags);
+ return err;
- skb_reserve(skb, 2); /* This way the IP header is aligned */
+}
+
+/* This must be called from user context, without locks held - use
+ * schedule_work() */
+static void orinoco_reset(struct net_device *dev)
+{
+ struct orinoco_private *priv = netdev_priv(dev);
+ struct hermes *hw = &priv->hw;
+ int err;
+ unsigned long flags;
+
+ err = orinoco_lock(priv, &flags);
+ if (err)
+ /* When the hardware becomes available again, whatever
+ * detects that is responsible for re-initializing
+ * it. So no need for anything further*/
+ return;
- /* Handle decapsulation
- * In most cases, the firmware tell us about SNAP frames.
- * For some reason, the SNAP frames sent by LinkSys APs
- * are not properly recognised by most firmwares.
- * So, check ourselves */
- if(((status & HERMES_RXSTAT_MSGTYPE) == HERMES_RXSTAT_1042) ||
- ((status & HERMES_RXSTAT_MSGTYPE) == HERMES_RXSTAT_TUNNEL) ||
- is_ethersnap(&hdr)) {
- /* These indicate a SNAP within 802.2 LLC within
- 802.11 frame which we'll need to de-encapsulate to
- the original EthernetII frame. */
+ netif_stop_queue(dev);
- if (length < ENCAPS_OVERHEAD) { /* No room for full LLC+SNAP */
- stats->rx_length_errors++;
- goto drop;
- }
+ /* Shut off interrupts. Depending on what state the hardware
+ * is in, this might not work, but we'll try anyway */
+ hermes_set_irqmask(hw, 0);
+ hermes_write_regn(hw, EVACK, 0xffff);
- /* Remove SNAP header, reconstruct EthernetII frame */
- data_len = length - ENCAPS_OVERHEAD;
- data_off = HERMES_802_3_OFFSET + sizeof(hdr);
+ priv->hw_unavailable++;
+ priv->last_linkstatus = 0xffff; /* firmware will have to reassociate */
+ priv->connected = 0;
- eh = (struct ethhdr *)skb_put(skb, ETH_HLEN);
+ orinoco_unlock(priv, &flags);
- memcpy(eh, &hdr, 2 * ETH_ALEN);
- eh->h_proto = hdr.ethertype;
- } else {
- /* All other cases indicate a genuine 802.3 frame. No
- decapsulation needed. We just throw the whole
- thing in, and hope the protocol layer can deal with
- it as 802.3 */
- data_len = length;
- data_off = HERMES_802_3_OFFSET;
- /* FIXME: we re-read from the card data we already read here */
+ if (priv->hard_reset)
+ err = (*priv->hard_reset)(priv);
+ if (err) {
+ printk(KERN_ERR "%s: orinoco_reset: Error %d performing hard reset\n",
+ dev->name, err);
+ /* FIXME: shutdown of some sort */
+ return;
}
- p = skb_put(skb, data_len);
- err = hermes_bap_pread(hw, IRQ_BAP, p, RUP_EVEN(data_len),
- rxfid, data_off);
+ err = orinoco_reinit_firmware(dev);
if (err) {
- printk(KERN_ERR "%s: error %d reading frame. "
- "Frame dropped.\n", dev->name, err);
- stats->rx_errors++;
- goto drop;
+ printk(KERN_ERR "%s: orinoco_reset: Error %d re-initializing firmware\n",
+ dev->name, err);
+ return;
}
- dev->last_rx = jiffies;
- skb->dev = dev;
- skb->protocol = eth_type_trans(skb, dev);
- skb->ip_summed = CHECKSUM_NONE;
-
- /* Process the wireless stats if needed */
- orinoco_stat_gather(dev, skb, &desc);
+ spin_lock_irq(&priv->lock); /* This has to be called from user context */
- /* Pass the packet to the networking stack */
- netif_rx(skb);
- stats->rx_packets++;
- stats->rx_bytes += length;
+ priv->hw_unavailable--;
- return;
+ /* priv->open or priv->hw_unavailable might have changed while
+ * we dropped the lock */
+ if (priv->open && (! priv->hw_unavailable)) {
+ err = __orinoco_up(dev);
+ if (err) {
+ printk(KERN_ERR "%s: orinoco_reset: Error %d reenabling card\n",
+ dev->name, err);
+ } else
+ dev->trans_start = jiffies;
+ }
- drop:
- stats->rx_dropped++;
+ spin_unlock_irq(&priv->lock);
- if (skb)
- dev_kfree_skb_irq(skb);
return;
}
-static void __orinoco_ev_txexc(struct net_device *dev, hermes_t *hw)
-{
- struct orinoco_private *priv = netdev_priv(dev);
- struct net_device_stats *stats = &priv->stats;
- u16 fid = hermes_read_regn(hw, TXCOMPLFID);
- struct hermes_tx_descriptor desc;
- int err = 0;
-
- if (fid == DUMMY_FID)
- return; /* Nothing's really happened */
-
- err = hermes_bap_pread(hw, IRQ_BAP, &desc, sizeof(desc), fid, 0);
- if (err) {
- printk(KERN_WARNING "%s: Unable to read descriptor on Tx error "
- "(FID=%04X error %d)\n",
- dev->name, fid, err);
- } else {
- DEBUG(1, "%s: Tx error, status %d\n",
- dev->name, le16_to_cpu(desc.status));
- }
-
- stats->tx_errors++;
+/********************************************************************/
+/* Interrupt handler */
+/********************************************************************/
- hermes_write_regn(hw, TXCOMPLFID, DUMMY_FID);
+static void __orinoco_ev_tick(struct net_device *dev, hermes_t *hw)
+{
+ printk(KERN_DEBUG "%s: TICK\n", dev->name);
}
-static void __orinoco_ev_tx(struct net_device *dev, hermes_t *hw)
+static void __orinoco_ev_wterr(struct net_device *dev, hermes_t *hw)
{
- struct orinoco_private *priv = netdev_priv(dev);
- struct net_device_stats *stats = &priv->stats;
-
- stats->tx_packets++;
-
- hermes_write_regn(hw, TXCOMPLFID, DUMMY_FID);
+ /* This seems to happen a fair bit under load, but ignoring it
+ seems to work fine...*/
+ printk(KERN_DEBUG "%s: MAC controller error (WTERR). Ignoring.\n",
+ dev->name);
}
-static void __orinoco_ev_alloc(struct net_device *dev, hermes_t *hw)
+irqreturn_t orinoco_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
+ struct net_device *dev = (struct net_device *)dev_id;
struct orinoco_private *priv = netdev_priv(dev);
+ hermes_t *hw = &priv->hw;
+ int count = MAX_IRQLOOPS_PER_IRQ;
+ u16 evstat, events;
+ /* These are used to detect a runaway interrupt situation */
+ /* If we get more than MAX_IRQLOOPS_PER_JIFFY iterations in a jiffy,
+ * we panic and shut down the hardware */
+ static int last_irq_jiffy = 0; /* jiffies value the last time we were called */
+ static int loops_this_jiffy = 0;
+ unsigned long flags;
- u16 fid = hermes_read_regn(hw, ALLOCFID);
+ if (orinoco_lock(priv, &flags) != 0) {
+ /* If hw is unavailable - we don't know if the irq was
+ * for us or not */
+ return IRQ_HANDLED;
+ }
- if (fid != priv->txfid) {
- if (fid != DUMMY_FID)
- printk(KERN_WARNING "%s: Allocate event on unexpected fid (%04X)\n",
- dev->name, fid);
- return;
- } else {
- netif_wake_queue(dev);
+ evstat = hermes_read_regn(hw, EVSTAT);
+ events = evstat & hw->inten;
+ if (! events) {
+ orinoco_unlock(priv, &flags);
+ return IRQ_NONE;
}
+
+ if (jiffies != last_irq_jiffy)
+ loops_this_jiffy = 0;
+ last_irq_jiffy = jiffies;
- hermes_write_regn(hw, ALLOCFID, DUMMY_FID);
+ while (events && count--) {
+ if (++loops_this_jiffy > MAX_IRQLOOPS_PER_JIFFY) {
+ printk(KERN_WARNING "%s: IRQ handler is looping too "
+ "much! Resetting.\n", dev->name);
+ /* Disable interrupts for now */
+ hermes_set_irqmask(hw, 0);
+ schedule_work(&priv->reset_work);
+ break;
+ }
+
+ /* Check the card hasn't been removed */
+ if (! hermes_present(hw)) {
+ DEBUG(0, "orinoco_interrupt(): card removed\n");
+ break;
+ }
+
+ if (events & HERMES_EV_TICK)
+ __orinoco_ev_tick(dev, hw);
+ if (events & HERMES_EV_WTERR)
+ __orinoco_ev_wterr(dev, hw);
+ if (events & HERMES_EV_INFDROP)
+ __orinoco_ev_infdrop(dev, hw);
+ if (events & HERMES_EV_INFO)
+ __orinoco_ev_info(dev, hw);
+ if (events & HERMES_EV_RX)
+ __orinoco_ev_rx(dev, hw);
+ if (events & HERMES_EV_TXEXC)
+ __orinoco_ev_txexc(dev, hw);
+ if (events & HERMES_EV_TX)
+ __orinoco_ev_tx(dev, hw);
+ if (events & HERMES_EV_ALLOC)
+ __orinoco_ev_alloc(dev, hw);
+
+ hermes_write_regn(hw, EVACK, events);
+
+ evstat = hermes_read_regn(hw, EVSTAT);
+ events = evstat & hw->inten;
+ };
+
+ orinoco_unlock(priv, &flags);
+ return IRQ_HANDLED;
}
+/********************************************************************/
+/* Initialization */
+/********************************************************************/
+
struct sta_id {
u16 id, variant, major, minor;
} __attribute__ ((packed));
@@ -2009,10 +2150,6 @@
}
}
-/*
- * struct net_device methods
- */
-
static int
orinoco_init(struct net_device *dev)
{
@@ -2180,370 +2317,215 @@
goto out;
}
- /* Make the hardware available, as long as it hasn't been
- * removed elsewhere (e.g. by PCMCIA hot unplug) */
- spin_lock_irq(&priv->lock);
- priv->hw_unavailable--;
- spin_unlock_irq(&priv->lock);
+ /* Make the hardware available, as long as it hasn't been
+ * removed elsewhere (e.g. by PCMCIA hot unplug) */
+ spin_lock_irq(&priv->lock);
+ priv->hw_unavailable--;
+ spin_unlock_irq(&priv->lock);
+
+ printk(KERN_DEBUG "%s: ready\n", dev->name);
+
+ out:
+ TRACE_EXIT(dev->name);
+ return err;
+}
+
+struct net_device *alloc_orinocodev(int sizeof_card, int (*hard_reset)(struct orinoco_private *))
+{
+ struct net_device *dev;
+ struct orinoco_private *priv;
+
+ dev = alloc_etherdev(sizeof(struct orinoco_private) + sizeof_card);
+ if (!dev)
+ return NULL;
+ priv = netdev_priv(dev);
+ priv->ndev = dev;
+ if (sizeof_card)
+ priv->card = (void *)((unsigned long)dev->priv + sizeof(struct orinoco_private));
+ else
+ priv->card = NULL;
+
+ /* Setup / override net_device fields */
+ dev->init = orinoco_init;
+ dev->hard_start_xmit = orinoco_xmit;
+ dev->tx_timeout = orinoco_tx_timeout;
+ dev->watchdog_timeo = HZ; /* 1 second timeout */
+ dev->get_stats = orinoco_get_stats;
+ dev->get_wireless_stats = orinoco_get_wireless_stats;
+ dev->do_ioctl = orinoco_ioctl;
+ dev->change_mtu = orinoco_change_mtu;
+ dev->set_multicast_list = orinoco_set_multicast_list;
+ /* we use the default eth_mac_addr for setting the MAC addr */
+
+ /* Set up default callbacks */
+ dev->open = orinoco_open;
+ dev->stop = orinoco_stop;
+ priv->hard_reset = hard_reset;
+
+ spin_lock_init(&priv->lock);
+ priv->open = 0;
+ priv->hw_unavailable = 1; /* orinoco_init() must clear this
+ * before anything else touches the
+ * hardware */
+ INIT_WORK(&priv->reset_work, (void (*)(void *))orinoco_reset, dev);
+
+ priv->last_linkstatus = 0xffff;
+ priv->connected = 0;
- printk(KERN_DEBUG "%s: ready\n", dev->name);
+ return dev;
- out:
- TRACE_EXIT(dev->name);
- return err;
}
-struct net_device_stats *
-orinoco_get_stats(struct net_device *dev)
-{
- struct orinoco_private *priv = netdev_priv(dev);
-
- return &priv->stats;
-}
+/********************************************************************/
+/* Wireless extensions */
+/********************************************************************/
-struct iw_statistics *
-orinoco_get_wireless_stats(struct net_device *dev)
+static int orinoco_hw_get_bssid(struct orinoco_private *priv,
+ char buf[ETH_ALEN])
{
- struct orinoco_private *priv = netdev_priv(dev);
hermes_t *hw = &priv->hw;
- struct iw_statistics *wstats = &priv->wstats;
int err = 0;
unsigned long flags;
- if (! netif_device_present(dev)) {
- printk(KERN_WARNING "%s: get_wireless_stats() called while device not present\n",
- dev->name);
- return NULL; /* FIXME: Can we do better than this? */
- }
-
err = orinoco_lock(priv, &flags);
if (err)
- return NULL; /* FIXME: Erg, we've been signalled, how
- * do we propagate this back up? */
-
- if (priv->iw_mode == IW_MODE_ADHOC) {
- memset(&wstats->qual, 0, sizeof(wstats->qual));
- /* If a spy address is defined, we report stats of the
- * first spy address - Jean II */
- if (SPY_NUMBER(priv)) {
- wstats->qual.qual = priv->spy_stat[0].qual;
- wstats->qual.level = priv->spy_stat[0].level;
- wstats->qual.noise = priv->spy_stat[0].noise;
- wstats->qual.updated = priv->spy_stat[0].updated;
- }
- } else {
- struct {
- u16 qual, signal, noise;
- } __attribute__ ((packed)) cq;
+ return err;
- err = HERMES_READ_RECORD(hw, USER_BAP,
- HERMES_RID_COMMSQUALITY, &cq);
-
- wstats->qual.qual = (int)le16_to_cpu(cq.qual);
- wstats->qual.level = (int)le16_to_cpu(cq.signal) - 0x95;
- wstats->qual.noise = (int)le16_to_cpu(cq.noise) - 0x95;
- wstats->qual.updated = 7;
- }
+ err = hermes_read_ltv(hw, USER_BAP, HERMES_RID_CURRENTBSSID,
+ ETH_ALEN, NULL, buf);
- /* We can't really wait for the tallies inquiry command to
- * complete, so we just use the previous results and trigger
- * a new tallies inquiry command for next time - Jean II */
- /* FIXME: We're in user context (I think?), so we should just
- wait for the tallies to come through */
- err = hermes_inquire(hw, HERMES_INQ_TALLIES);
-
orinoco_unlock(priv, &flags);
- if (err)
- return NULL;
-
- return wstats;
-}
-
-static inline void orinoco_spy_gather(struct net_device *dev, u_char *mac,
- int level, int noise)
-{
- struct orinoco_private *priv = netdev_priv(dev);
- int i;
-
- /* Gather wireless spy statistics: for each packet, compare the
- * source address with out list, and if match, get the stats... */
- for (i = 0; i < priv->spy_number; i++)
- if (!memcmp(mac, priv->spy_address[i], ETH_ALEN)) {
- priv->spy_stat[i].level = level - 0x95;
- priv->spy_stat[i].noise = noise - 0x95;
- priv->spy_stat[i].qual = (level > noise) ? (level - noise) : 0;
- priv->spy_stat[i].updated = 7;
- }
-}
-
-void
-orinoco_stat_gather(struct net_device *dev,
- struct sk_buff *skb,
- struct hermes_rx_descriptor *desc)
-{
- struct orinoco_private *priv = netdev_priv(dev);
-
- /* Using spy support with lots of Rx packets, like in an
- * infrastructure (AP), will really slow down everything, because
- * the MAC address must be compared to each entry of the spy list.
- * If the user really asks for it (set some address in the
- * spy list), we do it, but he will pay the price.
- * Note that to get here, you need both WIRELESS_SPY
- * compiled in AND some addresses in the list !!!
- */
- /* Note : gcc will optimise the whole section away if
- * WIRELESS_SPY is not defined... - Jean II */
- if (SPY_NUMBER(priv)) {
- orinoco_spy_gather(dev, skb->mac.raw + ETH_ALEN,
- desc->signal, desc->silence);
- }
+ return err;
}
-static int
-orinoco_xmit(struct sk_buff *skb, struct net_device *dev)
+static int orinoco_hw_get_essid(struct orinoco_private *priv, int *active,
+ char buf[IW_ESSID_MAX_SIZE+1])
{
- struct orinoco_private *priv = netdev_priv(dev);
- struct net_device_stats *stats = &priv->stats;
hermes_t *hw = &priv->hw;
int err = 0;
- u16 txfid = priv->txfid;
- char *p;
- struct ethhdr *eh;
- int len, data_len, data_off;
- struct hermes_tx_descriptor desc;
+ struct hermes_idstring essidbuf;
+ char *p = (char *)(&essidbuf.val);
+ int len;
unsigned long flags;
- TRACE_ENTER(dev->name);
-
- if (! netif_running(dev)) {
- printk(KERN_ERR "%s: Tx on stopped device!\n",
- dev->name);
- TRACE_EXIT(dev->name);
- return 1;
- }
-
- if (netif_queue_stopped(dev)) {
- printk(KERN_DEBUG "%s: Tx while transmitter busy!\n",
- dev->name);
- TRACE_EXIT(dev->name);
- return 1;
- }
-
- if (orinoco_lock(priv, &flags) != 0) {
- printk(KERN_ERR "%s: orinoco_xmit() called while hw_unavailable\n",
- dev->name);
- TRACE_EXIT(dev->name);
-/* BUG(); */
- return 1;
- }
-
- if (! priv->connected) {
- /* Oops, the firmware hasn't established a connection,
- silently drop the packet (this seems to be the
- safest approach). */
- stats->tx_errors++;
- orinoco_unlock(priv, &flags);
- dev_kfree_skb(skb);
- TRACE_EXIT(dev->name);
- return 0;
- }
-
- /* Length of the packet body */
- /* FIXME: what if the skb is smaller than this? */
- len = max_t(int,skb->len - ETH_HLEN, ETH_ZLEN - ETH_HLEN);
-
- eh = (struct ethhdr *)skb->data;
-
- memset(&desc, 0, sizeof(desc));
- desc.tx_control = cpu_to_le16(HERMES_TXCTRL_TX_OK | HERMES_TXCTRL_TX_EX);
- err = hermes_bap_pwrite(hw, USER_BAP, &desc, sizeof(desc), txfid, 0);
- if (err) {
- printk(KERN_ERR "%s: Error %d writing Tx descriptor to BAP\n",
- dev->name, err);
- stats->tx_errors++;
- goto fail;
- }
+ err = orinoco_lock(priv, &flags);
+ if (err)
+ return err;
- /* Clear the 802.11 header and data length fields - some
- * firmwares (e.g. Lucent/Agere 8.xx) appear to get confused
- * if this isn't done. */
- hermes_clear_words(hw, HERMES_DATA0,
- HERMES_802_3_OFFSET - HERMES_802_11_OFFSET);
+ if (strlen(priv->desired_essid) > 0) {
+ /* We read the desired SSID from the hardware rather
+ than from priv->desired_essid, just in case the
+ firmware is allowed to change it on us. I'm not
+ sure about this */
+ /* My guess is that the OWNSSID should always be whatever
+ * we set to the card, whereas CURRENT_SSID is the one that
+ * may change... - Jean II */
+ u16 rid;
- /* Encapsulate Ethernet-II frames */
- if (ntohs(eh->h_proto) > 1500) { /* Ethernet-II frame */
- struct header_struct hdr;
- data_len = len;
- data_off = HERMES_802_3_OFFSET + sizeof(hdr);
- p = skb->data + ETH_HLEN;
+ *active = 1;
- /* 802.3 header */
- memcpy(hdr.dest, eh->h_dest, ETH_ALEN);
- memcpy(hdr.src, eh->h_source, ETH_ALEN);
- hdr.len = htons(data_len + ENCAPS_OVERHEAD);
+ rid = (priv->port_type == 3) ? HERMES_RID_CNFOWNSSID :
+ HERMES_RID_CNFDESIREDSSID;
- /* 802.2 header */
- memcpy(&hdr.dsap, &encaps_hdr, sizeof(encaps_hdr));
-
- hdr.ethertype = eh->h_proto;
- err = hermes_bap_pwrite(hw, USER_BAP, &hdr, sizeof(hdr),
- txfid, HERMES_802_3_OFFSET);
- if (err) {
- printk(KERN_ERR "%s: Error %d writing packet header to BAP\n",
- dev->name, err);
- stats->tx_errors++;
- goto fail;
- }
- } else { /* IEEE 802.3 frame */
- data_len = len + ETH_HLEN;
- data_off = HERMES_802_3_OFFSET;
- p = skb->data;
- }
-
- /* Round up for odd length packets */
- err = hermes_bap_pwrite(hw, USER_BAP, p, RUP_EVEN(data_len), txfid, data_off);
- if (err) {
- printk(KERN_ERR "%s: Error %d writing packet to BAP\n",
- dev->name, err);
- stats->tx_errors++;
- goto fail;
- }
-
- /* Finally, we actually initiate the send */
- netif_stop_queue(dev);
-
- err = hermes_docmd_wait(hw, HERMES_CMD_TX | HERMES_CMD_RECL, txfid, NULL);
- if (err) {
- netif_start_queue(dev);
- printk(KERN_ERR "%s: Error %d transmitting packet\n", dev->name, err);
- stats->tx_errors++;
- goto fail;
- }
-
- dev->trans_start = jiffies;
- stats->tx_bytes += data_off + data_len;
-
- orinoco_unlock(priv, &flags);
+ err = hermes_read_ltv(hw, USER_BAP, rid, sizeof(essidbuf),
+ NULL, &essidbuf);
+ if (err)
+ goto fail_unlock;
+ } else {
+ *active = 0;
- dev_kfree_skb(skb);
+ err = hermes_read_ltv(hw, USER_BAP, HERMES_RID_CURRENTSSID,
+ sizeof(essidbuf), NULL, &essidbuf);
+ if (err)
+ goto fail_unlock;
+ }
- TRACE_EXIT(dev->name);
+ len = le16_to_cpu(essidbuf.len);
- return 0;
- fail:
- TRACE_EXIT(dev->name);
+ memset(buf, 0, IW_ESSID_MAX_SIZE+1);
+ memcpy(buf, p, len);
+ buf[len] = '\0';
+ fail_unlock:
orinoco_unlock(priv, &flags);
- return err;
+
+ return err;
}
-static void
-orinoco_tx_timeout(struct net_device *dev)
+static long orinoco_hw_get_freq(struct orinoco_private *priv)
{
- struct orinoco_private *priv = netdev_priv(dev);
- struct net_device_stats *stats = &priv->stats;
- struct hermes *hw = &priv->hw;
-
- printk(KERN_WARNING "%s: Tx timeout! "
- "ALLOCFID=%04x, TXCOMPLFID=%04x, EVSTAT=%04x\n",
- dev->name, hermes_read_regn(hw, ALLOCFID),
- hermes_read_regn(hw, TXCOMPLFID), hermes_read_regn(hw, EVSTAT));
-
- stats->tx_errors++;
+
+ hermes_t *hw = &priv->hw;
+ int err = 0;
+ u16 channel;
+ long freq = 0;
+ unsigned long flags;
- schedule_work(&priv->reset_work);
-}
+ err = orinoco_lock(priv, &flags);
+ if (err)
+ return err;
+
+ err = hermes_read_wordrec(hw, USER_BAP, HERMES_RID_CURRENTCHANNEL, &channel);
+ if (err)
+ goto out;
-static int
-orinoco_change_mtu(struct net_device *dev, int new_mtu)
-{
- struct orinoco_private *priv = netdev_priv(dev);
+ /* Intersil firmware 1.3.5 returns 0 when the interface is down */
+ if (channel == 0) {
+ err = -EBUSY;
+ goto out;
+ }
- if ( (new_mtu < ORINOCO_MIN_MTU) || (new_mtu > ORINOCO_MAX_MTU) )
- return -EINVAL;
+ if ( (channel < 1) || (channel > NUM_CHANNELS) ) {
+ printk(KERN_WARNING "%s: Channel out of range (%d)!\n",
+ priv->ndev->name, channel);
+ err = -EBUSY;
+ goto out;
- if ( (new_mtu + ENCAPS_OVERHEAD + IEEE802_11_HLEN) >
- (priv->nicbuf_size - ETH_HLEN) )
- return -EINVAL;
+ }
+ freq = channel_frequency[channel-1] * 100000;
- dev->mtu = new_mtu;
+ out:
+ orinoco_unlock(priv, &flags);
- return 0;
+ if (err > 0)
+ err = -EBUSY;
+ return err ? err : freq;
}
-/* FIXME: return int? */
-static void
-__orinoco_set_multicast_list(struct net_device *dev)
+static int orinoco_hw_get_bitratelist(struct orinoco_private *priv,
+ int *numrates, s32 *rates, int max)
{
- struct orinoco_private *priv = netdev_priv(dev);
hermes_t *hw = &priv->hw;
+ struct hermes_idstring list;
+ unsigned char *p = (unsigned char *)&list.val;
int err = 0;
- int promisc, mc_count;
-
- /* The Hermes doesn't seem to have an allmulti mode, so we go
- * into promiscuous mode and let the upper levels deal. */
- if ( (dev->flags & IFF_PROMISC) || (dev->flags & IFF_ALLMULTI) ||
- (dev->mc_count > MAX_MULTICAST(priv)) ) {
- promisc = 1;
- mc_count = 0;
- } else {
- promisc = 0;
- mc_count = dev->mc_count;
- }
+ int num;
+ int i;
+ unsigned long flags;
- if (promisc != priv->promiscuous) {
- err = hermes_write_wordrec(hw, USER_BAP,
- HERMES_RID_CNFPROMISCUOUSMODE,
- promisc);
- if (err) {
- printk(KERN_ERR "%s: Error %d setting PROMISCUOUSMODE to 1.\n",
- dev->name, err);
- } else
- priv->promiscuous = promisc;
- }
+ err = orinoco_lock(priv, &flags);
+ if (err)
+ return err;
- if (! promisc && (mc_count || priv->mc_count) ) {
- struct dev_mc_list *p = dev->mc_list;
- hermes_multicast_t mclist;
- int i;
+ err = hermes_read_ltv(hw, USER_BAP, HERMES_RID_SUPPORTEDDATARATES,
+ sizeof(list), NULL, &list);
+ orinoco_unlock(priv, &flags);
- for (i = 0; i < mc_count; i++) {
- /* Paranoia: */
- if (! p)
- BUG(); /* Multicast list shorter than mc_count */
- if (p->dmi_addrlen != ETH_ALEN)
- BUG(); /* Bad address size in multicast list */
-
- memcpy(mclist.addr[i], p->dmi_addr, ETH_ALEN);
- p = p->next;
- }
-
- if (p)
- printk(KERN_WARNING "Multicast list is longer than mc_count\n");
+ if (err)
+ return err;
+
+ num = le16_to_cpu(list.len);
+ *numrates = num;
+ num = min(num, max);
- err = hermes_write_ltv(hw, USER_BAP, HERMES_RID_CNFGROUPADDRESSES,
- HERMES_BYTES_TO_RECLEN(priv->mc_count * ETH_ALEN),
- &mclist);
- if (err)
- printk(KERN_ERR "%s: Error %d setting multicast list.\n",
- dev->name, err);
- else
- priv->mc_count = mc_count;
+ for (i = 0; i < num; i++) {
+ rates[i] = (p[i] & 0x7f) * 500000; /* convert to bps */
}
- /* Since we can set the promiscuous flag when it wasn't asked
- for, make sure the net_device knows about it. */
- if (priv->promiscuous)
- dev->flags |= IFF_PROMISC;
- else
- dev->flags &= ~IFF_PROMISC;
+ return 0;
}
-/********************************************************************/
-/* Wireless extensions support */
-/********************************************************************/
-
static int orinoco_ioctl_getiwrange(struct net_device *dev, struct iw_point *rrq)
{
struct orinoco_private *priv = netdev_priv(dev);
@@ -4102,51 +4084,68 @@
return 0;
}
-struct net_device *alloc_orinocodev(int sizeof_card, int (*hard_reset)(struct orinoco_private *))
-{
- struct net_device *dev;
- struct orinoco_private *priv;
-
- dev = alloc_etherdev(sizeof(struct orinoco_private) + sizeof_card);
- if (!dev)
- return NULL;
- priv = netdev_priv(dev);
- priv->ndev = dev;
- if (sizeof_card)
- priv->card = (void *)((unsigned long)dev->priv + sizeof(struct orinoco_private));
- else
- priv->card = NULL;
-
- /* Setup / override net_device fields */
- dev->init = orinoco_init;
- dev->hard_start_xmit = orinoco_xmit;
- dev->tx_timeout = orinoco_tx_timeout;
- dev->watchdog_timeo = HZ; /* 1 second timeout */
- dev->get_stats = orinoco_get_stats;
- dev->get_wireless_stats = orinoco_get_wireless_stats;
- dev->do_ioctl = orinoco_ioctl;
- dev->change_mtu = orinoco_change_mtu;
- dev->set_multicast_list = orinoco_set_multicast_list;
- /* we use the default eth_mac_addr for setting the MAC addr */
-
- /* Set up default callbacks */
- dev->open = orinoco_open;
- dev->stop = orinoco_stop;
- priv->hard_reset = hard_reset;
+/********************************************************************/
+/* Debugging */
+/********************************************************************/
- spin_lock_init(&priv->lock);
- priv->open = 0;
- priv->hw_unavailable = 1; /* orinoco_init() must clear this
- * before anything else touches the
- * hardware */
- INIT_WORK(&priv->reset_work, (void (*)(void *))orinoco_reset, dev);
+#if 0
+static void show_rx_frame(struct orinoco_rxframe_hdr *frame)
+{
+ printk(KERN_DEBUG "RX descriptor:\n");
+ printk(KERN_DEBUG " status = 0x%04x\n", frame->desc.status);
+ printk(KERN_DEBUG " time = 0x%08x\n", frame->desc.time);
+ printk(KERN_DEBUG " silence = 0x%02x\n", frame->desc.silence);
+ printk(KERN_DEBUG " signal = 0x%02x\n", frame->desc.signal);
+ printk(KERN_DEBUG " rate = 0x%02x\n", frame->desc.rate);
+ printk(KERN_DEBUG " rxflow = 0x%02x\n", frame->desc.rxflow);
+ printk(KERN_DEBUG " reserved = 0x%08x\n", frame->desc.reserved);
- priv->last_linkstatus = 0xffff;
- priv->connected = 0;
+ printk(KERN_DEBUG "IEEE 802.11 header:\n");
+ printk(KERN_DEBUG " frame_ctl = 0x%04x\n",
+ frame->p80211.frame_ctl);
+ printk(KERN_DEBUG " duration_id = 0x%04x\n",
+ frame->p80211.duration_id);
+ printk(KERN_DEBUG " addr1 = %02x:%02x:%02x:%02x:%02x:%02x\n",
+ frame->p80211.addr1[0], frame->p80211.addr1[1],
+ frame->p80211.addr1[2], frame->p80211.addr1[3],
+ frame->p80211.addr1[4], frame->p80211.addr1[5]);
+ printk(KERN_DEBUG " addr2 = %02x:%02x:%02x:%02x:%02x:%02x\n",
+ frame->p80211.addr2[0], frame->p80211.addr2[1],
+ frame->p80211.addr2[2], frame->p80211.addr2[3],
+ frame->p80211.addr2[4], frame->p80211.addr2[5]);
+ printk(KERN_DEBUG " addr3 = %02x:%02x:%02x:%02x:%02x:%02x\n",
+ frame->p80211.addr3[0], frame->p80211.addr3[1],
+ frame->p80211.addr3[2], frame->p80211.addr3[3],
+ frame->p80211.addr3[4], frame->p80211.addr3[5]);
+ printk(KERN_DEBUG " seq_ctl = 0x%04x\n",
+ frame->p80211.seq_ctl);
+ printk(KERN_DEBUG " addr4 = %02x:%02x:%02x:%02x:%02x:%02x\n",
+ frame->p80211.addr4[0], frame->p80211.addr4[1],
+ frame->p80211.addr4[2], frame->p80211.addr4[3],
+ frame->p80211.addr4[4], frame->p80211.addr4[5]);
+ printk(KERN_DEBUG " data_len = 0x%04x\n",
+ frame->p80211.data_len);
- return dev;
+ printk(KERN_DEBUG "IEEE 802.3 header:\n");
+ printk(KERN_DEBUG " dest = %02x:%02x:%02x:%02x:%02x:%02x\n",
+ frame->p8023.h_dest[0], frame->p8023.h_dest[1],
+ frame->p8023.h_dest[2], frame->p8023.h_dest[3],
+ frame->p8023.h_dest[4], frame->p8023.h_dest[5]);
+ printk(KERN_DEBUG " src = %02x:%02x:%02x:%02x:%02x:%02x\n",
+ frame->p8023.h_source[0], frame->p8023.h_source[1],
+ frame->p8023.h_source[2], frame->p8023.h_source[3],
+ frame->p8023.h_source[4], frame->p8023.h_source[5]);
+ printk(KERN_DEBUG " len = 0x%04x\n", frame->p8023.h_proto);
+ printk(KERN_DEBUG "IEEE 802.2 LLC/SNAP header:\n");
+ printk(KERN_DEBUG " DSAP = 0x%02x\n", frame->p8022.dsap);
+ printk(KERN_DEBUG " SSAP = 0x%02x\n", frame->p8022.ssap);
+ printk(KERN_DEBUG " ctrl = 0x%02x\n", frame->p8022.ctrl);
+ printk(KERN_DEBUG " OUI = %02x:%02x:%02x\n",
+ frame->p8022.oui[0], frame->p8022.oui[1], frame->p8022.oui[2]);
+ printk(KERN_DEBUG " ethertype = 0x%04x\n", frame->ethertype);
}
+#endif /* 0 */
/********************************************************************/
/* Module initialization */
Index: working-2.6/drivers/net/wireless/orinoco.h
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco.h 2004-07-28 14:56:32.926732688 +1000
+++ working-2.6/drivers/net/wireless/orinoco.h 2004-07-28 14:56:33.743608504 +1000
@@ -27,11 +27,6 @@
char data[ORINOCO_MAX_KEY_SIZE];
} __attribute__ ((packed));
-#define ORINOCO_INTEN ( HERMES_EV_RX | HERMES_EV_ALLOC | HERMES_EV_TX | \
- HERMES_EV_TXEXC | HERMES_EV_WTERR | HERMES_EV_INFO | \
- HERMES_EV_INFDROP )
-
-
struct orinoco_private {
void *card; /* Pointer to card dependent structure */
int (*hard_reset)(struct orinoco_private *);
Index: working-2.6/drivers/net/wireless/hermes.h
===================================================================
--- working-2.6.orig/drivers/net/wireless/hermes.h 2004-05-24 11:20:52.000000000 +1000
+++ working-2.6/drivers/net/wireless/hermes.h 2004-07-28 14:56:48.180413776 +1000
@@ -157,16 +157,6 @@
#define HERMES_802_3_OFFSET (14+32)
#define HERMES_802_2_OFFSET (14+32+14)
-struct hermes_rx_descriptor {
- u16 status;
- u32 time;
- u8 silence;
- u8 signal;
- u8 rate;
- u8 rxflow;
- u32 reserved;
-} __attribute__ ((packed));
-
#define HERMES_RXSTAT_ERR (0x0003)
#define HERMES_RXSTAT_BADCRC (0x0001)
#define HERMES_RXSTAT_UNDECRYPTABLE (0x0002)
@@ -262,6 +252,20 @@
u16 linkstatus; /* Link status */
} __attribute__ ((packed));
+typedef struct hermes_response {
+ u16 status, resp0, resp1, resp2;
+} hermes_response_t;
+
+/* "ID" structure - used for ESSID and station nickname */
+struct hermes_idstring {
+ u16 len;
+ u16 val[16];
+} __attribute__ ((packed));
+
+typedef struct hermes_multicast {
+ u8 addr[HERMES_MAX_MULTICAST][ETH_ALEN];
+} __attribute__ ((packed)) hermes_multicast_t;
+
// #define HERMES_DEBUG_BUFFER 1
#define HERMES_DEBUG_BUFSIZE 4096
struct hermes_debug_entry {
@@ -294,10 +298,6 @@
#endif
} hermes_t;
-typedef struct hermes_response {
- u16 status, resp0, resp1, resp2;
-} hermes_response_t;
-
/* Register access convenience macros */
#define hermes_read_reg(hw, off) ((hw)->io_space ? \
inw((hw)->iobase + ( (off) << (hw)->reg_spacing )) : \
Index: working-2.6/drivers/net/wireless/hermes_rid.h
===================================================================
--- working-2.6.orig/drivers/net/wireless/hermes_rid.h 2004-05-20 12:58:17.000000000 +1000
+++ working-2.6/drivers/net/wireless/hermes_rid.h 2004-07-28 14:56:33.745608200 +1000
@@ -140,14 +140,4 @@
#define HERMES_RID_BUILDSEQ 0xFFFE
#define HERMES_RID_FWID 0xFFFF
-/* "ID" structure - used for ESSID and station nickname */
-struct hermes_idstring {
- u16 len;
- u16 val[16];
-} __attribute__ ((packed));
-
-typedef struct hermes_multicast {
- u8 addr[HERMES_MAX_MULTICAST][ETH_ALEN];
-} __attribute__ ((packed)) hermes_multicast_t;
-
#endif
--
David Gibson | For every complex problem there is a
david AT gibson.dropbear.id.au | solution which is simple, neat and
| wrong.
http://www.ozlabs.org/people/dgibson
^ permalink raw reply [flat|nested] 31+ messages in thread
* [3/15] orinoco merge preliminaries - use netdev_priv()
2004-07-28 6:53 ` [2/15] orinoco merge preliminaries - rearrange code David Gibson
@ 2004-07-28 6:54 ` David Gibson
2004-07-28 6:54 ` [4/15] orinoco merge preliminaries - use ALIGN() David Gibson
0 siblings, 1 reply; 31+ messages in thread
From: David Gibson @ 2004-07-28 6:54 UTC (permalink / raw)
To: Jeff Garzik, Francois Romieu, Linux kernel mailing list, jt,
Dan Williams, Pavel Roskin, Orinoco Development List
Use the netdev_priv() macro instead of directly accessing dev->priv.
Signed-off-by: David Gibson <hermes@gibson.dropbear.id.au>
Index: working-2.6/drivers/net/wireless/orinoco.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco.c 2004-07-28 15:05:30.441018096 +1000
+++ working-2.6/drivers/net/wireless/orinoco.c 2004-07-28 15:05:31.213900600 +1000
@@ -2341,7 +2341,7 @@
priv = netdev_priv(dev);
priv->ndev = dev;
if (sizeof_card)
- priv->card = (void *)((unsigned long)dev->priv + sizeof(struct orinoco_private));
+ priv->card = (void *)((unsigned long)netdev_priv(dev) + sizeof(struct orinoco_private));
else
priv->card = NULL;
Index: working-2.6/drivers/net/wireless/orinoco_pci.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco_pci.c 2004-06-29 11:47:02.000000000 +1000
+++ working-2.6/drivers/net/wireless/orinoco_pci.c 2004-07-28 15:05:31.215900296 +1000
@@ -212,7 +212,7 @@
err = -ENOMEM;
goto fail;
}
- priv = dev->priv;
+ priv = netdev_priv(dev);
dev->base_addr = (unsigned long) pci_ioaddr;
dev->mem_start = pci_iorange;
@@ -275,7 +275,7 @@
static void __devexit orinoco_pci_remove_one(struct pci_dev *pdev)
{
struct net_device *dev = pci_get_drvdata(pdev);
- struct orinoco_private *priv = dev->priv;
+ struct orinoco_private *priv = netdev_priv(dev);
unregister_netdev(dev);
@@ -294,7 +294,7 @@
static int orinoco_pci_suspend(struct pci_dev *pdev, u32 state)
{
struct net_device *dev = pci_get_drvdata(pdev);
- struct orinoco_private *priv = dev->priv;
+ struct orinoco_private *priv = netdev_priv(dev);
unsigned long flags;
int err;
@@ -325,7 +325,7 @@
static int orinoco_pci_resume(struct pci_dev *pdev)
{
struct net_device *dev = pci_get_drvdata(pdev);
- struct orinoco_private *priv = dev->priv;
+ struct orinoco_private *priv = netdev_priv(dev);
unsigned long flags;
int err;
Index: working-2.6/drivers/net/wireless/orinoco_tmd.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco_tmd.c 2004-07-28 15:05:26.394633240 +1000
+++ working-2.6/drivers/net/wireless/orinoco_tmd.c 2004-07-28 15:05:31.216900144 +1000
@@ -121,7 +121,7 @@
goto fail;
}
- priv = dev->priv;
+ priv = netdev_priv(dev);
dev->base_addr = pccard_ioaddr;
SET_MODULE_OWNER(dev);
SET_NETDEV_DEV(dev, &pdev->dev);
Index: working-2.6/drivers/net/wireless/orinoco_cs.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco_cs.c 2004-07-28 15:05:26.396632936 +1000
+++ working-2.6/drivers/net/wireless/orinoco_cs.c 2004-07-28 15:05:31.218899840 +1000
@@ -163,7 +163,7 @@
dev = alloc_orinocodev(sizeof(*card), orinoco_cs_hard_reset);
if (! dev)
return NULL;
- priv = dev->priv;
+ priv = netdev_priv(dev);
card = priv->card;
/* Link both structures together */
@@ -266,7 +266,7 @@
{
struct net_device *dev = link->priv;
client_handle_t handle = link->handle;
- struct orinoco_private *priv = dev->priv;
+ struct orinoco_private *priv = netdev_priv(dev);
struct orinoco_pccard *card = priv->card;
hermes_t *hw = &priv->hw;
int last_fn, last_ret;
@@ -499,7 +499,7 @@
orinoco_cs_release(dev_link_t *link)
{
struct net_device *dev = link->priv;
- struct orinoco_private *priv = dev->priv;
+ struct orinoco_private *priv = netdev_priv(dev);
unsigned long flags;
/* We're committed to taking the device away now, so mark the
@@ -527,7 +527,7 @@
{
dev_link_t *link = args->client_data;
struct net_device *dev = link->priv;
- struct orinoco_private *priv = dev->priv;
+ struct orinoco_private *priv = netdev_priv(dev);
struct orinoco_pccard *card = priv->card;
int err = 0;
unsigned long flags;
Index: working-2.6/drivers/net/wireless/airport.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/airport.c 2004-07-27 17:02:56.000000000 +1000
+++ working-2.6/drivers/net/wireless/airport.c 2004-07-28 15:05:31.219899688 +1000
@@ -50,7 +50,7 @@
airport_suspend(struct macio_dev *mdev, u32 state)
{
struct net_device *dev = dev_get_drvdata(&mdev->ofdev.dev);
- struct orinoco_private *priv = dev->priv;
+ struct orinoco_private *priv = netdev_priv(dev);
unsigned long flags;
int err;
@@ -84,7 +84,7 @@
airport_resume(struct macio_dev *mdev)
{
struct net_device *dev = dev_get_drvdata(&mdev->ofdev.dev);
- struct orinoco_private *priv = dev->priv;
+ struct orinoco_private *priv = netdev_priv(dev);
unsigned long flags;
int err;
@@ -126,7 +126,7 @@
airport_detach(struct macio_dev *mdev)
{
struct net_device *dev = dev_get_drvdata(&mdev->ofdev.dev);
- struct orinoco_private *priv = dev->priv;
+ struct orinoco_private *priv = netdev_priv(dev);
struct airport *card = priv->card;
if (card->ndev_registered)
@@ -204,7 +204,7 @@
printk(KERN_ERR "airport: can't allocate device datas\n");
return -ENODEV;
}
- priv = dev->priv;
+ priv = netdev_priv(dev);
card = priv->card;
hw = &priv->hw;
Index: working-2.6/drivers/net/wireless/orinoco_plx.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco_plx.c 2004-07-28 15:05:26.397632784 +1000
+++ working-2.6/drivers/net/wireless/orinoco_plx.c 2004-07-28 15:05:31.220899536 +1000
@@ -229,7 +229,7 @@
goto fail;
}
- priv = dev->priv;
+ priv = netdev_priv(dev);
dev->base_addr = pccard_ioaddr;
SET_MODULE_OWNER(dev);
SET_NETDEV_DEV(dev, &pdev->dev);
--
David Gibson | For every complex problem there is a
david AT gibson.dropbear.id.au | solution which is simple, neat and
| wrong.
http://www.ozlabs.org/people/dgibson
^ permalink raw reply [flat|nested] 31+ messages in thread
* [4/15] orinoco merge preliminaries - use ALIGN()
2004-07-28 6:54 ` [3/15] orinoco merge preliminaries - use netdev_priv() David Gibson
@ 2004-07-28 6:54 ` David Gibson
2004-07-28 6:55 ` [5/15] orinoco merge preliminaries - use ARRAY_SIZE() David Gibson
0 siblings, 1 reply; 31+ messages in thread
From: David Gibson @ 2004-07-28 6:54 UTC (permalink / raw)
To: Jeff Garzik, Francois Romieu, Linux kernel mailing list, jt,
Dan Williams, Pavel Roskin, Orinoco Development List
Use the kernel's ALIGN macro instead of our own dodgy version for
rounding things up to an even number.
Signed-off-by: David Gibson <hermes@gibson.dropbear.id.au>
Index: working-2.6/drivers/net/wireless/orinoco.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco.c 2004-07-28 15:05:31.213900600 +1000
+++ working-2.6/drivers/net/wireless/orinoco.c 2004-07-28 15:05:34.768360240 +1000
@@ -490,8 +490,6 @@
#define DUMMY_FID 0xFFFF
-#define RUP_EVEN(a) (((a) + 1) & (~1))
-
/*#define MAX_MULTICAST(priv) (priv->firmware_type == FIRMWARE_TYPE_AGERE ? \
HERMES_MAX_MULTICAST : 0)*/
#define MAX_MULTICAST(priv) (HERMES_MAX_MULTICAST)
@@ -847,7 +845,7 @@
}
/* Round up for odd length packets */
- err = hermes_bap_pwrite(hw, USER_BAP, p, RUP_EVEN(data_len), txfid, data_off);
+ err = hermes_bap_pwrite(hw, USER_BAP, p, ALIGN(data_len, 2), txfid, data_off);
if (err) {
printk(KERN_ERR "%s: Error %d writing packet to BAP\n",
dev->name, err);
@@ -1132,7 +1130,7 @@
}
p = skb_put(skb, data_len);
- err = hermes_bap_pread(hw, IRQ_BAP, p, RUP_EVEN(data_len),
+ err = hermes_bap_pread(hw, IRQ_BAP, p, ALIGN(data_len, 2),
rxfid, data_off);
if (err) {
printk(KERN_ERR "%s: error %d reading frame. "
--
David Gibson | For every complex problem there is a
david AT gibson.dropbear.id.au | solution which is simple, neat and
| wrong.
http://www.ozlabs.org/people/dgibson
^ permalink raw reply [flat|nested] 31+ messages in thread
* [5/15] orinoco merge preliminaries - use ARRAY_SIZE()
2004-07-28 6:54 ` [4/15] orinoco merge preliminaries - use ALIGN() David Gibson
@ 2004-07-28 6:55 ` David Gibson
2004-07-28 6:55 ` [6/15] orinoco merge preliminaries - spam stoppers David Gibson
0 siblings, 1 reply; 31+ messages in thread
From: David Gibson @ 2004-07-28 6:55 UTC (permalink / raw)
To: Jeff Garzik, Francois Romieu, Linux kernel mailing list, jt,
Dan Williams, Pavel Roskin, Orinoco Development List
Use the built in ARRAY_SIZE macro, instead of hard coding it
ourselves.
Signed-off-by: David Gibson <hermes@gibson.dropbear.id.au>
Index: working-2.6/drivers/net/wireless/orinoco.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco.c 2004-07-28 14:33:14.111384944 +1000
+++ working-2.6/drivers/net/wireless/orinoco.c 2004-07-28 14:33:17.540863584 +1000
@@ -507,7 +507,7 @@
2412, 2417, 2422, 2427, 2432, 2437, 2442,
2447, 2452, 2457, 2462, 2467, 2472, 2484
};
-#define NUM_CHANNELS ( sizeof(channel_frequency) / sizeof(channel_frequency[0]) )
+#define NUM_CHANNELS ARRAY_SIZE(channel_frequency)
/* This tables gives the actual meanings of the bitrate IDs returned by the firmware. */
struct {
@@ -525,7 +525,7 @@
{55, 1, 7, 7},
{110, 0, 5, 8},
};
-#define BITRATE_TABLE_SIZE (sizeof(bitrate_table) / sizeof(bitrate_table[0]))
+#define BITRATE_TABLE_SIZE ARRAY_SIZE(bitrate_table)
/********************************************************************/
/* Data types */
--
David Gibson | For every complex problem there is a
david AT gibson.dropbear.id.au | solution which is simple, neat and
| wrong.
http://www.ozlabs.org/people/dgibson
^ permalink raw reply [flat|nested] 31+ messages in thread
* [6/15] orinoco merge preliminaries - spam stoppers
2004-07-28 6:55 ` [5/15] orinoco merge preliminaries - use ARRAY_SIZE() David Gibson
@ 2004-07-28 6:55 ` David Gibson
2004-07-28 6:56 ` [7/15] orinoco merge preliminaries - comment/whitespace/spelling updates David Gibson
2004-07-28 17:36 ` [6/15] orinoco merge preliminaries - spam stoppers Matt Mackall
0 siblings, 2 replies; 31+ messages in thread
From: David Gibson @ 2004-07-28 6:55 UTC (permalink / raw)
To: Jeff Garzik, Francois Romieu, Linux kernel mailing list, jt,
Dan Williams, Pavel Roskin, Orinoco Development List
Anti-spam obfuscate most email addresses in the orinoco driver files.
Yes, this is closing gate long after the sheep have run, but I guess
it can't hurt.
Signed-off-by: David Gibson <hermes@gibson.dropbear.id.au>
Index: working-2.6/drivers/net/wireless/orinoco.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco.c
+++ working-2.6/drivers/net/wireless/orinoco.c
@@ -3,15 +3,16 @@
* A driver for Hermes or Prism 2 chipset based PCMCIA wireless
* adaptors, with Lucent/Agere, Intersil or Symbol firmware.
*
- * Copyright (C) 2000 David Gibson, Linuxcare Australia <hermes@gibson.dropbear.id.au>
+ * Copyright (C) 2000 David Gibson, Linuxcare Australia <hermes AT gibson.dropbear.id.au>
* With some help from :
- * Copyright (C) 2001 Jean Tourrilhes, HP Labs <jt@hpl.hp.com>
- * Copyright (C) 2001 Benjamin Herrenschmidt <benh@kernel.crashing.org>
+ * Copyright (C) 2001 Jean Tourrilhes, HP Labs <jt AT hpl.hp.com>
+ * Copyright (C) 2001 Benjamin Herrenschmidt <benh AT kernel.crashing.org>
*
* Based on dummy_cs.c 1.27 2000/06/12 21:27:25
*
- * Portions based on wvlan_cs.c 1.0.6, Copyright Andreas Neuhaus <andy@fasta.fh-dortmund.de>
- * http://www.fasta.fh-dortmund.de/users/andy/wvlan/
+ * Portions based on wvlan_cs.c 1.0.6, Copyright Andreas Neuhaus <andy
+ * AT fasta.fh-dortmund.de>
+ * http://www.fasta.fh-dortmund.de/users/andy/wvlan/
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
@@ -24,7 +25,7 @@
* limitations under the License.
*
* The initial developer of the original code is David A. Hinds
- * <dahinds@users.sourceforge.net>. Portions created by David
+ * <dahinds AT users.sourceforge.net>. Portions created by David
* A. Hinds are Copyright (C) 1999 David A. Hinds. All Rights
* Reserved.
*
@@ -82,7 +83,7 @@
* o Clean up RID definitions in hermes.h, other cleanups
*
* v0.04b -> v0.04c - 24/4/2001 - Jean II
- * o Tim Hurley <timster@seiki.bliztech.com> reported a D-Link card
+ * o Tim Hurley <timster AT seiki.bliztech.com> reported a D-Link card
* with vendor 02 and firmware 0.08. Added in the capabilities...
* o Tested Lucent firmware 7.28, everything works...
*
@@ -106,14 +107,14 @@
*
* v0.05c -> v0.05d - 5/5/2001 - Jean II
* o Workaround to SNAP decapsulate frame from LinkSys AP
- * original patch from : Dong Liu <dliu@research.bell-labs.com>
+ * original patch from : Dong Liu <dliu AT research.bell-labs.com>
* (note : the memcmp bug was mine - fixed)
* o Remove set_retry stuff, no firmware support it (bloat--).
*
* v0.05d -> v0.06 - 25/5/2001 - Jean II
- * Original patch from "Hong Lin" <alin@redhat.com>,
- * "Ian Kinner" <ikinner@redhat.com>
- * and "David Smith" <dsmith@redhat.com>
+ * Original patch from "Hong Lin" <alin AT redhat.com>,
+ * "Ian Kinner" <ikinner AT redhat.com>
+ * and "David Smith" <dsmith AT redhat.com>
* o Init of priv->tx_rate_ctrl in firmware specific section.
* o Prism2/Symbol rate, upto should be 0xF and not 0x15. Doh !
* o Spectrum card always need cor_reset (for every reset)
@@ -137,7 +138,7 @@
* wishes to reduce the number of unecessary messages.
* o Removed bogus message on CRC error.
* o Merged fixeds for v0.08 Prism 2 firmware from William Waghorn
- * <willwaghorn@yahoo.co.uk>
+ * <willwaghorn AT yahoo.co.uk>
* o Slight cleanup/re-arrangement of firmware detection code.
*
* v0.06d -> v0.06e - 1/8/2001 - David Gibson
@@ -159,7 +160,7 @@
* v0.07 -> v0.07a - 1/10/3001 - Jean II
* o Add code to read Symbol firmware revision, inspired by latest code
* in Spectrum24 by Lee John Keyser-Allen - Thanks Lee !
- * o Thanks to Jared Valentine <hidden@xmission.com> for "providing" me
+ * o Thanks to Jared Valentine <hidden AT xmission.com> for "providing" me
* a 3Com card with a recent firmware, fill out Symbol firmware
* capabilities of latest rev (2.20), as well as older Symbol cards.
* o Disable Power Management in newer Symbol firmware, the API
Index: working-2.6/drivers/net/wireless/orinoco_pci.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco_pci.c
+++ working-2.6/drivers/net/wireless/orinoco_pci.c
@@ -6,14 +6,14 @@
* Specifically here we're talking about the Linksys WMP11
*
* Some of this code is borrowed from orinoco_plx.c
- * Copyright (C) 2001 Daniel Barlow <dan@telent.net>
+ * Copyright (C) 2001 Daniel Barlow <dan AT telent.net>
* Some of this code is "inspired" by linux-wlan-ng-0.1.10, but nothing
* has been copied from it. linux-wlan-ng-0.1.10 is originally :
* Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved.
* This file originally written by:
- * Copyright (C) 2001 Jean Tourrilhes <jt@hpl.hp.com>
+ * Copyright (C) 2001 Jean Tourrilhes <jt AT hpl.hp.com>
* And is now maintained by:
- * Copyright (C) 2002 David Gibson, IBM Corporation <herme@gibson.dropbear.id.au>
+ * Copyright (C) 2002 David Gibson, IBM Corporation <herme AT gibson.dropbear.id.au>
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
Index: working-2.6/drivers/net/wireless/orinoco_plx.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco_plx.c
+++ working-2.6/drivers/net/wireless/orinoco_plx.c
@@ -3,7 +3,7 @@
* Driver for Prism II devices which would usually be driven by orinoco_cs,
* but are connected to the PCI bus by a PLX9052.
*
- * Copyright (C) 2001 Daniel Barlow <dan@telent.net>
+ * Copyright (C) 2001 Daniel Barlow <dan AT telent.net>
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
@@ -311,9 +311,9 @@
{0x16ab, 0x1102, PCI_ANY_ID, PCI_ANY_ID,}, /* Linksys WDT11 */
{0x16ec, 0x3685, PCI_ANY_ID, PCI_ANY_ID,}, /* USR 2415 */
{0xec80, 0xec00, PCI_ANY_ID, PCI_ANY_ID,}, /* Belkin F5D6000 tested by
- Brendan W. McAdams <rit@jacked-in.org> */
+ Brendan W. McAdams <rit AT jacked-in.org> */
{0x10b7, 0x7770, PCI_ANY_ID, PCI_ANY_ID,}, /* 3Com AirConnect PCI tested by
- Damien Persohn <damien@persohn.net> */
+ Damien Persohn <damien AT persohn.net> */
{0,},
};
Index: working-2.6/drivers/net/wireless/orinoco_tmd.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco_tmd.c
+++ working-2.6/drivers/net/wireless/orinoco_tmd.c
@@ -3,8 +3,8 @@
* Driver for Prism II devices which would usually be driven by orinoco_cs,
* but are connected to the PCI bus by a TMD7160.
*
- * Copyright (C) 2003 Joerg Dorchain <joerg@dorchain.net>
- * based heavily upon orinoco_plx.c Copyright (C) 2001 Daniel Barlow <dan@telent.net>
+ * Copyright (C) 2003 Joerg Dorchain <joerg AT dorchain.net>
+ * based heavily upon orinoco_plx.c Copyright (C) 2001 Daniel Barlow <dan AT telent.net>
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
--
David Gibson | For every complex problem there is a
david AT gibson.dropbear.id.au | solution which is simple, neat and
| wrong.
http://www.ozlabs.org/people/dgibson
^ permalink raw reply [flat|nested] 31+ messages in thread
* [7/15] orinoco merge preliminaries - comment/whitespace/spelling updates
2004-07-28 6:55 ` [6/15] orinoco merge preliminaries - spam stoppers David Gibson
@ 2004-07-28 6:56 ` David Gibson
2004-07-28 6:57 ` [8/15] orinoco merge preliminaries - use BUG_ON() David Gibson
2004-07-28 17:36 ` [6/15] orinoco merge preliminaries - spam stoppers Matt Mackall
1 sibling, 1 reply; 31+ messages in thread
From: David Gibson @ 2004-07-28 6:56 UTC (permalink / raw)
To: Jeff Garzik, Francois Romieu, Linux kernel mailing list, jt,
Dan Williams, Pavel Roskin, Orinoco Development List
Various trivial cleanups to the orinoco driver: whitespace changes,
spelling/capitalization errors corrected, some fairly insignificant
comments added, removed or reformatted.
Signed-off-by: David Gibson <hermes@gibson.dropbear.id.au>
Index: working-2.6/drivers/net/wireless/orinoco.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco.c 2004-07-28 14:57:52.310664496 +1000
+++ working-2.6/drivers/net/wireless/orinoco.c 2004-07-28 14:57:53.046552624 +1000
@@ -59,7 +59,7 @@
* o Add PM timeout (holdover duration)
* o Enable "iwconfig eth0 key off" and friends (toggle flags)
* o Enable "iwconfig eth0 power unicast/all" (toggle flags)
- * o Try with an intel card. It report firmware 1.01, behave like
+ * o Try with an Intel card. It report firmware 1.01, behave like
* an antiquated firmware, however on windows it says 2.00. Yuck !
* o Workaround firmware bug in allocate buffer (Intel 1.01)
* o Finish external renaming to orinoco...
@@ -69,8 +69,8 @@
* o Update to Wireless 11 -> add retry limit/lifetime support
* o Tested with a D-Link DWL 650 card, fill in firmware support
* o Warning on Vcc mismatch (D-Link 3.3v card in Lucent 5v only slot)
- * o Fixed the Prims2 WEP bugs that I introduced in v0.03 :-(
- * It work on D-Link *only* after a tcpdump. Weird...
+ * o Fixed the Prism2 WEP bugs that I introduced in v0.03 :-(
+ * It works on D-Link *only* after a tcpdump. Weird...
* And still doesn't work on Intel card. Grrrr...
* o Update the mode after a setport3
* o Add preamble setting for Symbol cards (not yet enabled)
@@ -106,7 +106,7 @@
* o Remove deferred power enabling code
*
* v0.05c -> v0.05d - 5/5/2001 - Jean II
- * o Workaround to SNAP decapsulate frame from LinkSys AP
+ * o Workaround to SNAP decapsulate frame from Linksys AP
* original patch from : Dong Liu <dliu AT research.bell-labs.com>
* (note : the memcmp bug was mine - fixed)
* o Remove set_retry stuff, no firmware support it (bloat--).
@@ -135,15 +135,15 @@
*
* v0.06c -> v0.06d - 6/7/2001 - David Gibson
* o Change a bunch of KERN_INFO messages to KERN_DEBUG, as per Linus'
- * wishes to reduce the number of unecessary messages.
+ * wishes to reduce the number of unnecessary messages.
* o Removed bogus message on CRC error.
- * o Merged fixeds for v0.08 Prism 2 firmware from William Waghorn
+ * o Merged fixes for v0.08 Prism 2 firmware from William Waghorn
* <willwaghorn AT yahoo.co.uk>
* o Slight cleanup/re-arrangement of firmware detection code.
*
* v0.06d -> v0.06e - 1/8/2001 - David Gibson
* o Removed some redundant global initializers (orinoco_cs.c).
- * o Added some module metadataa
+ * o Added some module metadata
*
* v0.06e -> v0.06f - 14/8/2001 - David Gibson
* o Wording fix to license
@@ -173,7 +173,7 @@
* o Turned has_big_wep on for Intersil cards. That's not true for all of
* them but we should at least let the capable ones try.
* o Wait for BUSY to clear at the beginning of hermes_bap_seek(). I
- * realised that my assumption that the driver's serialization
+ * realized that my assumption that the driver's serialization
* would prevent the BAP being busy on entry was possibly false, because
* things other than seeks may make the BAP busy.
* o Use "alternate" (oui 00:00:00) encapsulation by default.
@@ -182,12 +182,12 @@
* o Don't try to make __initdata const (the version string). This can't
* work because of the way the __initdata sectioning works.
* o Added MODULE_LICENSE tags.
- * o Support for PLX (transparent PCMCIA->PCI brdge) cards.
- * o Changed to using the new type-facist min/max.
+ * o Support for PLX (transparent PCMCIA->PCI bridge) cards.
+ * o Changed to using the new type-fascist min/max.
*
* v0.08 -> v0.08a - 9/10/2001 - David Gibson
* o Inserted some missing acknowledgements/info into the Changelog.
- * o Fixed some bugs in the normalisation of signel level reporting.
+ * o Fixed some bugs in the normalization of signal level reporting.
* o Fixed bad bug in WEP key handling on Intersil and Symbol firmware,
* which led to an instant crash on big-endian machines.
*
@@ -343,7 +343,7 @@
* o Bugfix in orinoco_stop() - it used to fail if hw_unavailable
* was set, which was usually true on PCMCIA hot removes.
* o Track LINKSTATUS messages, silently drop Tx packets before
- * we are connected (avoids cofusing the firmware), and only
+ * we are connected (avoids confusing the firmware), and only
* give LINKSTATUS printk()s if the status has changed.
*
* v0.13b -> v0.13c - 11 Mar 2003 - David Gibson
@@ -398,7 +398,8 @@
* o Disconnect wireless extensions from fundamental configuration.
* o (maybe) Software WEP support (patch from Stano Meduna).
* o (maybe) Use multiple Tx buffers - driver handling queue
- * rather than firmware. */
+ * rather than firmware.
+ */
/* Locking and synchronization:
*
@@ -415,7 +416,8 @@
* flag after taking the lock, and if it is set, give up on whatever
* they are doing and drop the lock again. The orinoco_lock()
* function handles this (it unlocks and returns -EBUSY if
- * hw_unavailable is non-zero). */
+ * hw_unavailable is non-zero).
+ */
#include <linux/config.h>
@@ -495,9 +497,10 @@
HERMES_MAX_MULTICAST : 0)*/
#define MAX_MULTICAST(priv) (HERMES_MAX_MULTICAST)
-#define ORINOCO_INTEN ( HERMES_EV_RX | HERMES_EV_ALLOC | HERMES_EV_TX | \
- HERMES_EV_TXEXC | HERMES_EV_WTERR | HERMES_EV_INFO | \
- HERMES_EV_INFDROP )
+#define ORINOCO_INTEN (HERMES_EV_RX | HERMES_EV_ALLOC \
+ | HERMES_EV_TX | HERMES_EV_TXEXC \
+ | HERMES_EV_WTERR | HERMES_EV_INFO \
+ | HERMES_EV_INFDROP )
/********************************************************************/
/* Data tables */
@@ -510,7 +513,8 @@
};
#define NUM_CHANNELS ARRAY_SIZE(channel_frequency)
-/* This tables gives the actual meanings of the bitrate IDs returned by the firmware. */
+/* This tables gives the actual meanings of the bitrate IDs returned
+ * by the firmware. */
struct {
int bitrate; /* in 100s of kilobits */
int automatic;
@@ -574,8 +578,7 @@
/* Internal helper functions */
/********************************************************************/
-static inline void
-set_port_type(struct orinoco_private *priv)
+static inline void set_port_type(struct orinoco_private *priv)
{
switch (priv->iw_mode) {
case IW_MODE_INFRA:
@@ -640,16 +643,14 @@
return err;
}
-struct net_device_stats *
-orinoco_get_stats(struct net_device *dev)
+struct net_device_stats *orinoco_get_stats(struct net_device *dev)
{
struct orinoco_private *priv = netdev_priv(dev);
return &priv->stats;
}
-struct iw_statistics *
-orinoco_get_wireless_stats(struct net_device *dev)
+struct iw_statistics *orinoco_get_wireless_stats(struct net_device *dev)
{
struct orinoco_private *priv = netdev_priv(dev);
hermes_t *hw = &priv->hw;
@@ -707,8 +708,7 @@
return wstats;
}
-static void
-orinoco_set_multicast_list(struct net_device *dev)
+static void orinoco_set_multicast_list(struct net_device *dev)
{
struct orinoco_private *priv = netdev_priv(dev);
unsigned long flags;
@@ -723,8 +723,7 @@
orinoco_unlock(priv, &flags);
}
-static int
-orinoco_change_mtu(struct net_device *dev, int new_mtu)
+static int orinoco_change_mtu(struct net_device *dev, int new_mtu)
{
struct orinoco_private *priv = netdev_priv(dev);
@@ -744,8 +743,7 @@
/* Tx path */
/********************************************************************/
-static int
-orinoco_xmit(struct sk_buff *skb, struct net_device *dev)
+static int orinoco_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct orinoco_private *priv = netdev_priv(dev);
struct net_device_stats *stats = &priv->stats;
@@ -778,7 +776,6 @@
printk(KERN_ERR "%s: orinoco_xmit() called while hw_unavailable\n",
dev->name);
TRACE_EXIT(dev->name);
-/* BUG(); */
return 1;
}
@@ -846,7 +843,8 @@
}
/* Round up for odd length packets */
- err = hermes_bap_pwrite(hw, USER_BAP, p, ALIGN(data_len, 2), txfid, data_off);
+ err = hermes_bap_pwrite(hw, USER_BAP, p, ALIGN(data_len, 2),
+ txfid, data_off);
if (err) {
printk(KERN_ERR "%s: Error %d writing packet to BAP\n",
dev->name, err);
@@ -857,10 +855,12 @@
/* Finally, we actually initiate the send */
netif_stop_queue(dev);
- err = hermes_docmd_wait(hw, HERMES_CMD_TX | HERMES_CMD_RECL, txfid, NULL);
+ err = hermes_docmd_wait(hw, HERMES_CMD_TX | HERMES_CMD_RECL,
+ txfid, NULL);
if (err) {
netif_start_queue(dev);
- printk(KERN_ERR "%s: Error %d transmitting packet\n", dev->name, err);
+ printk(KERN_ERR "%s: Error %d transmitting packet\n",
+ dev->name, err);
stats->tx_errors++;
goto fail;
}
@@ -885,7 +885,6 @@
static void __orinoco_ev_alloc(struct net_device *dev, hermes_t *hw)
{
struct orinoco_private *priv = netdev_priv(dev);
-
u16 fid = hermes_read_regn(hw, ALLOCFID);
if (fid != priv->txfid) {
@@ -936,8 +935,7 @@
hermes_write_regn(hw, TXCOMPLFID, DUMMY_FID);
}
-static void
-orinoco_tx_timeout(struct net_device *dev)
+static void orinoco_tx_timeout(struct net_device *dev)
{
struct orinoco_private *priv = netdev_priv(dev);
struct net_device_stats *stats = &priv->stats;
@@ -959,8 +957,7 @@
/* Does the frame have a SNAP header indicating it should be
* de-encapsulated to Ethernet-II? */
-static inline int
-is_ethersnap(struct header_struct *hdr)
+static inline int is_ethersnap(struct header_struct *hdr)
{
/* We de-encapsulate all packets which, a) have SNAP headers
* (i.e. SSAP=DSAP=0xaa and CTRL=0x3 in the 802.2 LLC header
@@ -972,7 +969,7 @@
}
static inline void orinoco_spy_gather(struct net_device *dev, u_char *mac,
- int level, int noise)
+ int level, int noise)
{
struct orinoco_private *priv = netdev_priv(dev);
int i;
@@ -988,10 +985,9 @@
}
}
-void
-orinoco_stat_gather(struct net_device *dev,
- struct sk_buff *skb,
- struct hermes_rx_descriptor *desc)
+void orinoco_stat_gather(struct net_device *dev,
+ struct sk_buff *skb,
+ struct hermes_rx_descriptor *desc)
{
struct orinoco_private *priv = netdev_priv(dev);
@@ -1037,7 +1033,7 @@
}
status = le16_to_cpu(desc.status);
-
+
if (status & HERMES_RXSTAT_ERR) {
if (status & HERMES_RXSTAT_UNDECRYPTABLE) {
wstats->discard.code++;
@@ -1100,9 +1096,9 @@
* For some reason, the SNAP frames sent by LinkSys APs
* are not properly recognised by most firmwares.
* So, check ourselves */
- if(((status & HERMES_RXSTAT_MSGTYPE) == HERMES_RXSTAT_1042) ||
- ((status & HERMES_RXSTAT_MSGTYPE) == HERMES_RXSTAT_TUNNEL) ||
- is_ethersnap(&hdr)) {
+ if (((status & HERMES_RXSTAT_MSGTYPE) == HERMES_RXSTAT_1042) ||
+ ((status & HERMES_RXSTAT_MSGTYPE) == HERMES_RXSTAT_TUNNEL) ||
+ is_ethersnap(&hdr)) {
/* These indicate a SNAP within 802.2 LLC within
802.11 frame which we'll need to de-encapsulate to
the original EthernetII frame. */
@@ -1268,7 +1264,7 @@
case HERMES_INQ_LINKSTATUS: {
struct hermes_linkstatus linkstatus;
u16 newstatus;
-
+
if (len != sizeof(linkstatus)) {
printk(KERN_WARNING "%s: Unexpected size for linkstatus frame (%d bytes)\n",
dev->name, len);
@@ -1296,8 +1292,8 @@
}
break;
default:
- printk(KERN_DEBUG "%s: Unknown information frame received (type %04x).\n",
- dev->name, type);
+ printk(KERN_DEBUG "%s: Unknown information frame received "
+ "(type %04x).\n", dev->name, type);
/* We don't actually do anything about it */
break;
}
@@ -1487,7 +1483,8 @@
}
/* Write the index of the key used in transmission */
- err = hermes_write_wordrec(hw, USER_BAP, HERMES_RID_CNFWEPDEFAULTKEYID,
+ err = hermes_write_wordrec(hw, USER_BAP,
+ HERMES_RID_CNFWEPDEFAULTKEYID,
priv->tx_key);
if (err)
return err;
@@ -1507,11 +1504,12 @@
err = hermes_write_wordrec(hw, USER_BAP,
- HERMES_RID_CNFAUTHENTICATION, auth_flag);
+ HERMES_RID_CNFAUTHENTICATION,
+ auth_flag);
if (err)
return err;
}
-
+
/* Master WEP setting : on/off */
err = hermes_write_wordrec(hw, USER_BAP,
HERMES_RID_CNFWEPFLAGS_INTERSIL,
@@ -1543,14 +1541,17 @@
err = hermes_write_ltv(hw, USER_BAP, HERMES_RID_CNFOWNMACADDR,
HERMES_BYTES_TO_RECLEN(ETH_ALEN), dev->dev_addr);
if (err) {
- printk(KERN_ERR "%s: Error %d setting MAC address\n", dev->name, err);
+ printk(KERN_ERR "%s: Error %d setting MAC address\n",
+ dev->name, err);
return err;
}
/* Set up the link mode */
- err = hermes_write_wordrec(hw, USER_BAP, HERMES_RID_CNFPORTTYPE, priv->port_type);
+ err = hermes_write_wordrec(hw, USER_BAP, HERMES_RID_CNFPORTTYPE,
+ priv->port_type);
if (err) {
- printk(KERN_ERR "%s: Error %d setting port type\n", dev->name, err);
+ printk(KERN_ERR "%s: Error %d setting port type\n",
+ dev->name, err);
return err;
}
/* Set the channel/frequency */
@@ -1559,14 +1560,17 @@
if (priv->createibss)
priv->channel = 10;
}
- err = hermes_write_wordrec(hw, USER_BAP, HERMES_RID_CNFOWNCHANNEL, priv->channel);
+ err = hermes_write_wordrec(hw, USER_BAP, HERMES_RID_CNFOWNCHANNEL,
+ priv->channel);
if (err) {
- printk(KERN_ERR "%s: Error %d setting channel\n", dev->name, err);
+ printk(KERN_ERR "%s: Error %d setting channel\n",
+ dev->name, err);
return err;
}
if (priv->has_ibss) {
- err = hermes_write_wordrec(hw, USER_BAP, HERMES_RID_CNFCREATEIBSS,
+ err = hermes_write_wordrec(hw, USER_BAP,
+ HERMES_RID_CNFCREATEIBSS,
priv->createibss);
if (err) {
printk(KERN_ERR "%s: Error %d setting CREATEIBSS\n", dev->name, err);
@@ -1575,8 +1579,8 @@
if ((strlen(priv->desired_essid) == 0) && (priv->createibss)
&& (!priv->has_ibss_any)) {
- printk(KERN_WARNING "%s: This firmware requires an \
-ESSID in IBSS-Ad-Hoc mode.\n", dev->name);
+ printk(KERN_WARNING "%s: This firmware requires an "
+ "ESSID in IBSS-Ad-Hoc mode.\n", dev->name);
/* With wvlan_cs, in this case, we would crash.
* hopefully, this driver will behave better...
* Jean II */
@@ -1591,14 +1595,16 @@
HERMES_BYTES_TO_RECLEN(strlen(priv->desired_essid)+2),
&idbuf);
if (err) {
- printk(KERN_ERR "%s: Error %d setting OWNSSID\n", dev->name, err);
+ printk(KERN_ERR "%s: Error %d setting OWNSSID\n",
+ dev->name, err);
return err;
}
err = hermes_write_ltv(hw, USER_BAP, HERMES_RID_CNFDESIREDSSID,
HERMES_BYTES_TO_RECLEN(strlen(priv->desired_essid)+2),
&idbuf);
if (err) {
- printk(KERN_ERR "%s: Error %d setting DESIREDSSID\n", dev->name, err);
+ printk(KERN_ERR "%s: Error %d setting DESIREDSSID\n",
+ dev->name, err);
return err;
}
@@ -1609,26 +1615,31 @@
HERMES_BYTES_TO_RECLEN(strlen(priv->nick)+2),
&idbuf);
if (err) {
- printk(KERN_ERR "%s: Error %d setting nickname\n", dev->name, err);
+ printk(KERN_ERR "%s: Error %d setting nickname\n",
+ dev->name, err);
return err;
}
/* Set AP density */
if (priv->has_sensitivity) {
- err = hermes_write_wordrec(hw, USER_BAP, HERMES_RID_CNFSYSTEMSCALE,
+ err = hermes_write_wordrec(hw, USER_BAP,
+ HERMES_RID_CNFSYSTEMSCALE,
priv->ap_density);
if (err) {
printk(KERN_WARNING "%s: Error %d setting SYSTEMSCALE. "
- "Disabling sensitivity control\n", dev->name, err);
+ "Disabling sensitivity control\n",
+ dev->name, err);
priv->has_sensitivity = 0;
}
}
/* Set RTS threshold */
- err = hermes_write_wordrec(hw, USER_BAP, HERMES_RID_CNFRTSTHRESHOLD, priv->rts_thresh);
+ err = hermes_write_wordrec(hw, USER_BAP, HERMES_RID_CNFRTSTHRESHOLD,
+ priv->rts_thresh);
if (err) {
- printk(KERN_ERR "%s: Error %d setting RTS threshold\n", dev->name, err);
+ printk(KERN_ERR "%s: Error %d setting RTS threshold\n",
+ dev->name, err);
return err;
}
@@ -1642,20 +1653,23 @@
HERMES_RID_CNFFRAGMENTATIONTHRESHOLD,
priv->frag_thresh);
if (err) {
- printk(KERN_ERR "%s: Error %d setting framentation\n", dev->name, err);
+ printk(KERN_ERR "%s: Error %d setting fragmentation\n",
+ dev->name, err);
return err;
}
/* Set bitrate */
err = __orinoco_hw_set_bitrate(priv);
if (err) {
- printk(KERN_ERR "%s: Error %d setting bitrate\n", dev->name, err);
+ printk(KERN_ERR "%s: Error %d setting bitrate\n",
+ dev->name, err);
return err;
}
/* Set power management */
if (priv->has_pm) {
- err = hermes_write_wordrec(hw, USER_BAP, HERMES_RID_CNFPMENABLED,
+ err = hermes_write_wordrec(hw, USER_BAP,
+ HERMES_RID_CNFPMENABLED,
priv->pm_on);
if (err) {
printk(KERN_ERR "%s: Error %d setting up PM\n",
@@ -1851,7 +1865,7 @@
if (err)
/* When the hardware becomes available again, whatever
* detects that is responsible for re-initializing
- * it. So no need for anything further*/
+ * it. So no need for anything further */
return;
netif_stop_queue(dev);
@@ -1870,8 +1884,8 @@
if (priv->hard_reset)
err = (*priv->hard_reset)(priv);
if (err) {
- printk(KERN_ERR "%s: orinoco_reset: Error %d performing hard reset\n",
- dev->name, err);
+ printk(KERN_ERR "%s: orinoco_reset: Error %d "
+ "performing hard reset\n", dev->name, err);
/* FIXME: shutdown of some sort */
return;
}
@@ -1930,7 +1944,8 @@
/* These are used to detect a runaway interrupt situation */
/* If we get more than MAX_IRQLOOPS_PER_JIFFY iterations in a jiffy,
* we panic and shut down the hardware */
- static int last_irq_jiffy = 0; /* jiffies value the last time we were called */
+ static int last_irq_jiffy = 0; /* jiffies value the last time
+ * we were called */
static int loops_this_jiffy = 0;
unsigned long flags;
@@ -2032,11 +2047,11 @@
dev->name, err);
memset(&sta_id, 0, sizeof(sta_id));
}
+
le16_to_cpus(&sta_id.id);
le16_to_cpus(&sta_id.variant);
le16_to_cpus(&sta_id.major);
le16_to_cpus(&sta_id.minor);
-
printk(KERN_DEBUG "%s: Station identity %04x:%04x:%04x:%04x\n",
dev->name, sta_id.id, sta_id.variant,
sta_id.major, sta_id.minor);
@@ -2149,8 +2164,7 @@
}
}
-static int
-orinoco_init(struct net_device *dev)
+static int orinoco_init(struct net_device *dev)
{
struct orinoco_private *priv = netdev_priv(dev);
hermes_t *hw = &priv->hw;
@@ -2239,7 +2253,8 @@
err = hermes_read_wordrec(hw, USER_BAP, HERMES_RID_CNFRTSTHRESHOLD,
&priv->rts_thresh);
if (err) {
- printk(KERN_ERR "%s: failed to read RTS threshold!\n", dev->name);
+ printk(KERN_ERR "%s: failed to read RTS threshold!\n",
+ dev->name);
goto out;
}
@@ -2252,7 +2267,8 @@
err = hermes_read_wordrec(hw, USER_BAP, HERMES_RID_CNFFRAGMENTATIONTHRESHOLD,
&priv->frag_thresh);
if (err) {
- printk(KERN_ERR "%s: failed to read fragmentation settings!\n", dev->name);
+ printk(KERN_ERR "%s: failed to read fragmentation settings!\n",
+ dev->name);
goto out;
}
@@ -2280,7 +2296,8 @@
/* Preamble setup */
if (priv->has_preamble) {
- err = hermes_read_wordrec(hw, USER_BAP, HERMES_RID_CNFPREAMBLE_SYMBOL,
+ err = hermes_read_wordrec(hw, USER_BAP,
+ HERMES_RID_CNFPREAMBLE_SYMBOL,
&priv->preamble);
if (err)
goto out;
@@ -2329,18 +2346,20 @@
return err;
}
-struct net_device *alloc_orinocodev(int sizeof_card, int (*hard_reset)(struct orinoco_private *))
+struct net_device *alloc_orinocodev(int sizeof_card,
+ int (*hard_reset)(struct orinoco_private *))
{
struct net_device *dev;
struct orinoco_private *priv;
dev = alloc_etherdev(sizeof(struct orinoco_private) + sizeof_card);
- if (!dev)
+ if (! dev)
return NULL;
priv = netdev_priv(dev);
priv->ndev = dev;
if (sizeof_card)
- priv->card = (void *)((unsigned long)netdev_priv(dev) + sizeof(struct orinoco_private));
+ priv->card = (void *)((unsigned long)netdev_priv(dev)
+ + sizeof(struct orinoco_private));
else
priv->card = NULL;
@@ -2700,7 +2719,8 @@
if ((index < 0) || (index >= ORINOCO_MAX_KEYS))
index = priv->tx_key;
-
+
+ /* Adjust key length to a supported value */
if (erq->length > SMALL_KEY_SIZE) {
xlen = LARGE_KEY_SIZE;
} else if (erq->length > 0) {
@@ -2742,14 +2762,14 @@
if (erq->pointer) {
priv->keys[index].len = cpu_to_le16(xlen);
- memset(priv->keys[index].data, 0, sizeof(priv->keys[index].data));
+ memset(priv->keys[index].data, 0,
+ sizeof(priv->keys[index].data));
memcpy(priv->keys[index].data, keybuf, erq->length);
}
priv->tx_key = setindex;
priv->wep_on = enable;
priv->wep_restrict = restricted;
-
out:
orinoco_unlock(priv, &flags);
@@ -2975,7 +2995,8 @@
err = orinoco_lock(priv, &flags);
if (err)
return err;
- err = hermes_read_wordrec(hw, USER_BAP, HERMES_RID_CNFSYSTEMSCALE, &val);
+ err = hermes_read_wordrec(hw, USER_BAP,
+ HERMES_RID_CNFSYSTEMSCALE, &val);
orinoco_unlock(priv, &flags);
if (err)
@@ -3461,7 +3482,6 @@
*val = priv->prefer_port3;
orinoco_unlock(priv, &flags);
-
return 0;
}
Index: working-2.6/drivers/net/wireless/orinoco_pci.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco_pci.c 2004-07-28 14:57:52.312664192 +1000
+++ working-2.6/drivers/net/wireless/orinoco_pci.c 2004-07-28 14:57:53.048552320 +1000
@@ -206,18 +206,17 @@
if (! pci_iorange)
goto fail;
- /* Usual setup of structures */
+ /* Allocate network device */
dev = alloc_orinocodev(0, NULL);
if (! dev) {
err = -ENOMEM;
goto fail;
}
- priv = netdev_priv(dev);
+ priv = netdev_priv(dev);
dev->base_addr = (unsigned long) pci_ioaddr;
dev->mem_start = pci_iorange;
dev->mem_end = pci_iorange + pci_iolen - 1;
-
SET_MODULE_OWNER(dev);
SET_NETDEV_DEV(dev, &pdev->dev);
@@ -238,6 +237,7 @@
goto fail;
}
dev->irq = pdev->irq;
+
/* Perform a COR reset to start the card */
if(orinoco_pci_cor_reset(priv) != 0) {
printk(KERN_ERR "%s: Failed to start the card\n", dev->name);
@@ -255,7 +255,8 @@
goto fail;
}
- return 0; /* succeeded */
+ return 0;
+
fail:
if (dev) {
if (dev->irq)
@@ -279,7 +280,7 @@
unregister_netdev(dev);
- if (dev->irq)
+ if (dev->irq)
free_irq(dev->irq, dev);
if (priv->hw.iobase)
@@ -357,7 +358,9 @@
}
static struct pci_device_id orinoco_pci_pci_id_table[] = {
+ /* Intersil Prism 3 */
{0x1260, 0x3872, PCI_ANY_ID, PCI_ANY_ID,},
+ /* Intersil Prism 2.5 */
{0x1260, 0x3873, PCI_ANY_ID, PCI_ANY_ID,},
{0,},
};
Index: working-2.6/drivers/net/wireless/orinoco.h
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco.h 2004-07-28 14:56:33.743608504 +1000
+++ working-2.6/drivers/net/wireless/orinoco.h 2004-07-28 14:57:53.049552168 +1000
@@ -12,6 +12,7 @@
#include <linux/netdevice.h>
#include <linux/wireless.h>
#include <linux/version.h>
+
#include "hermes.h"
/* To enable debug messages */
@@ -50,7 +51,6 @@
hermes_t hw;
u16 txfid;
-
/* Capabilities of the hardware/firmware */
int firmware_type;
#define FIRMWARE_TYPE_AGERE 1
@@ -100,6 +100,10 @@
#define TRACE_ENTER(devname) DEBUG(2, "%s: -> %s()\n", devname, __FUNCTION__);
#define TRACE_EXIT(devname) DEBUG(2, "%s: <- %s()\n", devname, __FUNCTION__);
+/********************************************************************/
+/* Exported prototypes */
+/********************************************************************/
+
extern struct net_device *alloc_orinocodev(int sizeof_card,
int (*hard_reset)(struct orinoco_private *));
extern int __orinoco_up(struct net_device *dev);
Index: working-2.6/drivers/net/wireless/orinoco_tmd.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco_tmd.c 2004-07-28 14:57:52.314663888 +1000
+++ working-2.6/drivers/net/wireless/orinoco_tmd.c 2004-07-28 14:57:53.051551864 +1000
@@ -78,8 +78,7 @@
static char dev_info[] = "orinoco_tmd";
-#define COR_VALUE (COR_LEVEL_REQ | COR_FUNC_ENA | COR_FUNC_ENA) /* Enable PC card with level triggered irqs and irq requests */
-
+#define COR_VALUE (COR_LEVEL_REQ | COR_FUNC_ENA | COR_FUNC_ENA) /* Enable PC card with interrupt in level trigger */
static int orinoco_tmd_init_one(struct pci_dev *pdev,
const struct pci_device_id *ent)
@@ -115,6 +114,7 @@
goto fail;
}
+ /* Allocate network device */
dev = alloc_orinocodev(0, NULL);
if (! dev) {
err = -ENOMEM;
@@ -126,16 +126,16 @@
SET_MODULE_OWNER(dev);
SET_NETDEV_DEV(dev, &pdev->dev);
- printk(KERN_DEBUG
- "Detected Orinoco/Prism2 TMD device at %s irq:%d, io addr:0x%lx\n",
- pci_name(pdev), pdev->irq, pccard_ioaddr);
+ printk(KERN_DEBUG "Detected Orinoco/Prism2 TMD device "
+ "at %s irq:%d, io addr:0x%lx\n", pci_name(pdev), pdev->irq,
+ pccard_ioaddr);
hermes_struct_init(&(priv->hw), dev->base_addr,
HERMES_IO, HERMES_16BIT_REGSPACING);
pci_set_drvdata(pdev, dev);
- err = request_irq(pdev->irq, orinoco_interrupt, SA_SHIRQ, dev->name,
- dev);
+ err = request_irq(pdev->irq, orinoco_interrupt, SA_SHIRQ,
+ dev->name, dev);
if (err) {
printk(KERN_ERR "orinoco_tmd: Error allocating IRQ %d.\n",
pdev->irq);
@@ -148,9 +148,9 @@
if (err)
goto fail;
- return 0; /* succeeded */
+ return 0;
- fail:
+ fail:
printk(KERN_DEBUG "orinoco_tmd: init_one(), FAIL!\n");
if (dev) {
Index: working-2.6/drivers/net/wireless/orinoco_plx.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco_plx.c 2004-07-28 14:57:52.313664040 +1000
+++ working-2.6/drivers/net/wireless/orinoco_plx.c 2004-07-28 14:57:53.054551408 +1000
@@ -1,7 +1,7 @@
/* orinoco_plx.c 0.13e
*
* Driver for Prism II devices which would usually be driven by orinoco_cs,
- * but are connected to the PCI bus by a PLX9052.
+ * but are connected to the PCI bus by a PLX9052.
*
* Copyright (C) 2001 Daniel Barlow <dan AT telent.net>
*
@@ -33,77 +33,80 @@
* drop me mail with the id and "it works"/"it doesn't work".
*
* Note: if everything gets detected fine but it doesn't actually send
- * or receive packets, your first port of call should probably be to
+ * or receive packets, your first port of call should probably be to
* try newer firmware in the card. Especially if you're doing Ad-Hoc
- * modes
+ * modes.
*
* The actual driving is done by orinoco.c, this is just resource
* allocation stuff. The explanation below is courtesy of Ryan Niemi
* on the linux-wlan-ng list at
* http://archives.neohapsis.com/archives/dev/linux-wlan/2001-q1/0026.html
-
-The PLX9052-based cards (WL11000 and several others) are a different
-beast than the usual PCMCIA-based PRISM2 configuration expected by
-wlan-ng. Here's the general details on how the WL11000 PCI adapter
-works:
-
- - Two PCI I/O address spaces, one 0x80 long which contains the PLX9052
- registers, and one that's 0x40 long mapped to the PCMCIA slot I/O
- address space.
-
- - One PCI memory address space, mapped to the PCMCIA memory space
- (containing the CIS).
-
-After identifying the I/O and memory space, you can read through the
-memory space to confirm the CIS's device ID or manufacturer ID to make
-sure it's the expected card. Keep in mind that the PCMCIA spec specifies
-the CIS as the lower 8 bits of each word read from the CIS, so to read the
-bytes of the CIS, read every other byte (0,2,4,...). Passing that test,
-you need to enable the I/O address space on the PCMCIA card via the PCMCIA
-COR register. This is the first byte following the CIS. In my case
-(which may not have any relation to what's on the PRISM2 cards), COR was
-at offset 0x800 within the PCI memory space. Write 0x41 to the COR
-register to enable I/O mode and to select level triggered interrupts. To
-confirm you actually succeeded, read the COR register back and make sure
-it actually got set to 0x41, incase you have an unexpected card inserted.
-
-Following that, you can treat the second PCI I/O address space (the one
-that's not 0x80 in length) as the PCMCIA I/O space.
-
-Note that in the Eumitcom's source for their drivers, they register the
-interrupt as edge triggered when registering it with the Windows kernel. I
-don't recall how to register edge triggered on Linux (if it can be done at
-all). But in some experimentation, I don't see much operational
-difference between using either interrupt mode. Don't mess with the
-interrupt mode in the COR register though, as the PLX9052 wants level
-triggers with the way the serial EEPROM configures it on the WL11000.
-
-There's some other little quirks related to timing that I bumped into, but
-I don't recall right now. Also, there's two variants of the WL11000 I've
-seen, revision A1 and T2. These seem to differ slightly in the timings
-configured in the wait-state generator in the PLX9052. There have also
-been some comments from Eumitcom that cards shouldn't be hot swapped,
-apparently due to risk of cooking the PLX9052. I'm unsure why they
-believe this, as I can't see anything in the design that would really
-cause a problem, except for crashing drivers not written to expect it. And
-having developed drivers for the WL11000, I'd say it's quite tricky to
-write code that will successfully deal with a hot unplug. Very odd things
-happen on the I/O side of things. But anyway, be warned. Despite that,
-I've hot-swapped a number of times during debugging and driver development
-for various reasons (stuck WAIT# line after the radio card's firmware
-locks up).
-
-Hope this is enough info for someone to add PLX9052 support to the wlan-ng
-card. In the case of the WL11000, the PCI ID's are 0x1639/0x0200, with
-matching subsystem ID's. Other PLX9052-based manufacturers other than
-Eumitcom (or on cards other than the WL11000) may have different PCI ID's.
-
-If anyone needs any more specific info, let me know. I haven't had time
-to implement support myself yet, and with the way things are going, might
-not have time for a while..
-
----end of mail---
-*/
+ *
+ * The PLX9052-based cards (WL11000 and several others) are a
+ * different beast than the usual PCMCIA-based PRISM2 configuration
+ * expected by wlan-ng. Here's the general details on how the WL11000
+ * PCI adapter works:
+ *
+ * - Two PCI I/O address spaces, one 0x80 long which contains the
+ * PLX9052 registers, and one that's 0x40 long mapped to the PCMCIA
+ * slot I/O address space.
+ *
+ * - One PCI memory address space, mapped to the PCMCIA memory space
+ * (containing the CIS).
+ *
+ * After identifying the I/O and memory space, you can read through
+ * the memory space to confirm the CIS's device ID or manufacturer ID
+ * to make sure it's the expected card. qKeep in mind that the PCMCIA
+ * spec specifies the CIS as the lower 8 bits of each word read from
+ * the CIS, so to read the bytes of the CIS, read every other byte
+ * (0,2,4,...). Passing that test, you need to enable the I/O address
+ * space on the PCMCIA card via the PCMCIA COR register. This is the
+ * first byte following the CIS. In my case (which may not have any
+ * relation to what's on the PRISM2 cards), COR was at offset 0x800
+ * within the PCI memory space. Write 0x41 to the COR register to
+ * enable I/O mode and to select level triggered interrupts. To
+ * confirm you actually succeeded, read the COR register back and make
+ * sure it actually got set to 0x41, incase you have an unexpected
+ * card inserted.
+ *
+ * Following that, you can treat the second PCI I/O address space (the
+ * one that's not 0x80 in length) as the PCMCIA I/O space.
+ *
+ * Note that in the Eumitcom's source for their drivers, they register
+ * the interrupt as edge triggered when registering it with the
+ * Windows kernel. I don't recall how to register edge triggered on
+ * Linux (if it can be done at all). But in some experimentation, I
+ * don't see much operational difference between using either
+ * interrupt mode. Don't mess with the interrupt mode in the COR
+ * register though, as the PLX9052 wants level triggers with the way
+ * the serial EEPROM configures it on the WL11000.
+ *
+ * There's some other little quirks related to timing that I bumped
+ * into, but I don't recall right now. Also, there's two variants of
+ * the WL11000 I've seen, revision A1 and T2. These seem to differ
+ * slightly in the timings configured in the wait-state generator in
+ * the PLX9052. There have also been some comments from Eumitcom that
+ * cards shouldn't be hot swapped, apparently due to risk of cooking
+ * the PLX9052. I'm unsure why they believe this, as I can't see
+ * anything in the design that would really cause a problem, except
+ * for crashing drivers not written to expect it. And having developed
+ * drivers for the WL11000, I'd say it's quite tricky to write code
+ * that will successfully deal with a hot unplug. Very odd things
+ * happen on the I/O side of things. But anyway, be warned. Despite
+ * that, I've hot-swapped a number of times during debugging and
+ * driver development for various reasons (stuck WAIT# line after the
+ * radio card's firmware locks up).
+ *
+ * Hope this is enough info for someone to add PLX9052 support to the
+ * wlan-ng card. In the case of the WL11000, the PCI ID's are
+ * 0x1639/0x0200, with matching subsystem ID's. Other PLX9052-based
+ * manufacturers other than Eumitcom (or on cards other than the
+ * WL11000) may have different PCI ID's.
+ *
+ * If anyone needs any more specific info, let me know. I haven't had
+ * time to implement support myself yet, and with the way things are
+ * going, might not have time for a while..
+ */
#include <linux/config.h>
@@ -134,11 +137,11 @@
static char dev_info[] = "orinoco_plx";
-#define COR_OFFSET (0x3e0 / 2) /* COR attribute offset of Prism2 PC card */
-#define COR_VALUE (COR_LEVEL_REQ | COR_FUNC_ENA) /* Enable PC card with interrupt in level trigger */
+#define COR_OFFSET (0x3e0/2) /* COR attribute offset of Prism2 PC card */
+#define COR_VALUE (COR_LEVEL_REQ | COR_FUNC_ENA) /* Enable PC card with interrupt in level trigger */
-#define PLX_INTCSR 0x4c /* Interrupt Control and Status Register */
-#define PLX_INTCSR_INTEN (1<<6) /* Interrupt Enable bit */
+#define PLX_INTCSR 0x4c /* Interrupt Control & Status Register */
+#define PLX_INTCSR_INTEN (1<<6) /* Interrupt Enable bit */
static const u16 cis_magic[] = {
0x0001, 0x0003, 0x0000, 0x0000, 0x00ff, 0x0017, 0x0004, 0x0067
@@ -223,6 +226,7 @@
goto fail;
}
+ /* Allocate network device */
dev = alloc_orinocodev(0, NULL);
if (! dev) {
err = -ENOMEM;
@@ -234,15 +238,16 @@
SET_MODULE_OWNER(dev);
SET_NETDEV_DEV(dev, &pdev->dev);
- printk(KERN_DEBUG
- "Detected Orinoco/Prism2 PLX device at %s irq:%d, io addr:0x%lx\n",
- pci_name(pdev), pdev->irq, pccard_ioaddr);
+ printk(KERN_DEBUG "Detected Orinoco/Prism2 PLX device "
+ "at %s irq:%d, io addr:0x%lx\n", pci_name(pdev), pdev->irq,
+ pccard_ioaddr);
- hermes_struct_init(&(priv->hw), dev->base_addr,
- HERMES_IO, HERMES_16BIT_REGSPACING);
+ hermes_struct_init(&(priv->hw), dev->base_addr, HERMES_IO,
+ HERMES_16BIT_REGSPACING);
pci_set_drvdata(pdev, dev);
- err = request_irq(pdev->irq, orinoco_interrupt, SA_SHIRQ, dev->name, dev);
+ err = request_irq(pdev->irq, orinoco_interrupt, SA_SHIRQ,
+ dev->name, dev);
if (err) {
printk(KERN_ERR "orinoco_plx: Error allocating IRQ %d.\n", pdev->irq);
err = -EBUSY;
@@ -254,9 +259,9 @@
if (err)
goto fail;
- return 0; /* succeeded */
+ return 0;
- fail:
+ fail:
printk(KERN_DEBUG "orinoco_plx: init_one(), FAIL!\n");
if (dev) {
@@ -305,7 +310,7 @@
{0x15e8, 0x0130, PCI_ANY_ID, PCI_ANY_ID,}, /* Correga - does this work? */
{0x1638, 0x1100, PCI_ANY_ID, PCI_ANY_ID,}, /* SMC EZConnect SMC2602W,
Eumitcom PCI WL11000,
- Addtron AWA-100*/
+ Addtron AWA-100 */
{0x16ab, 0x1100, PCI_ANY_ID, PCI_ANY_ID,}, /* Global Sun Tech GL24110P */
{0x16ab, 0x1101, PCI_ANY_ID, PCI_ANY_ID,}, /* Reported working, but unknown */
{0x16ab, 0x1102, PCI_ANY_ID, PCI_ANY_ID,}, /* Linksys WDT11 */
Index: working-2.6/drivers/net/wireless/hermes.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/hermes.c 2004-07-28 14:56:32.927732536 +1000
+++ working-2.6/drivers/net/wireless/hermes.c 2004-07-28 14:57:53.055551256 +1000
@@ -390,7 +390,6 @@
return -EIO;
}
-
return 0;
}
Index: working-2.6/drivers/net/wireless/orinoco_cs.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco_cs.c 2004-07-28 14:57:49.305121408 +1000
+++ working-2.6/drivers/net/wireless/orinoco_cs.c 2004-07-28 14:57:53.058550800 +1000
@@ -219,8 +219,7 @@
* are freed. Otherwise, the structures will be freed when the device
* is released.
*/
-static void
-orinoco_cs_detach(dev_link_t * link)
+static void orinoco_cs_detach(dev_link_t *link)
{
dev_link_t **linkp;
struct net_device *dev = link->priv;
@@ -258,8 +257,9 @@
* device available to the system.
*/
-#define CS_CHECK(fn, ret) \
-do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
+#define CS_CHECK(fn, ret) do { \
+ last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; \
+ } while (0)
static void
orinoco_cs_config(dev_link_t *link)
@@ -297,7 +297,8 @@
link->state |= DEV_CONFIG;
/* Look up the current Vcc */
- CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(handle, &conf));
+ CS_CHECK(GetConfigurationInfo,
+ pcmcia_get_configuration_info(handle, &conf));
link->conf.Vcc = conf.Vcc;
/*
@@ -401,8 +402,9 @@
pcmcia_release_io(link->handle, &link->io);
last_ret = pcmcia_get_next_tuple(handle, &tuple);
if (last_ret == CS_NO_MORE_ITEMS) {
- printk(KERN_ERR "GetNextTuple(). No matching CIS configuration, "
- "maybe you need the ignore_cis_vcc=1 parameter.\n");
+ printk(KERN_ERR "GetNextTuple(). No matching "
+ "CIS configuration, maybe you need the "
+ "ignore_cis_vcc=1 parameter.\n");
goto cs_failed;
}
}
@@ -440,7 +442,8 @@
* the I/O windows and the interrupt mapping, and putting the
* card and host interface into "Memory and IO" mode.
*/
- CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf));
+ CS_CHECK(RequestConfiguration,
+ pcmcia_request_configuration(link->handle, &link->conf));
/* Ok, we have the configuration, prepare to register the netdev */
dev->base_addr = link->io.BasePort1;
@@ -659,4 +662,3 @@
module_init(init_orinoco_cs);
module_exit(exit_orinoco_cs);
-
Index: working-2.6/drivers/net/wireless/hermes_rid.h
===================================================================
--- working-2.6.orig/drivers/net/wireless/hermes_rid.h 2004-07-28 14:56:33.745608200 +1000
+++ working-2.6/drivers/net/wireless/hermes_rid.h 2004-07-28 14:57:53.060550496 +1000
@@ -4,21 +4,21 @@
/*
* Configuration RIDs
*/
-#define HERMES_RID_CNFPORTTYPE 0xFC00 /* used */
-#define HERMES_RID_CNFOWNMACADDR 0xFC01 /* used */
-#define HERMES_RID_CNFDESIREDSSID 0xFC02 /* used */
-#define HERMES_RID_CNFOWNCHANNEL 0xFC03 /* used */
-#define HERMES_RID_CNFOWNSSID 0xFC04 /* used */
+#define HERMES_RID_CNFPORTTYPE 0xFC00
+#define HERMES_RID_CNFOWNMACADDR 0xFC01
+#define HERMES_RID_CNFDESIREDSSID 0xFC02
+#define HERMES_RID_CNFOWNCHANNEL 0xFC03
+#define HERMES_RID_CNFOWNSSID 0xFC04
#define HERMES_RID_CNFOWNATIMWINDOW 0xFC05
-#define HERMES_RID_CNFSYSTEMSCALE 0xFC06 /* used */
+#define HERMES_RID_CNFSYSTEMSCALE 0xFC06
#define HERMES_RID_CNFMAXDATALEN 0xFC07
#define HERMES_RID_CNFWDSADDRESS 0xFC08
-#define HERMES_RID_CNFPMENABLED 0xFC09 /* used */
+#define HERMES_RID_CNFPMENABLED 0xFC09
#define HERMES_RID_CNFPMEPS 0xFC0A
-#define HERMES_RID_CNFMULTICASTRECEIVE 0xFC0B /* used */
-#define HERMES_RID_CNFMAXSLEEPDURATION 0xFC0C /* used */
-#define HERMES_RID_CNFPMHOLDOVERDURATION 0xFC0D /* used */
-#define HERMES_RID_CNFOWNNAME 0xFC0E /* used */
+#define HERMES_RID_CNFMULTICASTRECEIVE 0xFC0B
+#define HERMES_RID_CNFMAXSLEEPDURATION 0xFC0C
+#define HERMES_RID_CNFPMHOLDOVERDURATION 0xFC0D
+#define HERMES_RID_CNFOWNNAME 0xFC0E
#define HERMES_RID_CNFOWNDTIMPERIOD 0xFC10
#define HERMES_RID_CNFWDSADDRESS1 0xFC11
#define HERMES_RID_CNFWDSADDRESS2 0xFC12
@@ -27,17 +27,17 @@
#define HERMES_RID_CNFWDSADDRESS5 0xFC15
#define HERMES_RID_CNFWDSADDRESS6 0xFC16
#define HERMES_RID_CNFMULTICASTPMBUFFERING 0xFC17
-#define HERMES_RID_CNFWEPENABLED_AGERE 0xFC20 /* used */
+#define HERMES_RID_CNFWEPENABLED_AGERE 0xFC20
#define HERMES_RID_CNFMANDATORYBSSID_SYMBOL 0xFC21
-#define HERMES_RID_CNFWEPDEFAULTKEYID 0xFC23 /* used */
-#define HERMES_RID_CNFDEFAULTKEY0 0xFC24 /* used */
-#define HERMES_RID_CNFDEFAULTKEY1 0xFC25 /* used */
-#define HERMES_RID_CNFMWOROBUST_AGERE 0xFC25 /* used */
-#define HERMES_RID_CNFDEFAULTKEY2 0xFC26 /* used */
-#define HERMES_RID_CNFDEFAULTKEY3 0xFC27 /* used */
-#define HERMES_RID_CNFWEPFLAGS_INTERSIL 0xFC28 /* used */
+#define HERMES_RID_CNFWEPDEFAULTKEYID 0xFC23
+#define HERMES_RID_CNFDEFAULTKEY0 0xFC24
+#define HERMES_RID_CNFDEFAULTKEY1 0xFC25
+#define HERMES_RID_CNFMWOROBUST_AGERE 0xFC25
+#define HERMES_RID_CNFDEFAULTKEY2 0xFC26
+#define HERMES_RID_CNFDEFAULTKEY3 0xFC27
+#define HERMES_RID_CNFWEPFLAGS_INTERSIL 0xFC28
#define HERMES_RID_CNFWEPKEYMAPPINGTABLE 0xFC29
-#define HERMES_RID_CNFAUTHENTICATION 0xFC2A /* used */
+#define HERMES_RID_CNFAUTHENTICATION 0xFC2A
#define HERMES_RID_CNFMAXASSOCSTA 0xFC2B
#define HERMES_RID_CNFKEYLENGTH_SYMBOL 0xFC2B
#define HERMES_RID_CNFTXCONTROL 0xFC2C
@@ -53,14 +53,14 @@
#define HERMES_RID_CNFTIMCTRL 0xFC40
#define HERMES_RID_CNFTHIRTY2TALLY 0xFC42
#define HERMES_RID_CNFENHSECURITY 0xFC43
-#define HERMES_RID_CNFGROUPADDRESSES 0xFC80 /* used */
-#define HERMES_RID_CNFCREATEIBSS 0xFC81 /* used */
-#define HERMES_RID_CNFFRAGMENTATIONTHRESHOLD 0xFC82 /* used */
-#define HERMES_RID_CNFRTSTHRESHOLD 0xFC83 /* used */
-#define HERMES_RID_CNFTXRATECONTROL 0xFC84 /* used */
-#define HERMES_RID_CNFPROMISCUOUSMODE 0xFC85 /* used */
+#define HERMES_RID_CNFGROUPADDRESSES 0xFC80
+#define HERMES_RID_CNFCREATEIBSS 0xFC81
+#define HERMES_RID_CNFFRAGMENTATIONTHRESHOLD 0xFC82
+#define HERMES_RID_CNFRTSTHRESHOLD 0xFC83
+#define HERMES_RID_CNFTXRATECONTROL 0xFC84
+#define HERMES_RID_CNFPROMISCUOUSMODE 0xFC85
#define HERMES_RID_CNFBASICRATES_SYMBOL 0xFC8A
-#define HERMES_RID_CNFPREAMBLE_SYMBOL 0xFC8C /* used */
+#define HERMES_RID_CNFPREAMBLE_SYMBOL 0xFC8C
#define HERMES_RID_CNFFRAGMENTATIONTHRESHOLD0 0xFC90
#define HERMES_RID_CNFFRAGMENTATIONTHRESHOLD1 0xFC91
#define HERMES_RID_CNFFRAGMENTATIONTHRESHOLD2 0xFC92
@@ -76,13 +76,13 @@
#define HERMES_RID_CNFRTSTHRESHOLD5 0xFC9C
#define HERMES_RID_CNFRTSTHRESHOLD6 0xFC9D
#define HERMES_RID_CNFSHORTPREAMBLE 0xFCB0
-#define HERMES_RID_CNFWEPKEYS_AGERE 0xFCB0 /* used */
+#define HERMES_RID_CNFWEPKEYS_AGERE 0xFCB0
#define HERMES_RID_CNFEXCLUDELONGPREAMBLE 0xFCB1
-#define HERMES_RID_CNFTXKEY_AGERE 0xFCB1 /* used */
+#define HERMES_RID_CNFTXKEY_AGERE 0xFCB1
#define HERMES_RID_CNFAUTHENTICATIONRSPTO 0xFCB2
#define HERMES_RID_CNFBASICRATES 0xFCB3
#define HERMES_RID_CNFSUPPORTEDRATES 0xFCB4
-#define HERMES_RID_CNFTICKTIME 0xFCE0 /* used */
+#define HERMES_RID_CNFTICKTIME 0xFCE0
#define HERMES_RID_CNFSCANREQUEST 0xFCE1
#define HERMES_RID_CNFJOINREQUEST 0xFCE2
#define HERMES_RID_CNFAUTHENTICATESTATION 0xFCE3
@@ -100,26 +100,26 @@
#define HERMES_RID_NICID 0xFD0B
#define HERMES_RID_MFISUPRANGE 0xFD0C
#define HERMES_RID_CFISUPRANGE 0xFD0D
-#define HERMES_RID_CHANNELLIST 0xFD10 /* used */
+#define HERMES_RID_CHANNELLIST 0xFD10
#define HERMES_RID_REGULATORYDOMAINS 0xFD11
#define HERMES_RID_TEMPTYPE 0xFD12
#define HERMES_RID_CIS 0xFD13
-#define HERMES_RID_STAID 0xFD20 /* used */
+#define HERMES_RID_STAID 0xFD20
#define HERMES_RID_STASUPRANGE 0xFD21
#define HERMES_RID_MFIACTRANGES 0xFD22
#define HERMES_RID_CFIACTRANGES2 0xFD23
-#define HERMES_RID_SECONDARYVERSION_SYMBOL 0xFD24 /* used */
+#define HERMES_RID_SECONDARYVERSION_SYMBOL 0xFD24
#define HERMES_RID_PORTSTATUS 0xFD40
-#define HERMES_RID_CURRENTSSID 0xFD41 /* used */
-#define HERMES_RID_CURRENTBSSID 0xFD42 /* used */
-#define HERMES_RID_COMMSQUALITY 0xFD43 /* used */
-#define HERMES_RID_CURRENTTXRATE 0xFD44 /* used */
+#define HERMES_RID_CURRENTSSID 0xFD41
+#define HERMES_RID_CURRENTBSSID 0xFD42
+#define HERMES_RID_COMMSQUALITY 0xFD43
+#define HERMES_RID_CURRENTTXRATE 0xFD44
#define HERMES_RID_CURRENTBEACONINTERVAL 0xFD45
#define HERMES_RID_CURRENTSCALETHRESHOLDS 0xFD46
#define HERMES_RID_PROTOCOLRSPTIME 0xFD47
-#define HERMES_RID_SHORTRETRYLIMIT 0xFD48 /* used */
-#define HERMES_RID_LONGRETRYLIMIT 0xFD49 /* used */
-#define HERMES_RID_MAXTRANSMITLIFETIME 0xFD4A /* used */
+#define HERMES_RID_SHORTRETRYLIMIT 0xFD48
+#define HERMES_RID_LONGRETRYLIMIT 0xFD49
+#define HERMES_RID_MAXTRANSMITLIFETIME 0xFD4A
#define HERMES_RID_MAXRECEIVELIFETIME 0xFD4B
#define HERMES_RID_CFPOLLABLE 0xFD4C
#define HERMES_RID_AUTHENTICATIONALGORITHMS 0xFD4D
@@ -133,10 +133,10 @@
#define HERMES_RID_OWNMACADDR 0xFD86
#define HERMES_RID_SCANRESULTSTABLE 0xFD88
#define HERMES_RID_PHYTYPE 0xFDC0
-#define HERMES_RID_CURRENTCHANNEL 0xFDC1 /* used */
+#define HERMES_RID_CURRENTCHANNEL 0xFDC1
#define HERMES_RID_CURRENTPOWERSTATE 0xFDC2
#define HERMES_RID_CCAMODE 0xFDC3
-#define HERMES_RID_SUPPORTEDDATARATES 0xFDC6 /* used */
+#define HERMES_RID_SUPPORTEDDATARATES 0xFDC6
#define HERMES_RID_BUILDSEQ 0xFFFE
#define HERMES_RID_FWID 0xFFFF
Index: working-2.6/drivers/net/wireless/hermes.h
===================================================================
--- working-2.6.orig/drivers/net/wireless/hermes.h 2004-07-28 14:56:48.180413776 +1000
+++ working-2.6/drivers/net/wireless/hermes.h 2004-07-28 14:58:27.164365928 +1000
@@ -124,22 +124,22 @@
/*
* Command codes
*/
-/*--- Controller Commands --------------------------*/
+/*--- Controller Commands ----------------------------*/
#define HERMES_CMD_INIT (0x0000)
#define HERMES_CMD_ENABLE (0x0001)
#define HERMES_CMD_DISABLE (0x0002)
#define HERMES_CMD_DIAG (0x0003)
-/*--- Buffer Mgmt Commands --------------------------*/
+/*--- Buffer Mgmt Commands ---------------------------*/
#define HERMES_CMD_ALLOC (0x000A)
#define HERMES_CMD_TX (0x000B)
#define HERMES_CMD_CLRPRST (0x0012)
-/*--- Regulate Commands --------------------------*/
+/*--- Regulate Commands ------------------------------*/
#define HERMES_CMD_NOTIFY (0x0010)
#define HERMES_CMD_INQUIRE (0x0011)
-/*--- Configure Commands --------------------------*/
+/*--- Configure Commands -----------------------------*/
#define HERMES_CMD_ACCESS (0x0021)
#define HERMES_CMD_DOWNLD (0x0022)
@@ -312,9 +312,11 @@
#define hermes_write_regn(hw, name, val) hermes_write_reg((hw), HERMES_##name, (val))
/* Function prototypes */
-void hermes_struct_init(hermes_t *hw, ulong address, int io_space, int reg_spacing);
+void hermes_struct_init(hermes_t *hw, ulong address, int io_space,
+ int reg_spacing);
int hermes_init(hermes_t *hw);
-int hermes_docmd_wait(hermes_t *hw, u16 cmd, u16 parm0, hermes_response_t *resp);
+int hermes_docmd_wait(hermes_t *hw, u16 cmd, u16 parm0,
+ hermes_response_t *resp);
int hermes_allocate(hermes_t *hw, u16 size, u16 *fid);
int hermes_bap_pread(hermes_t *hw, int bap, void *buf, unsigned len,
Index: working-2.6/drivers/net/wireless/ieee802_11.h
===================================================================
--- working-2.6.orig/drivers/net/wireless/ieee802_11.h 2004-05-20 12:58:17.000000000 +1000
+++ working-2.6/drivers/net/wireless/ieee802_11.h 2004-07-28 14:57:53.063550040 +1000
@@ -76,4 +76,3 @@
#define IEEE802_11_SCTL_SEQ 0xFFF0
#endif /* _IEEE802_11_H */
-
--
David Gibson | For every complex problem there is a
david AT gibson.dropbear.id.au | solution which is simple, neat and
| wrong.
http://www.ozlabs.org/people/dgibson
^ permalink raw reply [flat|nested] 31+ messages in thread
* [8/15] orinoco merge preliminaries - use BUG_ON()
2004-07-28 6:56 ` [7/15] orinoco merge preliminaries - comment/whitespace/spelling updates David Gibson
@ 2004-07-28 6:57 ` David Gibson
2004-07-28 6:58 ` [9/15] orinoco merge preliminaries - make things static David Gibson
0 siblings, 1 reply; 31+ messages in thread
From: David Gibson @ 2004-07-28 6:57 UTC (permalink / raw)
To: Jeff Garzik, Francois Romieu, Linux kernel mailing list, jt,
Dan Williams, Pavel Roskin, Orinoco Development List
Use BUG_ON() macro instead of explicit if(x) BUG() in various places.
Signed-off-by: David Gibson <hermes@gibson.dropbear.id.au>
Index: working-2.6/drivers/net/wireless/orinoco.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco.c 2004-07-28 15:05:39.583628208 +1000
+++ working-2.6/drivers/net/wireless/orinoco.c 2004-07-28 15:05:40.433499008 +1000
@@ -1770,11 +1770,10 @@
int i;
for (i = 0; i < mc_count; i++) {
- /* Paranoia: */
- if (! p)
- BUG(); /* Multicast list shorter than mc_count */
- if (p->dmi_addrlen != ETH_ALEN)
- BUG(); /* Bad address size in multicast list */
+ /* paranoia: is list shorter than mc_count? */
+ BUG_ON(! p);
+ /* paranoia: bad address size in list? */
+ BUG_ON(p->dmi_addrlen != ETH_ALEN);
memcpy(mclist.addr[i], p->dmi_addr, ETH_ALEN);
p = p->next;
@@ -3185,8 +3184,7 @@
ratemode = priv->bitratemode;
- if ( (ratemode < 0) || (ratemode >= BITRATE_TABLE_SIZE) )
- BUG();
+ BUG_ON((ratemode < 0) || (ratemode >= BITRATE_TABLE_SIZE));
rrq->value = bitrate_table[ratemode].bitrate * 100000;
rrq->fixed = ! bitrate_table[ratemode].automatic;
Index: working-2.6/drivers/net/wireless/orinoco_tmd.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco_tmd.c 2004-07-28 15:05:39.588627448 +1000
+++ working-2.6/drivers/net/wireless/orinoco_tmd.c 2004-07-28 15:05:40.435498704 +1000
@@ -172,8 +172,7 @@
{
struct net_device *dev = pci_get_drvdata(pdev);
- if (! dev)
- BUG();
+ BUG_ON(! dev);
unregister_netdev(dev);
Index: working-2.6/drivers/net/wireless/orinoco_cs.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco_cs.c 2004-07-28 15:05:39.596626232 +1000
+++ working-2.6/drivers/net/wireless/orinoco_cs.c 2004-07-28 15:05:40.437498400 +1000
@@ -228,10 +228,8 @@
for (linkp = &dev_list; *linkp; linkp = &(*linkp)->next)
if (*linkp == link)
break;
- if (*linkp == NULL) {
- BUG();
- return;
- }
+
+ BUG_ON(*linkp == NULL);
if (link->state & DEV_CONFIG)
orinoco_cs_release(link);
Index: working-2.6/drivers/net/wireless/orinoco_plx.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco_plx.c 2004-07-28 15:05:39.592626840 +1000
+++ working-2.6/drivers/net/wireless/orinoco_plx.c 2004-07-28 15:05:40.438498248 +1000
@@ -286,8 +286,7 @@
{
struct net_device *dev = pci_get_drvdata(pdev);
- if (! dev)
- BUG();
+ BUG_ON(! dev);
unregister_netdev(dev);
--
David Gibson | For every complex problem there is a
david AT gibson.dropbear.id.au | solution which is simple, neat and
| wrong.
http://www.ozlabs.org/people/dgibson
^ permalink raw reply [flat|nested] 31+ messages in thread
* [9/15] orinoco merge preliminaries - make things static
2004-07-28 6:57 ` [8/15] orinoco merge preliminaries - use BUG_ON() David Gibson
@ 2004-07-28 6:58 ` David Gibson
2004-07-28 6:58 ` [10/15] orinoco merge preliminaries - miscelaneous David Gibson
0 siblings, 1 reply; 31+ messages in thread
From: David Gibson @ 2004-07-28 6:58 UTC (permalink / raw)
To: Jeff Garzik, Francois Romieu, Linux kernel mailing list, jt,
Dan Williams, Pavel Roskin, Orinoco Development List
Make various functions and variables static which always should have
been, but weren't.
Signed-off-by: David Gibson <hermes@gibson.dropbear.id.au>
Index: working-2.6/drivers/net/wireless/orinoco_tmd.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco_tmd.c 2004-07-28 15:05:40.435498704 +1000
+++ working-2.6/drivers/net/wireless/orinoco_tmd.c 2004-07-28 15:05:43.818984336 +1000
@@ -214,7 +214,7 @@
return pci_module_init(&orinoco_tmd_driver);
}
-void __exit orinoco_tmd_exit(void)
+static void __exit orinoco_tmd_exit(void)
{
pci_unregister_driver(&orinoco_tmd_driver);
current->state = TASK_UNINTERRUPTIBLE;
Index: working-2.6/drivers/net/wireless/orinoco_plx.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco_plx.c 2004-07-28 15:05:40.438498248 +1000
+++ working-2.6/drivers/net/wireless/orinoco_plx.c 2004-07-28 15:05:43.819984184 +1000
@@ -341,7 +341,7 @@
return pci_module_init(&orinoco_plx_driver);
}
-void __exit orinoco_plx_exit(void)
+static void __exit orinoco_plx_exit(void)
{
pci_unregister_driver(&orinoco_plx_driver);
current->state = TASK_UNINTERRUPTIBLE;
Index: working-2.6/drivers/net/wireless/orinoco_pci.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco_pci.c 2004-07-28 15:05:39.586627752 +1000
+++ working-2.6/drivers/net/wireless/orinoco_pci.c 2004-07-28 15:05:43.820984032 +1000
@@ -387,7 +387,7 @@
return pci_module_init(&orinoco_pci_driver);
}
-void __exit orinoco_pci_exit(void)
+static void __exit orinoco_pci_exit(void)
{
pci_unregister_driver(&orinoco_pci_driver);
}
Index: working-2.6/drivers/net/wireless/orinoco.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco.c 2004-07-28 15:05:40.433499008 +1000
+++ working-2.6/drivers/net/wireless/orinoco.c 2004-07-28 15:05:43.829982664 +1000
@@ -507,7 +507,7 @@
/********************************************************************/
/* The frequency of each channel in MHz */
-const long channel_frequency[] = {
+static const long channel_frequency[] = {
2412, 2417, 2422, 2427, 2432, 2437, 2442,
2447, 2452, 2457, 2462, 2467, 2472, 2484
};
@@ -515,7 +515,7 @@
/* This tables gives the actual meanings of the bitrate IDs returned
* by the firmware. */
-struct {
+static struct {
int bitrate; /* in 100s of kilobits */
int automatic;
u16 agere_txratectrl;
@@ -643,14 +643,14 @@
return err;
}
-struct net_device_stats *orinoco_get_stats(struct net_device *dev)
+static struct net_device_stats *orinoco_get_stats(struct net_device *dev)
{
struct orinoco_private *priv = netdev_priv(dev);
return &priv->stats;
}
-struct iw_statistics *orinoco_get_wireless_stats(struct net_device *dev)
+static struct iw_statistics *orinoco_get_wireless_stats(struct net_device *dev)
{
struct orinoco_private *priv = netdev_priv(dev);
hermes_t *hw = &priv->hw;
@@ -985,9 +985,9 @@
}
}
-void orinoco_stat_gather(struct net_device *dev,
- struct sk_buff *skb,
- struct hermes_rx_descriptor *desc)
+static void orinoco_stat_gather(struct net_device *dev,
+ struct sk_buff *skb,
+ struct hermes_rx_descriptor *desc)
{
struct orinoco_private *priv = netdev_priv(dev);
--
David Gibson | For every complex problem there is a
david AT gibson.dropbear.id.au | solution which is simple, neat and
| wrong.
http://www.ozlabs.org/people/dgibson
^ permalink raw reply [flat|nested] 31+ messages in thread
* [10/15] orinoco merge preliminaries - miscelaneous
2004-07-28 6:58 ` [9/15] orinoco merge preliminaries - make things static David Gibson
@ 2004-07-28 6:58 ` David Gibson
2004-07-28 6:59 ` [11/15] orinoco merge preliminaries - use name/version macros David Gibson
0 siblings, 1 reply; 31+ messages in thread
From: David Gibson @ 2004-07-28 6:58 UTC (permalink / raw)
To: Jeff Garzik, Francois Romieu, Linux kernel mailing list, jt,
Dan Williams, Pavel Roskin, Orinoco Development List
Random trivial cleanups that don't belong with anything else:
- Use ETH_DATA_LEN instead of hard-coded constant
- Remove a duplicated constant in an | expression
Signed-off-by: David Gibson <hermes@gibson.dropbear.id>
Index: working-2.6/drivers/net/wireless/orinoco.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco.c 2004-07-28 15:05:43.829982664 +1000
+++ working-2.6/drivers/net/wireless/orinoco.c 2004-07-28 15:05:47.239464344 +1000
@@ -813,7 +813,7 @@
HERMES_802_3_OFFSET - HERMES_802_11_OFFSET);
/* Encapsulate Ethernet-II frames */
- if (ntohs(eh->h_proto) > 1500) { /* Ethernet-II frame */
+ if (ntohs(eh->h_proto) > ETH_DATA_LEN) { /* Ethernet-II frame */
struct header_struct hdr;
data_len = len;
data_off = HERMES_802_3_OFFSET + sizeof(hdr);
Index: working-2.6/drivers/net/wireless/orinoco_tmd.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco_tmd.c 2004-07-28 15:05:43.818984336 +1000
+++ working-2.6/drivers/net/wireless/orinoco_tmd.c 2004-07-28 15:05:47.241464040 +1000
@@ -78,7 +78,7 @@
static char dev_info[] = "orinoco_tmd";
-#define COR_VALUE (COR_LEVEL_REQ | COR_FUNC_ENA | COR_FUNC_ENA) /* Enable PC card with interrupt in level trigger */
+#define COR_VALUE (COR_LEVEL_REQ | COR_FUNC_ENA) /* Enable PC card with interrupt in level trigger */
static int orinoco_tmd_init_one(struct pci_dev *pdev,
const struct pci_device_id *ent)
--
David Gibson | For every complex problem there is a
david AT gibson.dropbear.id.au | solution which is simple, neat and
| wrong.
http://www.ozlabs.org/people/dgibson
^ permalink raw reply [flat|nested] 31+ messages in thread
* [11/15] orinoco merge preliminaries - use name/version macros
2004-07-28 6:58 ` [10/15] orinoco merge preliminaries - miscelaneous David Gibson
@ 2004-07-28 6:59 ` David Gibson
2004-07-28 6:59 ` [12/15] orinoco merge preliminaries - remove unneeded #includes David Gibson
0 siblings, 1 reply; 31+ messages in thread
From: David Gibson @ 2004-07-28 6:59 UTC (permalink / raw)
To: Jeff Garzik, Francois Romieu, Linux kernel mailing list, jt,
Dan Williams, Pavel Roskin, Orinoco Development List
Use some macros defining driver names and version to reduce the number
of places that need to be changed when the version changes. Also use
these to make it easier to keep printk() messages with a consistent
prefix.
Signed-off-by: David Gibson <hermes@gibson.dropbear.id.au>
Index: working-2.6/drivers/net/wireless/orinoco.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco.c 2004-07-28 15:05:47.239464344 +1000
+++ working-2.6/drivers/net/wireless/orinoco.c 2004-07-28 15:05:49.947052728 +1000
@@ -419,6 +419,8 @@
* hw_unavailable is non-zero).
*/
+#define DRIVER_NAME "orinoco"
+
#include <linux/config.h>
#include <linux/module.h>
@@ -4179,7 +4181,8 @@
/* Can't be declared "const" or the whole __initdata section will
* become const */
-static char version[] __initdata = "orinoco.c 0.13e (David Gibson <hermes@gibson.dropbear.id.au> and others)";
+static char version[] __initdata = DRIVER_NAME " " DRIVER_VERSION
+ " (David Gibson <hermes@gibson.dropbear.id.au> and others)";
static int __init init_orinoco(void)
{
Index: working-2.6/drivers/net/wireless/orinoco.h
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco.h 2004-07-28 15:05:39.587627600 +1000
+++ working-2.6/drivers/net/wireless/orinoco.h 2004-07-28 15:05:49.948052576 +1000
@@ -7,6 +7,8 @@
#ifndef _ORINOCO_H
#define _ORINOCO_H
+#define DRIVER_VERSION "0.13e"
+
#include <linux/types.h>
#include <linux/spinlock.h>
#include <linux/netdevice.h>
Index: working-2.6/drivers/net/wireless/orinoco_cs.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco_cs.c 2004-07-28 15:05:40.437498400 +1000
+++ working-2.6/drivers/net/wireless/orinoco_cs.c 2004-07-28 15:05:49.950052272 +1000
@@ -10,6 +10,9 @@
* Copyright notice & release notes in file orinoco.c
*/
+#define DRIVER_NAME "orinoco_cs"
+#define PFX DRIVER_NAME ": "
+
#include <linux/config.h>
#ifdef __IN_PCMCIA_PACKAGE__
#include <pcmcia/k_compat.h>
@@ -74,7 +77,7 @@
* device driver with appropriate cards, through the card
* configuration database.
*/
-static dev_info_t dev_info = "orinoco_cs";
+static dev_info_t dev_info = DRIVER_NAME;
/********************************************************************/
/* Data structures */
@@ -240,9 +243,9 @@
/* Unlink device structure, and free it */
*linkp = link->next;
- DEBUG(0, "orinoco_cs: detach: link=%p link->dev=%p\n", link, link->dev);
+ DEBUG(0, PFX "detach: link=%p link->dev=%p\n", link, link->dev);
if (link->dev) {
- DEBUG(0, "orinoco_cs: About to unregister net device %p\n",
+ DEBUG(0, PFX "About to unregister net device %p\n",
dev);
unregister_netdev(dev);
}
@@ -400,7 +403,7 @@
pcmcia_release_io(link->handle, &link->io);
last_ret = pcmcia_get_next_tuple(handle, &tuple);
if (last_ret == CS_NO_MORE_ITEMS) {
- printk(KERN_ERR "GetNextTuple(). No matching "
+ printk(KERN_ERR PFX "GetNextTuple(): No matching "
"CIS configuration, maybe you need the "
"ignore_cis_vcc=1 parameter.\n");
goto cs_failed;
@@ -453,7 +456,7 @@
dev->name[0] = '\0';
/* Tell the stack we exist */
if (register_netdev(dev) != 0) {
- printk(KERN_ERR "orinoco_cs: register_netdev() failed\n");
+ printk(KERN_ERR PFX "register_netdev() failed\n");
goto failed;
}
@@ -625,12 +628,13 @@
/* Can't be declared "const" or the whole __initdata section will
* become const */
-static char version[] __initdata = "orinoco_cs.c 0.13e (David Gibson <hermes@gibson.dropbear.id.au> and others)";
+static char version[] __initdata = DRIVER_NAME " " DRIVER_VERSION
+ "(David Gibson <hermes@gibson.dropbear.id.au> and others)";
static struct pcmcia_driver orinoco_driver = {
.owner = THIS_MODULE,
.drv = {
- .name = "orinoco_cs",
+ .name = DRIVER_NAME,
},
.attach = orinoco_cs_attach,
.detach = orinoco_cs_detach,
@@ -650,7 +654,7 @@
pcmcia_unregister_driver(&orinoco_driver);
if (dev_list)
- DEBUG(0, "orinoco_cs: Removing leftover devices.\n");
+ DEBUG(0, PFX "Removing leftover devices.\n");
while (dev_list != NULL) {
if (dev_list->state & DEV_CONFIG)
orinoco_cs_release(dev_list);
Index: working-2.6/drivers/net/wireless/orinoco_pci.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco_pci.c 2004-07-28 15:05:43.820984032 +1000
+++ working-2.6/drivers/net/wireless/orinoco_pci.c 2004-07-28 15:05:49.952051968 +1000
@@ -85,6 +85,9 @@
* Jean II
*/
+#define DRIVER_NAME "orinoco_pci"
+#define PFX DRIVER_NAME ": "
+
#include <linux/config.h>
#include <linux/module.h>
@@ -174,7 +177,7 @@
}
/* Did we timeout ? */
if(time_after_eq(jiffies, timeout)) {
- printk(KERN_ERR "orinoco_pci: Busy timeout\n");
+ printk(KERN_ERR PFX "Busy timeout\n");
return -ETIMEDOUT;
}
printk(KERN_NOTICE "pci_cor : reg = 0x%X - %lX - %lX\n", reg, timeout, jiffies);
@@ -220,7 +223,7 @@
SET_MODULE_OWNER(dev);
SET_NETDEV_DEV(dev, &pdev->dev);
- printk(KERN_DEBUG
+ printk(KERN_DEBUG PFX
"Detected Orinoco/Prism2 PCI device at %s, mem:0x%lX to 0x%lX -> 0x%p, irq:%d\n",
pci_name(pdev), dev->mem_start, dev->mem_end, pci_ioaddr, pdev->irq);
@@ -231,7 +234,7 @@
err = request_irq(pdev->irq, orinoco_interrupt, SA_SHIRQ,
dev->name, dev);
if (err) {
- printk(KERN_ERR "orinoco_pci: Error allocating IRQ %d.\n",
+ printk(KERN_ERR PFX "Error allocating IRQ %d.\n",
pdev->irq);
err = -EBUSY;
goto fail;
@@ -368,7 +371,7 @@
MODULE_DEVICE_TABLE(pci, orinoco_pci_pci_id_table);
static struct pci_driver orinoco_pci_driver = {
- .name = "orinoco_pci",
+ .name = DRIVER_NAME,
.id_table = orinoco_pci_pci_id_table,
.probe = orinoco_pci_init_one,
.remove = __devexit_p(orinoco_pci_remove_one),
@@ -376,7 +379,8 @@
.resume = orinoco_pci_resume,
};
-static char version[] __initdata = "orinoco_pci.c 0.13e (David Gibson <hermes@gibson.dropbear.id.au> & Jean Tourrilhes <jt@hpl.hp.com>)";
+static char version[] __initdata = DRIVER_NAME " " DRIVER_VERSION
+ " (David Gibson <hermes@gibson.dropbear.id.au> & Jean Tourrilhes <jt@hpl.hp.com>)";
MODULE_AUTHOR("David Gibson <hermes@gibson.dropbear.id.au>");
MODULE_DESCRIPTION("Driver for wireless LAN cards using direct PCI interface");
MODULE_LICENSE("Dual MPL/GPL");
Index: working-2.6/drivers/net/wireless/orinoco_plx.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco_plx.c 2004-07-28 15:05:43.819984184 +1000
+++ working-2.6/drivers/net/wireless/orinoco_plx.c 2004-07-28 15:05:49.954051664 +1000
@@ -108,6 +108,9 @@
* going, might not have time for a while..
*/
+#define DRIVER_NAME "orinoco_plx"
+#define PFX DRIVER_NAME ": "
+
#include <linux/config.h>
#include <linux/module.h>
@@ -135,8 +138,6 @@
#include "hermes.h"
#include "orinoco.h"
-static char dev_info[] = "orinoco_plx";
-
#define COR_OFFSET (0x3e0/2) /* COR attribute offset of Prism2 PC card */
#define COR_VALUE (COR_LEVEL_REQ | COR_FUNC_ENA) /* Enable PC card with interrupt in level trigger */
@@ -218,7 +219,7 @@
/* and 3 to the PCMCIA slot I/O address space */
pccard_ioaddr = pci_resource_start(pdev, 3);
pccard_iolen = pci_resource_len(pdev, 3);
- if (! request_region(pccard_ioaddr, pccard_iolen, dev_info)) {
+ if (! request_region(pccard_ioaddr, pccard_iolen, DRIVER_NAME)) {
printk(KERN_ERR "orinoco_plx: I/O resource 0x%lx @ 0x%lx busy\n",
pccard_iolen, pccard_ioaddr);
pccard_ioaddr = 0;
@@ -238,7 +239,7 @@
SET_MODULE_OWNER(dev);
SET_NETDEV_DEV(dev, &pdev->dev);
- printk(KERN_DEBUG "Detected Orinoco/Prism2 PLX device "
+ printk(KERN_DEBUG PFX "Detected Orinoco/Prism2 PLX device "
"at %s irq:%d, io addr:0x%lx\n", pci_name(pdev), pdev->irq,
pccard_ioaddr);
@@ -249,7 +250,7 @@
err = request_irq(pdev->irq, orinoco_interrupt, SA_SHIRQ,
dev->name, dev);
if (err) {
- printk(KERN_ERR "orinoco_plx: Error allocating IRQ %d.\n", pdev->irq);
+ printk(KERN_ERR PFX "Error allocating IRQ %d.\n", pdev->irq);
err = -EBUSY;
goto fail;
}
@@ -262,7 +263,7 @@
return 0;
fail:
- printk(KERN_DEBUG "orinoco_plx: init_one(), FAIL!\n");
+ printk(KERN_DEBUG PFX "init_one(), FAIL!\n");
if (dev) {
if (dev->irq)
@@ -324,13 +325,14 @@
MODULE_DEVICE_TABLE(pci, orinoco_plx_pci_id_table);
static struct pci_driver orinoco_plx_driver = {
- .name = "orinoco_plx",
+ .name = DRIVER_NAME,
.id_table = orinoco_plx_pci_id_table,
.probe = orinoco_plx_init_one,
.remove = __devexit_p(orinoco_plx_remove_one),
};
-static char version[] __initdata = "orinoco_plx.c 0.13e (Daniel Barlow <dan@telent.net>, David Gibson <hermes@gibson.dropbear.id.au>)";
+static char version[] __initdata = DRIVER_NAME " " DRIVER_VERSION
+ " (Daniel Barlow <dan@telent.net>, David Gibson <hermes@gibson.dropbear.id.au>)";
MODULE_AUTHOR("Daniel Barlow <dan@telent.net>");
MODULE_DESCRIPTION("Driver for wireless LAN cards using the PLX9052 PCI bridge");
MODULE_LICENSE("Dual MPL/GPL");
Index: working-2.6/drivers/net/wireless/orinoco_tmd.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco_tmd.c 2004-07-28 15:05:47.241464040 +1000
+++ working-2.6/drivers/net/wireless/orinoco_tmd.c 2004-07-28 15:05:49.956051360 +1000
@@ -49,6 +49,9 @@
* Pheecom sells cards with the TMD chip as "ASIC version"
*/
+#define DRIVER_NAME "orinoco_tmd"
+#define PFX DRIVER_NAME ": "
+
#include <linux/config.h>
#include <linux/module.h>
@@ -76,8 +79,6 @@
#include "hermes.h"
#include "orinoco.h"
-static char dev_info[] = "orinoco_tmd";
-
#define COR_VALUE (COR_LEVEL_REQ | COR_FUNC_ENA) /* Enable PC card with interrupt in level trigger */
static int orinoco_tmd_init_one(struct pci_dev *pdev,
@@ -94,11 +95,11 @@
if (err)
return -EIO;
- printk(KERN_DEBUG "TMD setup\n");
+ printk(KERN_DEBUG PFX "TMD setup\n");
pccard_ioaddr = pci_resource_start(pdev, 2);
pccard_iolen = pci_resource_len(pdev, 2);
- if (! request_region(pccard_ioaddr, pccard_iolen, dev_info)) {
- printk(KERN_ERR "orinoco_tmd: I/O resource at 0x%lx len 0x%lx busy\n",
+ if (! request_region(pccard_ioaddr, pccard_iolen, DRIVER_NAME)) {
+ printk(KERN_ERR PFX "I/O resource at 0x%lx len 0x%lx busy\n",
pccard_ioaddr, pccard_iolen);
pccard_ioaddr = 0;
err = -EBUSY;
@@ -109,7 +110,7 @@
mdelay(1);
reg = inb(addr);
if (reg != COR_VALUE) {
- printk(KERN_ERR "orinoco_tmd: Error setting TMD COR values %x should be %x\n", reg, COR_VALUE);
+ printk(KERN_ERR PFX "Error setting TMD COR values %x should be %x\n", reg, COR_VALUE);
err = -EIO;
goto fail;
}
@@ -126,7 +127,7 @@
SET_MODULE_OWNER(dev);
SET_NETDEV_DEV(dev, &pdev->dev);
- printk(KERN_DEBUG "Detected Orinoco/Prism2 TMD device "
+ printk(KERN_DEBUG PFX "Detected Orinoco/Prism2 TMD device "
"at %s irq:%d, io addr:0x%lx\n", pci_name(pdev), pdev->irq,
pccard_ioaddr);
@@ -137,7 +138,7 @@
err = request_irq(pdev->irq, orinoco_interrupt, SA_SHIRQ,
dev->name, dev);
if (err) {
- printk(KERN_ERR "orinoco_tmd: Error allocating IRQ %d.\n",
+ printk(KERN_ERR PFX "Error allocating IRQ %d.\n",
pdev->irq);
err = -EBUSY;
goto fail;
@@ -151,7 +152,7 @@
return 0;
fail:
- printk(KERN_DEBUG "orinoco_tmd: init_one(), FAIL!\n");
+ printk(KERN_DEBUG PFX "init_one(), FAIL!\n");
if (dev) {
if (dev->irq)
@@ -197,13 +198,14 @@
MODULE_DEVICE_TABLE(pci, orinoco_tmd_pci_id_table);
static struct pci_driver orinoco_tmd_driver = {
- .name = "orinoco_tmd",
+ .name = DRIVER_NAME,
.id_table = orinoco_tmd_pci_id_table,
.probe = orinoco_tmd_init_one,
.remove = __devexit_p(orinoco_tmd_remove_one),
};
-static char version[] __initdata = "orinoco_tmd.c 0.01 (Joerg Dorchain <joerg@dorchain.net>)";
+static char version[] __initdata = DRIVER_NAME " " DRIVER_VERSION
+ " (Joerg Dorchain <joerg@dorchain.net>)";
MODULE_AUTHOR("Joerg Dorchain <joerg@dorchain.net>");
MODULE_DESCRIPTION("Driver for wireless LAN cards using the TMD7160 PCI bridge");
MODULE_LICENSE("Dual MPL/GPL");
Index: working-2.6/drivers/net/wireless/airport.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/airport.c 2004-07-28 15:05:31.219899688 +1000
+++ working-2.6/drivers/net/wireless/airport.c 2004-07-28 15:05:49.958051056 +1000
@@ -11,6 +11,9 @@
* 0.06 : fix possible hang on powerup, add sleep support
*/
+#define DRIVER_NAME "airport"
+#define PFX DRIVER_NAME ": "
+
#include <linux/config.h>
#include <linux/module.h>
@@ -194,14 +197,14 @@
hermes_t *hw;
if (macio_resource_count(mdev) < 1 || macio_irq_count(mdev) < 1) {
- printk(KERN_ERR "airport: wrong interrupt/addresses in OF tree\n");
+ printk(KERN_ERR PFX "wrong interrupt/addresses in OF tree\n");
return -ENODEV;
}
/* Allocate space for private device-specific data */
dev = alloc_orinocodev(sizeof(*card), airport_hard_reset);
if (! dev) {
- printk(KERN_ERR "airport: can't allocate device datas\n");
+ printk(KERN_ERR PFX "can't allocate device datas\n");
return -ENODEV;
}
priv = netdev_priv(dev);
@@ -211,7 +214,7 @@
card->mdev = mdev;
if (macio_request_resource(mdev, 0, "airport")) {
- printk(KERN_ERR "airport: can't request IO resource !\n");
+ printk(KERN_ERR PFX "can't request IO resource !\n");
free_netdev(dev);
return -EBUSY;
}
@@ -224,11 +227,11 @@
/* Setup interrupts & base address */
dev->irq = macio_irq(mdev, 0);
phys_addr = macio_resource_start(mdev, 0); /* Physical address */
- printk(KERN_DEBUG "Airport at physical address %lx\n", phys_addr);
+ printk(KERN_DEBUG PFX "Airport at physical address %lx\n", phys_addr);
dev->base_addr = phys_addr;
card->vaddr = ioremap(phys_addr, AIRPORT_IO_LEN);
if (!card->vaddr) {
- printk("airport: ioremap() failed\n");
+ printk(PFX "ioremap() failed\n");
goto failed;
}
@@ -244,17 +247,17 @@
hermes_init(hw);
if (request_irq(dev->irq, orinoco_interrupt, 0, "Airport", dev)) {
- printk(KERN_ERR "airport: Couldn't get IRQ %d\n", dev->irq);
+ printk(KERN_ERR PFX "Couldn't get IRQ %d\n", dev->irq);
goto failed;
}
card->irq_requested = 1;
/* Tell the stack we exist */
if (register_netdev(dev) != 0) {
- printk(KERN_ERR "airport: register_netdev() failed\n");
+ printk(KERN_ERR PFX "register_netdev() failed\n");
goto failed;
}
- printk(KERN_DEBUG "airport: card registered for interface %s\n", dev->name);
+ printk(KERN_DEBUG PFX "card registered for interface %s\n", dev->name);
card->ndev_registered = 1;
return 0;
failed:
@@ -263,7 +266,8 @@
} /* airport_attach */
-static char version[] __initdata = "airport.c 0.13e (Benjamin Herrenschmidt <benh@kernel.crashing.org>)";
+static char version[] __initdata = DRIVER_NAME " " DRIVER_VERSION
+ " (Benjamin Herrenschmidt <benh@kernel.crashing.org>)";
MODULE_AUTHOR("Benjamin Herrenschmidt <benh@kernel.crashing.org>");
MODULE_DESCRIPTION("Driver for the Apple Airport wireless card.");
MODULE_LICENSE("Dual MPL/GPL");
@@ -280,7 +284,7 @@
static struct macio_driver airport_driver =
{
- .name = "airport",
+ .name = DRIVER_NAME,
.match_table = airport_match,
.probe = airport_attach,
.remove = airport_detach,
--
David Gibson | For every complex problem there is a
david AT gibson.dropbear.id.au | solution which is simple, neat and
| wrong.
http://www.ozlabs.org/people/dgibson
^ permalink raw reply [flat|nested] 31+ messages in thread
* [12/15] orinoco merge preliminaries - remove unneeded #includes
2004-07-28 6:59 ` [11/15] orinoco merge preliminaries - use name/version macros David Gibson
@ 2004-07-28 6:59 ` David Gibson
2004-07-28 7:00 ` [13/15] orinoco merge preliminaries - don't typedef structs David Gibson
0 siblings, 1 reply; 31+ messages in thread
From: David Gibson @ 2004-07-28 6:59 UTC (permalink / raw)
To: Jeff Garzik, Francois Romieu, Linux kernel mailing list, jt,
Dan Williams, Pavel Roskin, Orinoco Development List
Remove some unnecessary #includes.
Signed-off-by: David Gibson <hermes@gibson.dropbear.id.au>
Index: working-2.6/drivers/net/wireless/orinoco_pci.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco_pci.c 2004-07-28 13:59:20.878483328 +1000
+++ working-2.6/drivers/net/wireless/orinoco_pci.c 2004-07-28 14:13:17.445305840 +1000
@@ -102,7 +102,6 @@
#include <linux/netdevice.h>
#include <linux/if_arp.h>
#include <linux/etherdevice.h>
-#include <linux/wireless.h>
#include <linux/list.h>
#include <linux/pci.h>
#include <linux/fcntl.h>
Index: working-2.6/drivers/net/wireless/orinoco_tmd.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco_tmd.c 2004-07-28 13:59:20.882482720 +1000
+++ working-2.6/drivers/net/wireless/orinoco_tmd.c 2004-07-28 14:14:40.023752008 +1000
@@ -69,7 +69,6 @@
#include <linux/netdevice.h>
#include <linux/if_arp.h>
#include <linux/etherdevice.h>
-#include <linux/wireless.h>
#include <linux/list.h>
#include <linux/pci.h>
#include <linux/fcntl.h>
Index: working-2.6/drivers/net/wireless/orinoco_plx.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco_plx.c 2004-07-28 13:59:20.880483024 +1000
+++ working-2.6/drivers/net/wireless/orinoco_plx.c 2004-07-28 14:13:56.727334064 +1000
@@ -128,7 +128,6 @@
#include <linux/netdevice.h>
#include <linux/if_arp.h>
#include <linux/etherdevice.h>
-#include <linux/wireless.h>
#include <linux/list.h>
#include <linux/pci.h>
#include <linux/fcntl.h>
--
David Gibson | For every complex problem there is a
david AT gibson.dropbear.id.au | solution which is simple, neat and
| wrong.
http://www.ozlabs.org/people/dgibson
^ permalink raw reply [flat|nested] 31+ messages in thread
* [13/15] orinoco merge preliminaries - don't typedef structs
2004-07-28 6:59 ` [12/15] orinoco merge preliminaries - remove unneeded #includes David Gibson
@ 2004-07-28 7:00 ` David Gibson
2004-07-28 7:00 ` [14/15] orinoco merge preliminaries - more HW data David Gibson
0 siblings, 1 reply; 31+ messages in thread
From: David Gibson @ 2004-07-28 7:00 UTC (permalink / raw)
To: Jeff Garzik, Francois Romieu, Linux kernel mailing list, jt,
Dan Williams, Pavel Roskin, Orinoco Development List
In line with normal kernel conventions, don't create typedefs for
structures.
Signed-off-by: David Gibson <hermes@gibson.dropbear.id.au>
Index: working-2.6/drivers/net/wireless/hermes.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/hermes.c 2004-07-28 14:57:53.055551256 +1000
+++ working-2.6/drivers/net/wireless/hermes.c 2004-07-28 15:04:15.767370216 +1000
@@ -224,7 +224,7 @@
*
* Callable from any context, but locking is your problem. */
int hermes_docmd_wait(hermes_t *hw, u16 cmd, u16 parm0,
- hermes_response_t *resp)
+ struct hermes_response *resp)
{
int err;
int k;
Index: working-2.6/drivers/net/wireless/hermes.h
===================================================================
--- working-2.6.orig/drivers/net/wireless/hermes.h 2004-07-28 14:58:27.164365928 +1000
+++ working-2.6/drivers/net/wireless/hermes.h 2004-07-28 15:01:39.039196520 +1000
@@ -252,9 +252,9 @@
u16 linkstatus; /* Link status */
} __attribute__ ((packed));
-typedef struct hermes_response {
+struct hermes_response {
u16 status, resp0, resp1, resp2;
-} hermes_response_t;
+};
/* "ID" structure - used for ESSID and station nickname */
struct hermes_idstring {
@@ -262,9 +262,9 @@
u16 val[16];
} __attribute__ ((packed));
-typedef struct hermes_multicast {
+struct hermes_multicast {
u8 addr[HERMES_MAX_MULTICAST][ETH_ALEN];
-} __attribute__ ((packed)) hermes_multicast_t;
+} __attribute__ ((packed));
// #define HERMES_DEBUG_BUFFER 1
#define HERMES_DEBUG_BUFSIZE 4096
@@ -316,7 +316,7 @@
int reg_spacing);
int hermes_init(hermes_t *hw);
int hermes_docmd_wait(hermes_t *hw, u16 cmd, u16 parm0,
- hermes_response_t *resp);
+ struct hermes_response *resp);
int hermes_allocate(hermes_t *hw, u16 size, u16 *fid);
int hermes_bap_pread(hermes_t *hw, int bap, void *buf, unsigned len,
Index: working-2.6/drivers/net/wireless/orinoco.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco.c 2004-07-28 15:00:37.185599696 +1000
+++ working-2.6/drivers/net/wireless/orinoco.c 2004-07-28 15:05:05.235849864 +1000
@@ -1768,7 +1768,7 @@
if (! promisc && (mc_count || priv->mc_count) ) {
struct dev_mc_list *p = dev->mc_list;
- hermes_multicast_t mclist;
+ struct hermes_multicast mclist;
int i;
for (i = 0; i < mc_count; i++) {
--
David Gibson | For every complex problem there is a
david AT gibson.dropbear.id.au | solution which is simple, neat and
| wrong.
http://www.ozlabs.org/people/dgibson
^ permalink raw reply [flat|nested] 31+ messages in thread
* [14/15] orinoco merge preliminaries - more HW data
2004-07-28 7:00 ` [13/15] orinoco merge preliminaries - don't typedef structs David Gibson
@ 2004-07-28 7:00 ` David Gibson
2004-07-28 7:01 ` [15/15] orinoco merge preliminaries - update authorship information David Gibson
0 siblings, 1 reply; 31+ messages in thread
From: David Gibson @ 2004-07-28 7:00 UTC (permalink / raw)
To: Jeff Garzik, Francois Romieu, Linux kernel mailing list, jt,
Dan Williams, Pavel Roskin, Orinoco Development List
Update various constants and structures in orinoco header files. The
updates generally represent either newer hardware/firmware features,
or corrections to what we know about hardware/firmware functions.
Signed-off-by: David Gibson <hermes@gibson.dropbear.id.au>
Index: working-2.6/drivers/net/wireless/hermes.h
===================================================================
--- working-2.6.orig/drivers/net/wireless/hermes.h 2004-07-28 16:29:53.597301344 +1000
+++ working-2.6/drivers/net/wireless/hermes.h 2004-07-28 16:35:12.151873688 +1000
@@ -133,7 +133,6 @@
/*--- Buffer Mgmt Commands ---------------------------*/
#define HERMES_CMD_ALLOC (0x000A)
#define HERMES_CMD_TX (0x000B)
-#define HERMES_CMD_CLRPRST (0x0012)
/*--- Regulate Commands ------------------------------*/
#define HERMES_CMD_NOTIFY (0x0010)
@@ -143,10 +142,34 @@
#define HERMES_CMD_ACCESS (0x0021)
#define HERMES_CMD_DOWNLD (0x0022)
+/*--- Serial I/O Commands ----------------------------*/
+#define HERMES_CMD_READMIF (0x0030)
+#define HERMES_CMD_WRITEMIF (0x0031)
+
/*--- Debugging Commands -----------------------------*/
-#define HERMES_CMD_MONITOR (0x0038)
-#define HERMES_MONITOR_ENABLE (0x000b)
-#define HERMES_MONITOR_DISABLE (0x000f)
+#define HERMES_CMD_TEST (0x0038)
+
+
+/* Test command arguments */
+#define HERMES_TEST_SET_CHANNEL 0x0800
+#define HERMES_TEST_MONITOR 0x0b00
+#define HERMES_TEST_STOP 0x0f00
+
+/* Authentication algorithms */
+#define HERMES_AUTH_OPEN 1
+#define HERMES_AUTH_SHARED_KEY 2
+
+/* WEP settings */
+#define HERMES_WEP_PRIVACY_INVOKED 0x0001
+#define HERMES_WEP_EXCL_UNENCRYPTED 0x0002
+#define HERMES_WEP_HOST_ENCRYPT 0x0010
+#define HERMES_WEP_HOST_DECRYPT 0x0080
+
+/* Symbol hostscan options */
+#define HERMES_HOSTSCAN_SYMBOL_5SEC 0x0001
+#define HERMES_HOSTSCAN_SYMBOL_ONCE 0x0002
+#define HERMES_HOSTSCAN_SYMBOL_PASSIVE 0x0040
+#define HERMES_HOSTSCAN_SYMBOL_BCAST 0x0080
/*
* Frame structures and constants
@@ -191,7 +214,11 @@
#define HERMES_INQ_TALLIES (0xF100)
#define HERMES_INQ_SCAN (0xF101)
+#define HERMES_INQ_CHANNELINFO (0xF102)
+#define HERMES_INQ_HOSTSCAN (0xF103)
+#define HERMES_INQ_HOSTSCAN_SYMBOL (0xF104)
#define HERMES_INQ_LINKSTATUS (0xF200)
+#define HERMES_INQ_SEC_STAT_AGERE (0xF202)
struct hermes_tallies_frame {
u16 TxUnicastFrames;
@@ -223,23 +250,58 @@
/* Grabbed from wlan-ng - Thanks Mark... - Jean II
* This is the result of a scan inquiry command */
/* Structure describing info about an Access Point */
-struct hermes_scan_apinfo {
+struct prism2_scan_apinfo {
u16 channel; /* Channel where the AP sits */
u16 noise; /* Noise level */
u16 level; /* Signal level */
u8 bssid[ETH_ALEN]; /* MAC address of the Access Point */
- u16 beacon_interv; /* Beacon interval ? */
- u16 capabilities; /* Capabilities ? */
+ u16 beacon_interv; /* Beacon interval */
+ u16 capabilities; /* Capabilities */
+ u16 essid_len; /* ESSID length */
u8 essid[32]; /* ESSID of the network */
u8 rates[10]; /* Bit rate supported */
- u16 proberesp_rate; /* ???? */
+ u16 proberesp_rate; /* Data rate of the response frame */
+ u16 atim; /* ATIM window time, Kus (hostscan only) */
+} __attribute__ ((packed));
+
+/* Same stuff for the Lucent/Agere card.
+ * Thanks to h1kari <h1kari AT dachb0den.com> - Jean II */
+struct agere_scan_apinfo {
+ u16 channel; /* Channel where the AP sits */
+ u16 noise; /* Noise level */
+ u16 level; /* Signal level */
+ u8 bssid[ETH_ALEN]; /* MAC address of the Access Point */
+ u16 beacon_interv; /* Beacon interval */
+ u16 capabilities; /* Capabilities */
+ /* bits: 0-ess, 1-ibss, 4-privacy [wep] */
+ u16 essid_len; /* ESSID length */
+ u8 essid[32]; /* ESSID of the network */
} __attribute__ ((packed));
-/* Container */
-struct hermes_scan_frame {
- u16 rsvd; /* ??? */
- u16 scanreason; /* ??? */
- struct hermes_scan_apinfo aps[35]; /* Scan result */
+
+/* Moustafa: Scan structure for Symbol cards */
+struct symbol_scan_apinfo {
+ u8 channel; /* Channel where the AP sits */
+ u8 unknown1; /* 8 in 2.9x and 3.9x f/w, 0 otherwise */
+ u16 noise; /* Noise level */
+ u16 level; /* Signal level */
+ u8 bssid[ETH_ALEN]; /* MAC address of the Access Point */
+ u16 beacon_interv; /* Beacon interval */
+ u16 capabilities; /* Capabilities */
+ /* bits: 0-ess, 1-ibss, 4-privacy [wep] */
+ u16 essid_len; /* ESSID length */
+ u8 essid[32]; /* ESSID of the network */
+ u16 rates[5]; /* Bit rate supported */
+ u16 basic_rates; /* Basic rates bitmask */
+ u8 unknown2[6]; /* Always FF:FF:FF:FF:00:00 */
+ u8 unknown3[8]; /* Always 0, appeared in f/w 3.91-68 */
} __attribute__ ((packed));
+
+union hermes_scan_info {
+ struct agere_scan_apinfo a;
+ struct prism2_scan_apinfo p;
+ struct symbol_scan_apinfo s;
+};
+
#define HERMES_LINKSTATUS_NOT_CONNECTED (0x0000)
#define HERMES_LINKSTATUS_CONNECTED (0x0001)
#define HERMES_LINKSTATUS_DISCONNECTED (0x0002)
Index: working-2.6/drivers/net/wireless/hermes_rid.h
===================================================================
--- working-2.6.orig/drivers/net/wireless/hermes_rid.h 2004-07-28 16:29:52.115526608 +1000
+++ working-2.6/drivers/net/wireless/hermes_rid.h 2004-07-28 16:29:53.968244952 +1000
@@ -28,6 +28,7 @@
#define HERMES_RID_CNFWDSADDRESS6 0xFC16
#define HERMES_RID_CNFMULTICASTPMBUFFERING 0xFC17
#define HERMES_RID_CNFWEPENABLED_AGERE 0xFC20
+#define HERMES_RID_CNFAUTHENTICATION_AGERE 0xFC21
#define HERMES_RID_CNFMANDATORYBSSID_SYMBOL 0xFC21
#define HERMES_RID_CNFWEPDEFAULTKEYID 0xFC23
#define HERMES_RID_CNFDEFAULTKEY0 0xFC24
@@ -75,11 +76,13 @@
#define HERMES_RID_CNFRTSTHRESHOLD4 0xFC9B
#define HERMES_RID_CNFRTSTHRESHOLD5 0xFC9C
#define HERMES_RID_CNFRTSTHRESHOLD6 0xFC9D
+#define HERMES_RID_CNFHOSTSCAN_SYMBOL 0xFCAB
#define HERMES_RID_CNFSHORTPREAMBLE 0xFCB0
#define HERMES_RID_CNFWEPKEYS_AGERE 0xFCB0
#define HERMES_RID_CNFEXCLUDELONGPREAMBLE 0xFCB1
#define HERMES_RID_CNFTXKEY_AGERE 0xFCB1
#define HERMES_RID_CNFAUTHENTICATIONRSPTO 0xFCB2
+#define HERMES_RID_CNFSCANSSID_AGERE 0xFCB2
#define HERMES_RID_CNFBASICRATES 0xFCB3
#define HERMES_RID_CNFSUPPORTEDRATES 0xFCB4
#define HERMES_RID_CNFTICKTIME 0xFCE0
@@ -87,6 +90,7 @@
#define HERMES_RID_CNFJOINREQUEST 0xFCE2
#define HERMES_RID_CNFAUTHENTICATESTATION 0xFCE3
#define HERMES_RID_CNFCHANNELINFOREQUEST 0xFCE4
+#define HERMES_RID_CNFHOSTSCAN 0xFCE5
/*
* Information RIDs
@@ -124,6 +128,7 @@
#define HERMES_RID_CFPOLLABLE 0xFD4C
#define HERMES_RID_AUTHENTICATIONALGORITHMS 0xFD4D
#define HERMES_RID_PRIVACYOPTIONIMPLEMENTED 0xFD4F
+#define HERMES_RID_DBMCOMMSQUALITY_INTERSIL 0xFD51
#define HERMES_RID_CURRENTTXRATE1 0xFD80
#define HERMES_RID_CURRENTTXRATE2 0xFD81
#define HERMES_RID_CURRENTTXRATE3 0xFD82
--
David Gibson | For every complex problem there is a
david AT gibson.dropbear.id.au | solution which is simple, neat and
| wrong.
http://www.ozlabs.org/people/dgibson
^ permalink raw reply [flat|nested] 31+ messages in thread
* [15/15] orinoco merge preliminaries - update authorship information
2004-07-28 7:00 ` [14/15] orinoco merge preliminaries - more HW data David Gibson
@ 2004-07-28 7:01 ` David Gibson
2004-07-28 16:55 ` Jeff Garzik
0 siblings, 1 reply; 31+ messages in thread
From: David Gibson @ 2004-07-28 7:01 UTC (permalink / raw)
To: Jeff Garzik, Francois Romieu, Linux kernel mailing list, jt,
Dan Williams, Pavel Roskin, Orinoco Development List
Update copyright messages, module meta-information, banner comments
and the MAINTAINERS file to better reflect the current
authorship/maintainership status. In particular puts Pavel Roskin as
the most prominently displayed maintainer, since he has done nearly
all non-trivial work on the driver for a year or more.
Signed-off-by: David Gibson <hermes@gibson.dropbear.id.au>
Index: working-2.6/drivers/net/wireless/hermes.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/hermes.c 2004-07-28 15:05:54.285393200 +1000
+++ working-2.6/drivers/net/wireless/hermes.c 2004-07-28 15:05:55.308237704 +1000
@@ -13,8 +13,8 @@
* (wvlan_hcf.c) library, and the NetBSD wireless driver (in no
* particular order).
*
- * Copyright (C) 2000, David Gibson, Linuxcare Australia <hermes@gibson.dropbear.id.au>
- * Copyright (C) 2001, David Gibson, IBM <hermes@gibson.dropbear.id.au>
+ * Copyright (C) 2000, David Gibson, Linuxcare Australia.
+ * (C) Copyright David Gibson, IBM Corp. 2001-2003.
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
@@ -53,7 +53,8 @@
#include "hermes.h"
MODULE_DESCRIPTION("Low-level driver helper for Lucent Hermes chipset and Prism II HFA384x wireless MAC controller");
-MODULE_AUTHOR("David Gibson <hermes@gibson.dropbear.id.au>");
+MODULE_AUTHOR("Pavel Roskin <proski@gnu.org>"
+ " & David Gibson <hermes@gibson.dropbear.id.au>");
MODULE_LICENSE("Dual MPL/GPL");
/* These are maximum timeouts. Most often, card wil react much faster */
Index: working-2.6/drivers/net/wireless/orinoco.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco.c 2004-07-28 15:05:54.296391528 +1000
+++ working-2.6/drivers/net/wireless/orinoco.c 2004-07-28 15:05:55.347231776 +1000
@@ -1,18 +1,23 @@
-/* orinoco.c 0.13e - (formerly known as dldwd_cs.c and orinoco_cs.c)
+/* orinoco.c - (formerly known as dldwd_cs.c and orinoco_cs.c)
*
* A driver for Hermes or Prism 2 chipset based PCMCIA wireless
* adaptors, with Lucent/Agere, Intersil or Symbol firmware.
*
- * Copyright (C) 2000 David Gibson, Linuxcare Australia <hermes AT gibson.dropbear.id.au>
+ * Current maintainers (as of 29 September 2003) are:
+ * Pavel Roskin <proski AT gnu.org>
+ * and David Gibson <hermes AT gibson.dropbear.id.au>
+ *
+ * (C) Copyright David Gibson, IBM Corporation 2001-2003.
+ * Copyright (C) 2000 David Gibson, Linuxcare Australia.
* With some help from :
- * Copyright (C) 2001 Jean Tourrilhes, HP Labs <jt AT hpl.hp.com>
- * Copyright (C) 2001 Benjamin Herrenschmidt <benh AT kernel.crashing.org>
+ * Copyright (C) 2001 Jean Tourrilhes, HP Labs
+ * Copyright (C) 2001 Benjamin Herrenschmidt
*
* Based on dummy_cs.c 1.27 2000/06/12 21:27:25
*
* Portions based on wvlan_cs.c 1.0.6, Copyright Andreas Neuhaus <andy
* AT fasta.fh-dortmund.de>
- * http://www.fasta.fh-dortmund.de/users/andy/wvlan/
+ * http://www.stud.fh-dortmund.de/~andy/wvlan/
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
@@ -449,7 +454,7 @@
/* Module information */
/********************************************************************/
-MODULE_AUTHOR("David Gibson <hermes@gibson.dropbear.id.au>");
+MODULE_AUTHOR("Pavel Roskin <proski@gnu.org> & David Gibson <hermes@gibson.dropbear.id.au>");
MODULE_DESCRIPTION("Driver for Lucent Orinoco, Prism II based and similar wireless cards");
MODULE_LICENSE("Dual MPL/GPL");
@@ -4182,7 +4187,8 @@
/* Can't be declared "const" or the whole __initdata section will
* become const */
static char version[] __initdata = DRIVER_NAME " " DRIVER_VERSION
- " (David Gibson <hermes@gibson.dropbear.id.au> and others)";
+ " (David Gibson <hermes@gibson.dropbear.id.au>, "
+ "Pavel Roskin <proski@gnu.org>, et al)";
static int __init init_orinoco(void)
{
Index: working-2.6/drivers/net/wireless/orinoco_pci.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco_pci.c 2004-07-28 15:05:52.559655552 +1000
+++ working-2.6/drivers/net/wireless/orinoco_pci.c 2004-07-28 15:05:55.349231472 +1000
@@ -1,10 +1,14 @@
-/* orinoco_pci.c 0.13e
+/* orinoco_pci.c
*
* Driver for Prism II devices that have a direct PCI interface
* (i.e., not in a Pcmcia or PLX bridge)
*
* Specifically here we're talking about the Linksys WMP11
*
+ * Current maintainers (as of 29 September 2003) are:
+ * Pavel Roskin <proski AT gnu.org>
+ * and David Gibson <hermes AT gibson.dropbear.id.au>
+ *
* Some of this code is borrowed from orinoco_plx.c
* Copyright (C) 2001 Daniel Barlow <dan AT telent.net>
* Some of this code is "inspired" by linux-wlan-ng-0.1.10, but nothing
@@ -13,7 +17,7 @@
* This file originally written by:
* Copyright (C) 2001 Jean Tourrilhes <jt AT hpl.hp.com>
* And is now maintained by:
- * Copyright (C) 2002 David Gibson, IBM Corporation <herme AT gibson.dropbear.id.au>
+ * (C) Copyright David Gibson, IBM Corp. 2002-2003.
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
@@ -379,8 +383,10 @@
};
static char version[] __initdata = DRIVER_NAME " " DRIVER_VERSION
- " (David Gibson <hermes@gibson.dropbear.id.au> & Jean Tourrilhes <jt@hpl.hp.com>)";
-MODULE_AUTHOR("David Gibson <hermes@gibson.dropbear.id.au>");
+ " (Pavel Roskin <proski@gnu.org>,"
+ " David Gibson <hermes@gibson.dropbear.id.au> &"
+ " Jean Tourrilhes <jt@hpl.hp.com>)";
+MODULE_AUTHOR("Pavel Roskin <proski@gnu.org> & David Gibson <hermes@gibson.dropbear.id.au>");
MODULE_DESCRIPTION("Driver for wireless LAN cards using direct PCI interface");
MODULE_LICENSE("Dual MPL/GPL");
Index: working-2.6/drivers/net/wireless/hermes.h
===================================================================
--- working-2.6.orig/drivers/net/wireless/hermes.h 2004-07-28 15:05:54.288392744 +1000
+++ working-2.6/drivers/net/wireless/hermes.h 2004-07-28 15:05:55.351231168 +1000
@@ -12,7 +12,8 @@
* project, the Linux wvlan_cs driver, Lucent's HCF-Light
* (wvlan_hcf.c) library, and the NetBSD wireless driver.
*
- * Copyright (C) 2000, David Gibson, Linuxcare Australia <hermes@gibson.dropbear.id.au>
+ * Copyright (C) 2000, David Gibson, Linuxcare Australia.
+ * (C) Copyright David Gibson, IBM Corp. 2001-2003.
*
* Portions taken from hfa384x.h, Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved.
*
Index: working-2.6/drivers/net/wireless/orinoco_tmd.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco_tmd.c 2004-07-28 15:05:52.560655400 +1000
+++ working-2.6/drivers/net/wireless/orinoco_tmd.c 2004-07-28 15:05:55.352231016 +1000
@@ -1,10 +1,10 @@
-/* orinoco_tmd.c 0.01
+/* orinoco_tmd.c
*
* Driver for Prism II devices which would usually be driven by orinoco_cs,
* but are connected to the PCI bus by a TMD7160.
*
* Copyright (C) 2003 Joerg Dorchain <joerg AT dorchain.net>
- * based heavily upon orinoco_plx.c Copyright (C) 2001 Daniel Barlow <dan AT telent.net>
+ * based heavily upon orinoco_plx.c Copyright (C) 2001 Daniel Barlow
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
Index: working-2.6/drivers/net/wireless/orinoco_cs.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco_cs.c 2004-07-28 15:05:49.950052272 +1000
+++ working-2.6/drivers/net/wireless/orinoco_cs.c 2004-07-28 15:05:55.353230864 +1000
@@ -1,4 +1,4 @@
-/* orinoco_cs.c 0.13e - (formerly known as dldwd_cs.c)
+/* orinoco_cs.c (formerly known as dldwd_cs.c)
*
* A driver for "Hermes" chipset based PCMCIA wireless adaptors, such
* as the Lucent WavelanIEEE/Orinoco cards and their OEM (Cabletron/
@@ -629,7 +629,8 @@
/* Can't be declared "const" or the whole __initdata section will
* become const */
static char version[] __initdata = DRIVER_NAME " " DRIVER_VERSION
- "(David Gibson <hermes@gibson.dropbear.id.au> and others)";
+ " (David Gibson <hermes@gibson.dropbear.id.au>, "
+ "Pavel Roskin <proski@gnu.org>, et al)";
static struct pcmcia_driver orinoco_driver = {
.owner = THIS_MODULE,
Index: working-2.6/drivers/net/wireless/airport.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/airport.c 2004-07-28 15:05:49.958051056 +1000
+++ working-2.6/drivers/net/wireless/airport.c 2004-07-28 15:05:55.355230560 +1000
@@ -1,4 +1,4 @@
-/* airport.c 0.13e
+/* airport.c
*
* A driver for "Hermes" chipset based Apple Airport wireless
* card.
Index: working-2.6/drivers/net/wireless/orinoco_plx.c
===================================================================
--- working-2.6.orig/drivers/net/wireless/orinoco_plx.c 2004-07-28 15:05:52.561655248 +1000
+++ working-2.6/drivers/net/wireless/orinoco_plx.c 2004-07-28 15:05:55.357230256 +1000
@@ -1,9 +1,14 @@
-/* orinoco_plx.c 0.13e
- *
+/* orinoco_plx.c
+ *
* Driver for Prism II devices which would usually be driven by orinoco_cs,
* but are connected to the PCI bus by a PLX9052.
*
- * Copyright (C) 2001 Daniel Barlow <dan AT telent.net>
+ * Current maintainers (as of 29 September 2003) are:
+ * Pavel Roskin <proski AT gnu.org>
+ * and David Gibson <hermes AT gibson.dropbear.id.au>
+ *
+ * (C) Copyright David Gibson, IBM Corp. 2001-2003.
+ * Copyright (C) 2001 Daniel Barlow
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.1 (the "License"); you may not use this file except in
@@ -331,7 +336,9 @@
};
static char version[] __initdata = DRIVER_NAME " " DRIVER_VERSION
- " (Daniel Barlow <dan@telent.net>, David Gibson <hermes@gibson.dropbear.id.au>)";
+ " (Pavel Roskin <proski@gnu.org>,"
+ " David Gibson <hermes@gibson.dropbear.id.au>,"
+ " Daniel Barlow <dan@telent.net>)";
MODULE_AUTHOR("Daniel Barlow <dan@telent.net>");
MODULE_DESCRIPTION("Driver for wireless LAN cards using the PLX9052 PCI bridge");
MODULE_LICENSE("Dual MPL/GPL");
Index: working-2.6/MAINTAINERS
===================================================================
--- working-2.6.orig/MAINTAINERS 2004-07-27 17:02:55.000000000 +1000
+++ working-2.6/MAINTAINERS 2004-07-28 15:05:55.361229648 +1000
@@ -1576,6 +1576,8 @@
S: Maintained
ORINOCO DRIVER
+P: Pavel Roskin
+M: proski@gnu.org
P: David Gibson
M: hermes@gibson.dropbear.id.au
W: http://www.ozlabs.org/people/dgibson/dldwd
--
David Gibson | For every complex problem there is a
david AT gibson.dropbear.id.au | solution which is simple, neat and
| wrong.
http://www.ozlabs.org/people/dgibson
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [15/15] orinoco merge preliminaries - update authorship information
2004-07-28 7:01 ` [15/15] orinoco merge preliminaries - update authorship information David Gibson
@ 2004-07-28 16:55 ` Jeff Garzik
0 siblings, 0 replies; 31+ messages in thread
From: Jeff Garzik @ 2004-07-28 16:55 UTC (permalink / raw)
To: David Gibson
Cc: Francois Romieu, Linux kernel mailing list, jt, Dan Williams,
Pavel Roskin, Orinoco Development List
all 15 patches applied to the netdev-2.6 queue, thanks.
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [6/15] orinoco merge preliminaries - spam stoppers
2004-07-28 6:55 ` [6/15] orinoco merge preliminaries - spam stoppers David Gibson
2004-07-28 6:56 ` [7/15] orinoco merge preliminaries - comment/whitespace/spelling updates David Gibson
@ 2004-07-28 17:36 ` Matt Mackall
1 sibling, 0 replies; 31+ messages in thread
From: Matt Mackall @ 2004-07-28 17:36 UTC (permalink / raw)
To: Jeff Garzik, Francois Romieu, Linux kernel mailing list, jt,
Dan Williams, Pavel Roskin, Orinoco Development List
On Wed, Jul 28, 2004 at 04:55:50PM +1000, David Gibson wrote:
> Anti-spam obfuscate most email addresses in the orinoco driver files.
> Yes, this is closing gate long after the sheep have run, but I guess
> it can't hurt.
>
> Signed-off-by: David Gibson <hermes@gibson.dropbear.id.au>
Hmmm. What's wrong with this picture?
--
Mathematics is the supreme nostalgia of our time.
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [0/15] orinoco merge preliminaries
2004-07-28 6:51 ` [0/15] orinoco merge preliminaries David Gibson
2004-07-28 6:53 ` [1/15] orinoco merge preliminaries - squash backwards compatibility David Gibson
@ 2004-07-28 22:50 ` Francois Romieu
2004-07-29 0:19 ` David Gibson
1 sibling, 1 reply; 31+ messages in thread
From: Francois Romieu @ 2004-07-28 22:50 UTC (permalink / raw)
To: Jeff Garzik, Linux kernel mailing list, jt, Dan Williams,
Pavel Roskin, Orinoco Development List
David Gibson <hermes@gibson.dropbear.id.au> :
[...]
> Ok, patchbombing commences.
I have updated/resynced my serie on top of 2.6.8-rc2-mm1 + the 15
posted patches.
The patches are available at
http://www.fr.zoreil.com/linux/kernel/2.6.x/2.6.8-rc2-mm1/patches/
A (patch-scripts) tarball is available at:
http://www.fr.zoreil.com/linux/kernel/2.6.x/2.6.8-rc2-mm1/blob.tar.bz2
The difference with the 'for_linus' branch which is still to be splitted:
http://www.fr.zoreil.com/linux/kernel/2.6.x/2.6.8-rc2-mm1/TODO.patch
--
Ueimor
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [0/15] orinoco merge preliminaries
2004-07-28 22:50 ` [0/15] orinoco merge preliminaries Francois Romieu
@ 2004-07-29 0:19 ` David Gibson
2004-07-29 23:19 ` Francois Romieu
0 siblings, 1 reply; 31+ messages in thread
From: David Gibson @ 2004-07-29 0:19 UTC (permalink / raw)
To: Francois Romieu
Cc: Jeff Garzik, Linux kernel mailing list, jt, Dan Williams,
Pavel Roskin, Orinoco Development List
On Thu, Jul 29, 2004 at 12:50:29AM +0200, Francois Romieu wrote:
> David Gibson <hermes@gibson.dropbear.id.au> :
> [...]
> > Ok, patchbombing commences.
>
> I have updated/resynced my serie on top of 2.6.8-rc2-mm1 + the 15
> posted patches.
>
> The patches are available at
> http://www.fr.zoreil.com/linux/kernel/2.6.x/2.6.8-rc2-mm1/patches/
>
> A (patch-scripts) tarball is available at:
> http://www.fr.zoreil.com/linux/kernel/2.6.x/2.6.8-rc2-mm1/blob.tar.bz2
>
> The difference with the 'for_linus' branch which is still to be splitted:
> http://www.fr.zoreil.com/linux/kernel/2.6.x/2.6.8-rc2-mm1/TODO.patch
Ah.. note that some changes in mainline I've folded back into CVS
rather than the other way around. Also, in the process of the merge
I've made some whitespace and other such cleanups which I've folded
back into CVS. Your TODO patch has bogus diffs reverting those
changes, so you'll want to update your CVS tree and rediff.
--
David Gibson | For every complex problem there is a
david AT gibson.dropbear.id.au | solution which is simple, neat and
| wrong.
http://www.ozlabs.org/people/dgibson
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [0/15] orinoco merge preliminaries
2004-07-29 0:19 ` David Gibson
@ 2004-07-29 23:19 ` Francois Romieu
2004-09-08 15:18 ` Dan Williams
0 siblings, 1 reply; 31+ messages in thread
From: Francois Romieu @ 2004-07-29 23:19 UTC (permalink / raw)
To: Jeff Garzik, Linux kernel mailing list, jt, Dan Williams,
Pavel Roskin
David Gibson <hermes@gibson.dropbear.id.au> :
[...]
> rather than the other way around. Also, in the process of the merge
> I've made some whitespace and other such cleanups which I've folded
> back into CVS. Your TODO patch has bogus diffs reverting those
> changes, so you'll want to update your CVS tree and rediff.
Ok, I still have to merge a few of those. An updated patch-kit is available
at the usual place.
--
Ueimor
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [0/15] orinoco merge preliminaries
2004-07-29 23:19 ` Francois Romieu
@ 2004-09-08 15:18 ` Dan Williams
2004-09-09 3:13 ` Jeff Garzik
0 siblings, 1 reply; 31+ messages in thread
From: Dan Williams @ 2004-09-08 15:18 UTC (permalink / raw)
To: Francois Romieu
Cc: Jeff Garzik, Linux kernel mailing list, jt, Pavel Roskin,
David Gibson
Guys,
I see Francois has a lot of split patches available at his website.
Francois: is the patchlist you have complete?
David: Are Francois' patches correct?
Jeff: If so, what's the status on the merge?
Thanks,
Dan
On Fri, 2004-07-30 at 01:19 +0200, Francois Romieu wrote:
> David Gibson <hermes@gibson.dropbear.id.au> :
> [...]
> > rather than the other way around. Also, in the process of the merge
> > I've made some whitespace and other such cleanups which I've folded
> > back into CVS. Your TODO patch has bogus diffs reverting those
> > changes, so you'll want to update your CVS tree and rediff.
>
> Ok, I still have to merge a few of those. An updated patch-kit is available
> at the usual place.
>
> --
> Ueimor
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [0/15] orinoco merge preliminaries
2004-09-08 15:18 ` Dan Williams
@ 2004-09-09 3:13 ` Jeff Garzik
2004-09-09 19:51 ` Francois Romieu
0 siblings, 1 reply; 31+ messages in thread
From: Jeff Garzik @ 2004-09-09 3:13 UTC (permalink / raw)
To: Dan Williams
Cc: Francois Romieu, Linux kernel mailing list, jt, Pavel Roskin,
David Gibson
Dan Williams wrote:
> Guys,
>
> I see Francois has a lot of split patches available at his website.
>
> Francois: is the patchlist you have complete?
> David: Are Francois' patches correct?
> Jeff: If so, what's the status on the merge?
I merged a bunch of David's patches, so at the very least I think
Francois's patches would need re-diffing.
Jeff
^ permalink raw reply [flat|nested] 31+ messages in thread
* Re: [0/15] orinoco merge preliminaries
2004-09-09 3:13 ` Jeff Garzik
@ 2004-09-09 19:51 ` Francois Romieu
0 siblings, 0 replies; 31+ messages in thread
From: Francois Romieu @ 2004-09-09 19:51 UTC (permalink / raw)
To: Jeff Garzik
Cc: Dan Williams, Linux kernel mailing list, jt, Pavel Roskin,
David Gibson
Jeff Garzik <jgarzik@pobox.com> :
[...]
> >Francois: is the patchlist you have complete?
No.
I'll spend some time on it next week. Current week is dedicated to
the r8169.
[...]
> I merged a bunch of David's patches, so at the very least I think
> Francois's patches would need re-diffing.
<evil cunning plan>
David's patches have been part of my serie since 07/30/2004
</evil cunning plan>
http://www.zoreil.com/linux/kernel/2.6.x/2.6.9-rc1-mm4 contains the
instant (no-)rediff.
--
Ueimor
^ permalink raw reply [flat|nested] 31+ messages in thread
end of thread, other threads:[~2004-09-09 20:05 UTC | newest]
Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-12 19:33 [PATCH] Slowly update in-kernel orinoco drivers to upstream current CVS Francois Romieu
2004-07-14 18:37 ` Jeff Garzik
2004-07-15 1:01 ` David Gibson
2004-07-17 11:45 ` Francois Romieu
2004-07-27 17:18 ` Jeff Garzik
2004-07-28 6:51 ` [0/15] orinoco merge preliminaries David Gibson
2004-07-28 6:53 ` [1/15] orinoco merge preliminaries - squash backwards compatibility David Gibson
2004-07-28 6:53 ` [2/15] orinoco merge preliminaries - rearrange code David Gibson
2004-07-28 6:54 ` [3/15] orinoco merge preliminaries - use netdev_priv() David Gibson
2004-07-28 6:54 ` [4/15] orinoco merge preliminaries - use ALIGN() David Gibson
2004-07-28 6:55 ` [5/15] orinoco merge preliminaries - use ARRAY_SIZE() David Gibson
2004-07-28 6:55 ` [6/15] orinoco merge preliminaries - spam stoppers David Gibson
2004-07-28 6:56 ` [7/15] orinoco merge preliminaries - comment/whitespace/spelling updates David Gibson
2004-07-28 6:57 ` [8/15] orinoco merge preliminaries - use BUG_ON() David Gibson
2004-07-28 6:58 ` [9/15] orinoco merge preliminaries - make things static David Gibson
2004-07-28 6:58 ` [10/15] orinoco merge preliminaries - miscelaneous David Gibson
2004-07-28 6:59 ` [11/15] orinoco merge preliminaries - use name/version macros David Gibson
2004-07-28 6:59 ` [12/15] orinoco merge preliminaries - remove unneeded #includes David Gibson
2004-07-28 7:00 ` [13/15] orinoco merge preliminaries - don't typedef structs David Gibson
2004-07-28 7:00 ` [14/15] orinoco merge preliminaries - more HW data David Gibson
2004-07-28 7:01 ` [15/15] orinoco merge preliminaries - update authorship information David Gibson
2004-07-28 16:55 ` Jeff Garzik
2004-07-28 17:36 ` [6/15] orinoco merge preliminaries - spam stoppers Matt Mackall
2004-07-28 22:50 ` [0/15] orinoco merge preliminaries Francois Romieu
2004-07-29 0:19 ` David Gibson
2004-07-29 23:19 ` Francois Romieu
2004-09-08 15:18 ` Dan Williams
2004-09-09 3:13 ` Jeff Garzik
2004-09-09 19:51 ` Francois Romieu
2004-07-14 20:15 ` [PATCH] Slowly update in-kernel orinoco drivers to upstream current CVS Pavel Roskin
2004-07-15 1:26 ` David Gibson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox