* airo.c patches
@ 2005-10-31 20:14 Bill Moss
2005-10-31 21:25 ` John W. Linville
0 siblings, 1 reply; 2+ messages in thread
From: Bill Moss @ 2005-10-31 20:14 UTC (permalink / raw)
To: netdev; +Cc: breed
Below are three patches to
/usr/src/kernels/2.6.13-1.1532_FC4-i686/drivers/net/wireless/airo.c for
your consideration.
Patch one. Remove 3 second delay in returning scan results. This delay
appears to be unnecessary. Users of NetworkManager have found that this
delay makes NetworkManager slow to connect in certain scenarios. Testing
has shown no ill effect of removing this delay. This delay does not
appear in other drivers such as ipw2200/ieee80211
--- airo.c_orig 2005-10-28 20:06:40.000000000 -0400
+++ airo.c 2005-10-28 20:08:16.000000000 -0400
@@ -6918,7 +6918,7 @@
/* When we are associated again, the scan has surely finished.
* Just in case, let's make sure enough time has elapsed since
* we started the scan. - Javier */
- if(ai->scan_timestamp &&
time_before(jiffies,ai->scan_timestamp+3*HZ)) {
+ if(ai->scan_timestamp && time_before(jiffies,ai->scan_timestamp)) {
/* Important note : we don't want to block the caller
* until results are ready for various reasons.
* First, managing wait queues is complex and racy
Patch two. Report the channel correctly in the output from iwlist.
--- airo.c_orig 2005-10-28 20:06:40.000000000 -0400
+++ airo.c 2005-10-28 20:16:59.000000000 -0400
@@ -6846,7 +6846,7 @@
/* Add frequency */
iwe.cmd = SIOCGIWFREQ;
iwe.u.freq.m = le16_to_cpu(bss->dsChannel);
- iwe.u.freq.m = frequency_list[iwe.u.freq.m] * 100000;
+ iwe.u.freq.m = frequency_list[iwe.u.freq.m-1] * 100000;
iwe.u.freq.e = 1;
current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe,
IW_EV_FREQ_LEN);
Patch three. Introduce minimal ethtool support. Report driver name and
version. Report link (association). This code was cloned from
ipw2200/ieee80211. Ethtool support is used by NetworkManager.
--- airo.c_orig 2005-10-28 20:06:40.000000000 -0400
+++ airo.c 2005-10-28 20:21:55.000000000 -0400
@@ -39,6 +39,7 @@
#include <asm/system.h>
#include <linux/netdevice.h>
+#include <linux/ethtool.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/if_arp.h>
@@ -46,6 +47,10 @@
#include <linux/pci.h>
#include <asm/uaccess.h>
+#define DRV_NAME "airo"
+#define AIRO_VERSION "0.6 (Ben Reed & Javier Achirica)"
+#define DRV_VERSION AIRO_VERSION
+
#ifdef CONFIG_PCI
static struct pci_device_id card_ids[] = {
{ 0x14b9, 1, PCI_ANY_ID, PCI_ANY_ID, },
@@ -65,7 +70,7 @@
static int airo_pci_resume(struct pci_dev *pdev);
static struct pci_driver airo_driver = {
- .name = "airo",
+ .name = DRV_NAME,
.id_table = card_ids,
.probe = airo_pci_probe,
.remove = __devexit_p(airo_pci_remove),
@@ -1069,7 +1074,7 @@
static const struct iw_handler_def airo_handler_def;
#endif /* WIRELESS_EXT */
-static const char version[] = "airo.c 0.6 (Ben Reed & Javier Achirica)";
+static const char version[] = DRV_VERSION;
struct airo_info;
@@ -2318,6 +2323,28 @@
return 0;
}
+static void airo_ethtool_get_drvinfo(struct net_device *dev,
+ struct ethtool_drvinfo
*info)
+{
+ strcpy(info->driver, DRV_NAME);
+ strcpy(info->version, DRV_VERSION);
+}
+
+static u32 airo_ethtool_get_link(struct net_device *dev)
+{
+ struct airo_info *local = dev->priv;
+ StatusRid status_rid;
+
+ readStatusRid(local, &status_rid, 1);
+
+ return (status_rid.assocStatus == STAT_ASSOCIATED);
+}
+
+static struct ethtool_ops airo_ethtool_ops = {
+ .get_link = airo_ethtool_get_link,
+ .get_drvinfo = airo_ethtool_get_drvinfo,
+};
+
static int airo_change_mtu(struct net_device *dev, int new_mtu)
{
if ((new_mtu < 68) || (new_mtu > 2400))
@@ -2757,6 +2784,7 @@
dev->change_mtu = &airo_change_mtu;
dev->open = &airo_open;
dev->stop = &airo_close;
+ dev->ethtool_ops = &airo_ethtool_ops;
dev->irq = irq;
dev->base_addr = port;
--
Bill Moss
Professor, Mathematical Sciences
Clemson University
--
Bill Moss
Professor, Mathematical Sciences
Clemson University
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: airo.c patches
2005-10-31 20:14 airo.c patches Bill Moss
@ 2005-10-31 21:25 ` John W. Linville
0 siblings, 0 replies; 2+ messages in thread
From: John W. Linville @ 2005-10-31 21:25 UTC (permalink / raw)
To: Bill Moss; +Cc: netdev, breed
On Mon, Oct 31, 2005 at 03:14:46PM -0500, Bill Moss wrote:
> Below are three patches to
> /usr/src/kernels/2.6.13-1.1532_FC4-i686/drivers/net/wireless/airo.c for
> your consideration.
The intended changes look ok at first glance. However, your mailer
has mangled the patches beyond usability. There is tons of whitespace
damage, including the removal of the initial space that should preced
every unchanged line in the patch.
Also, we need a Signed-off-by: line. http://linux.yyz.us/patch-format.html
Thanks,
John
--
John W. Linville
linville@tuxdriver.com
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-10-31 21:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-31 20:14 airo.c patches Bill Moss
2005-10-31 21:25 ` John W. Linville
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).