This patch adds the vt6656 driver to drivers/staging. This code was literally
copied from the upstream source archive, available here:
http://www.viaarena.com/Driver/VT6656_Linux_src_v1.19_12_x86.zip
Copyright: VIA Networking Technologies, Inc.
License: GPL
Authors: Jerry Chen, Kyle Hsu, Lucas Lin, Lyndon Chen, Tevin Chen, Warren Hsu,
Yiching Chen
Signed-off-by: Forest Bond <[email protected]>
Patch: http://www.alittletooquiet.net/media/code/0002-Add-vt6656-driver-to-drivers-staging.patch.gz
Signature: http://www.alittletooquiet.net/media/code/0002-Add-vt6656-driver-to-drivers-staging.patch.gz.sig
Thanks,
Forest
--
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
On Wed, Apr 15, 2009 at 09:16:49PM +0200, Xose Vazquez Perez wrote:
> Dan Williams wrote:
>
> > The only fixes that drivers are getting in staging now are netdev_ops,
> > whitespace cleanups, and trivial fixes. Nobody is actually rewriting
> > the Ralink or Via staging drivers to use mac80211, which is what's
> > needed for them to be merged. Given that they are going nowhere, are
>
> Only rtl8187se and wlan-ng don't have a mac80211 port.
>
> mac80211 drivers:
>
> agnx -> http://git.sipsolutions.net/agnx.git
> at76_usb -> replacement already in kernel.org code at drivers/net/wireless/at76c50x-usb.[ch]
> otus -> replacement already in kernel.org code at drivers/net/wireless/ar9170/
> rt2860 -> rt2800pci.[ch] http://git.kernel.org/?p=linux/kernel/git/ivd/rt2x00.git
> rt2870 -> rt2800usb.[ch] http://git.kernel.org/?p=linux/kernel/git/ivd/rt2x00.git
> rt3070 -> rt2800usb.[ch] http://git.kernel.org/?p=linux/kernel/git/ivd/rt2x00.git
> rtl8187se -> ???
> stlc45xx -> replacement already in kernel.org code at drivers/net/wireless/p54/p54spi*
> winbond -> http://code.google.com/p/winbondport/
> wlan-ng -> ftp://ftp.linux-wlan.org/pub/linux-wlan-ng/FAQ ???
Thanks for the summary.
Note, whenever a "real" wireless driver goes into the tree that
obsoletes any of the staging drivers, please let me know and I'll
instantly remove it.
Right now the otus code is staying because the ar9170 developers want it
to.
But what about at76_usb? stlc45xx? Do they now have workable drivers
to replace them in the tree today? If so, _please_ let me know.
As for the other drivers, here's what I know:
rtl8187se - a varient of rtl818x, someone just needs to do the
work to add the proper parts to the existing driver. I tried,
and it wasn't obvious how to do this :(
wlan-ng - this is being cleaned up by community members for
eventual inclusion in the main tree. It only supports a single
type of USB device.
winbond - community members are cleaning it up as well.
> I hope rt2800pci/usb to be included *ASAP*, because rt2800usb supports
> more than 1oo USB devices and rt2800pci is included in a lot of
> laptops(ask Torvalds [1] [2])
>
> [1] http://marc.info/?l=linux-netdev&m=121799144422863&w=2
> [2] http://marc.info/?l=linux-kernel&m=123187052023831&w=2
That would be great to have in, what's keeping it from happening?
thanks,
greg k-h
drivers/staging/vt6655/device_main.c: Drop obsolete fsuid/fsgid accesses.
Signed-off-by: Forest Bond <[email protected]>
---
drivers/staging/vt6655/device_main.c | 22 ++++++++++++++--------
1 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
index 0d6aec9..126ecef 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -3278,15 +3278,18 @@ int Config_FileOperation(PSDevice pDevice,BOOL fwrite,unsigned char *Parameter)
UCHAR tmpbuffer[20];
struct file *filp=NULL;
mm_segment_t old_fs = get_fs();
- int oldfsuid=0,oldfsgid=0;
+ //int oldfsuid=0,oldfsgid=0;
int result=0;
set_fs (KERNEL_DS);
-//Make sure a caller can read or write power as root
- oldfsuid=current->fsuid;
- oldfsgid=current->fsgid;
- current->fsuid = 0;
- current->fsgid = 0;
+
+ /* Can't do this anymore, so we rely on correct filesystem permissions:
+ //Make sure a caller can read or write power as root
+ oldfsuid=current->cred->fsuid;
+ oldfsgid=current->cred->fsgid;
+ current->cred->fsuid = 0;
+ current->cred->fsgid = 0;
+ */
//open file
filp = filp_open(config_path, O_RDWR, 0);
@@ -3344,8 +3347,11 @@ error1:
error2:
set_fs (old_fs);
- current->fsuid=oldfsuid;
- current->fsgid=oldfsgid;
+
+ /*
+ current->cred->fsuid=oldfsuid;
+ current->cred->fsgid=oldfsgid;
+ */
return result;
}
--
1.5.4.3
--
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
Add necessary EXTRA_CFLAGS to drivers/staging/vt6655/Makefile.
Signed-off-by: Forest Bond <[email protected]>
---
drivers/staging/vt6655/Makefile | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/staging/vt6655/Makefile b/drivers/staging/vt6655/Makefile
index c9e0936..7d76e7e 100644
--- a/drivers/staging/vt6655/Makefile
+++ b/drivers/staging/vt6655/Makefile
@@ -1,3 +1,7 @@
+# TODO: all of these should be removed
+EXTRA_CFLAGS += -DLINUX -D__KERNEL__ -DMODULE -DEXPORT_SYMTAB -D__NO_VERSION__
+EXTRA_CFLAGS += -DHOSTAP
+
vt6655-y += device_main.o \
card.o \
mac.o \
--
1.5.4.3
--
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
Hi,
On Tue, Apr 14, 2009 at 09:02:48AM -0400, John W. Linville wrote:
> On Tue, Apr 14, 2009 at 02:43:54PM +0200, Johannes Berg wrote:
> > Hi Marcel,
> >
> > > just to document the irony here. Two or three years ago at OLS, Kyle and
> > > Greg were making fun of Ubuntu merging its 5th wireless stack into their
> > > kernel. Now the staging crap is doing exactly the same.
> >
> > :)
> >
> > Actually, last I counted it was already 7 or 8 stacks in staging _only_.
> > This (and the other patch) will add two more. Not to mention that of
> > course we already have something like two and a half stacks in the
> > kernel tree (mac80211, in hostapd, and libipw [former ieee80211]).
>
> FWIW I had started trying to consolidate some code between those three.
> I stalled-out a bit and got distracted with the rndis_wlan cfg80211
> bits, but I hope to get back to it. Of course, hostap seems mighty
> complex internally -- it might just have to lay there. And libipw
> and mac80211 target different types of designs, but I hope they can
> eventually share some infrastructure in lib80211.
>
> None of the above is meant to disagree about the staging crap.
> Having that stuff around is at best an optimistic attempt to help a
> few stray users... :-)
Well, gosh, I understand the criticism here and if I were a kernel developer I
imagine my perspective would be much the same. But I can't help but feel that
there's some amount of hypocrisy when we hammer on a manufacturer to properly
license their driver and then let it drop dead when they do.
I understand that the problem would be solved if they manufacturers would
suddenly "get it," but the scale of social problem preventing that is likely too
large to change anytime soon.
If kernel developers are too busy to support the hardware, why do the
manufacturers take so much criticism for releasing binary-only drivers or badly
licensed drivers, or for neglecting to release technical specifications? If
what I'm sensing is correct and there's no practical likelihood of these devices
getting in-kernel support even with those issues resolved, the criticism almost
seems unjustified.
I appreciate what the kernel developers do, of course, and my intention is not
to ruffle feathers. But when a manufacturer that has taken a lot of criticism
for its approach to the Linux community shows some good will, it seems like we
ought to be able to turn that into something productive. If we can't, what have
we been complaining about?
My apologies if I'm way off on this. I haven't been around all that long so it
is certainly possible.
Respectfully,
Forest
--
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
On Sun, Apr 19, 2009 at 04:01:46PM -0400, Forest Bond wrote:
> Hi Larry,
>
> On Sun, Apr 19, 2009 at 02:52:57PM -0500, Larry Finger wrote:
> > Forest Bond wrote:
> > >
> > > However, I did have a question:
> > >
> > > The vt6655 driver builds viawget.ko, and the vt6656 driver builds vntwusb.ko.
> > > Should the directories be named "viawget" and "vntwusb," respectively, or is it
> > > appropriate for them to be named "vt6655" and "vt6656"?
> >
> > Of course Greg has the final say, but I vote to keep the directories with the
> > vt6656 name and change the name of the driver, which is defined in the line
> > #define DEVICE_NAME "vntwusb" in file include/device_cfg.h in the vendor driver.
>
> This makes sense to me. I'll proceed this way for now. Greg, let me know if
> you'd prefer I didn't do this.
No objection from me.
thanks,
greg k-h
Hi,
[My mail server appears to be having issues. I apologize if anyone receives
more than one copy of this message.]
On Tue, Apr 14, 2009 at 09:02:48AM -0400, John W. Linville wrote:
> On Tue, Apr 14, 2009 at 02:43:54PM +0200, Johannes Berg wrote:
> > Hi Marcel,
> >
> > > just to document the irony here. Two or three years ago at OLS, Kyle and
> > > Greg were making fun of Ubuntu merging its 5th wireless stack into their
> > > kernel. Now the staging crap is doing exactly the same.
> >
> > :)
> >
> > Actually, last I counted it was already 7 or 8 stacks in staging _only_.
> > This (and the other patch) will add two more. Not to mention that of
> > course we already have something like two and a half stacks in the
> > kernel tree (mac80211, in hostapd, and libipw [former ieee80211]).
>
> FWIW I had started trying to consolidate some code between those three.
> I stalled-out a bit and got distracted with the rndis_wlan cfg80211
> bits, but I hope to get back to it. Of course, hostap seems mighty
> complex internally -- it might just have to lay there. And libipw
> and mac80211 target different types of designs, but I hope they can
> eventually share some infrastructure in lib80211.
>
> None of the above is meant to disagree about the staging crap.
> Having that stuff around is at best an optimistic attempt to help a
> few stray users... :-)
Well, gosh, I understand the criticism here and if I were a kernel developer I
imagine my perspective would be much the same. But I can't help but feel that
there's some amount of hypocrisy when we hammer on a manufacturer to properly
license their driver and then let it drop dead when they do.
I understand that the problem would be solved if they manufacturers would
suddenly "get it," but the scale of social problem preventing that is likely too
large to change anytime soon.
If kernel developers are too busy to support the hardware, why do the
manufacturers take so much criticism for releasing binary-only drivers or badly
licensed drivers, or for neglecting to release technical specifications? If
what I'm sensing is correct and there's no practical likelihood of these devices
getting in-kernel support even with those issues resolved, the criticism almost
seems unjustified.
I appreciate what the kernel developers do, of course, and my intention is not
to ruffle feathers. But when a manufacturer that has taken a lot of criticism
for its approach to the Linux community shows some good will, it seems like we
ought to be able to turn that into something productive. If we can't, what have
we been complaining about?
My apologies if I'm way off on this. I haven't been around all that long so it
is certainly possible.
Respectfully,
Forest
--
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
On Fri, Apr 24, 2009 at 07:03:29AM -0400, Forest Bond wrote:
> Hi Greg,
>
> On Sun, Apr 19, 2009 at 03:32:18PM -0700, Greg KH wrote:
> > On Sun, Apr 19, 2009 at 04:01:46PM -0400, Forest Bond wrote:
> > > On Sun, Apr 19, 2009 at 02:52:57PM -0500, Larry Finger wrote:
> > > > Forest Bond wrote:
> > > > >
> > > > > However, I did have a question:
> > > > >
> > > > > The vt6655 driver builds viawget.ko, and the vt6656 driver builds vntwusb.ko.
> > > > > Should the directories be named "viawget" and "vntwusb," respectively, or is it
> > > > > appropriate for them to be named "vt6655" and "vt6656"?
> > > >
> > > > Of course Greg has the final say, but I vote to keep the directories with the
> > > > vt6656 name and change the name of the driver, which is defined in the line
> > > > #define DEVICE_NAME "vntwusb" in file include/device_cfg.h in the vendor driver.
> > >
> > > This makes sense to me. I'll proceed this way for now. Greg, let me know if
> > > you'd prefer I didn't do this.
> >
> > No objection from me.
>
> The following git repository has a vt6655 branch and a vt6656 branch:
>
> http://www.alittletooquiet.net/media/code/vt665x.git
>
> The vt6655 branch contains pretty much all of the work I'll likely be able to do
> for that driver. The vt6656 branch needs more work. I've not gone farther than
> build-testing either, at this point.
>
> As I've mentioned before, some of this kind of work is really a bit outside my
> usual domain, so if you do look at it, I'd appreciate feedback.
>
> Feel free to make requests.
Could you send it out as patches so it's easier to review?
thanks,
greg k-h
On Tue, Apr 14, 2009 at 02:43:54PM +0200, Johannes Berg wrote:
> Hi Marcel,
>
> > just to document the irony here. Two or three years ago at OLS, Kyle and
> > Greg were making fun of Ubuntu merging its 5th wireless stack into their
> > kernel. Now the staging crap is doing exactly the same.
>
> :)
>
> Actually, last I counted it was already 7 or 8 stacks in staging _only_.
> This (and the other patch) will add two more. Not to mention that of
> course we already have something like two and a half stacks in the
> kernel tree (mac80211, in hostapd, and libipw [former ieee80211]).
FWIW I had started trying to consolidate some code between those three.
I stalled-out a bit and got distracted with the rndis_wlan cfg80211
bits, but I hope to get back to it. Of course, hostap seems mighty
complex internally -- it might just have to lay there. And libipw
and mac80211 target different types of designs, but I hope they can
eventually share some infrastructure in lib80211.
None of the above is meant to disagree about the staging crap.
Having that stuff around is at best an optimistic attempt to help a
few stray users... :-)
John
--
John W. Linville Someday the world will need a hero, and you
[email protected] might be all we have. Be ready.
On Tue, 2009-04-14 at 07:39 -0400, Forest Bond wrote:
> > Can we also please add files here saying to not bother the
> > linux-wireless list about this crap?
>
> I would assume this is somewhat implied for any code in drivers/staging. Is
> that not the case?
It seems to be on a per case basis -- and there's one driver at least
(agnx) that we actually do care about because it is there only because
it's incomplete not because the code is in some way problematic (like
using its own 802.11 stack)
johannes
Build vt6655.ko, not viawget.ko.
Signed-off-by: Forest Bond <[email protected]>
---
drivers/staging/vt6655/device_cfg.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/vt6655/device_cfg.h b/drivers/staging/vt6655/device_cfg.h
index 9e18f7c..6af9067 100644
--- a/drivers/staging/vt6655/device_cfg.h
+++ b/drivers/staging/vt6655/device_cfg.h
@@ -86,7 +86,7 @@ struct _version {
#define VCAM_SIZE 32
#define TX_QUEUE_NO 8
-#define DEVICE_NAME "viawget"
+#define DEVICE_NAME "vt6655"
#define DEVICE_FULL_DRV_NAM "VIA Networking Solomon-A/B/G Wireless LAN Adapter Driver"
#ifndef MAJOR_VERSION
--
1.5.4.3
--
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
On Sat, Apr 18, 2009 at 11:18:56PM +0200, Ivo van Doorn wrote:
> Hi,
>
> > > I hope rt2800pci/usb to be included *ASAP*, because rt2800usb supports
> > > more than 1oo USB devices and rt2800pci is included in a lot of
> > > laptops(ask Torvalds [1] [2])
> > >
> > > [1] http://marc.info/?l=linux-netdev&m=121799144422863&w=2
> > > [2] http://marc.info/?l=linux-kernel&m=123187052023831&w=2
> >
> > That would be great to have in, what's keeping it from happening?
>
> In short: A stable workable driver.
>
> The rt2800usb driver is pretty far (at least on my testsetup), but
> still has problems with transmitting frames immediately after
> association.
I read this as "it works, but some frames are lost immediately after
association" -- is that right? FWIW, this sounds good enough to me
to get it into the mainline kernel. _Please_ submit the rt2800usb
driver for wireless-testing/linux-next ASAP!
John
--
John W. Linville Someday the world will need a hero, and you
[email protected] might be all we have. Be ready.
On Mon, Apr 20, 2009 at 3:59 PM, John W. Linville
<[email protected]> wrote:
> On Sat, Apr 18, 2009 at 11:18:56PM +0200, Ivo van Doorn wrote:
>> Hi,
>>
>> > > I hope rt2800pci/usb to be included *ASAP*, because rt2800usb su=
pports
>> > > more than 1oo USB devices and rt2800pci is included in a lot of
>> > > laptops(ask Torvalds [1] [2])
>> > >
>> > > [1] http://marc.info/?l=3Dlinux-netdev&m=3D121799144422863&w=3D2
>> > > [2] http://marc.info/?l=3Dlinux-kernel&m=3D123187052023831&w=3D2
>> >
>> > That would be great to have in, what's keeping it from happening?
>>
>> In short: A stable workable driver.
>>
>> The rt2800usb driver is pretty far (at least on my testsetup), but
>> still has problems with transmitting frames immediately after
>> association.
>
> I read this as "it works, but some frames are lost immediately after
> association" -- is that right?
It is not "Some frames" it is "All frames" you can't get a DHCP lease,
or use a static IP and try to do anything.
Also 11n APs are not detected at all, which for a 11n client sounds
very problematic.
> FWIW, this sounds good enough to me
> to get it into the mainline kernel. =A0_Please_ submit the rt2800usb
> driver for wireless-testing/linux-next ASAP!
If the above 2 problems aren't critical for merge, then I'll send the
patches as soon as possible.
Ivo
vt6655: Replace net_device->priv accesses with netdev_priv calls.
Signed-off-by: Forest Bond <[email protected]>
---
drivers/staging/vt6655/device_main.c | 29 ++++++---------
drivers/staging/vt6655/hostap.c | 8 +++--
drivers/staging/vt6655/iwctl.c | 62 +++++++++++++++++-----------------
drivers/staging/vt6655/wpactl.c | 7 +++-
4 files changed, 53 insertions(+), 53 deletions(-)
diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
index 126ecef..ca198a2 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -995,12 +995,14 @@ device_found1(struct pci_dev *pcid, const struct pci_device_id *ent)
return -ENODEV;
}
-
+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
- dev = alloc_etherdev(0);
+ dev = alloc_etherdev(sizeof(DEVICE_INFO));
#else
dev = init_etherdev(dev, 0);
#endif
+
+ pDevice = (PSDevice) netdev_priv(dev);
if (dev == NULL) {
printk(KERN_ERR DEVICE_NAME ": allocate net device failed \n");
@@ -1025,7 +1027,6 @@ device_found1(struct pci_dev *pcid, const struct pci_device_id *ent)
pDevice->dev = dev;
pDevice->next_module = root_device_dev;
root_device_dev = dev;
- dev->priv = pDevice;
dev->irq = pcid->irq;
if (pci_enable_device(pcid)) {
@@ -1226,11 +1227,6 @@ static BOOL device_init_info(struct pci_dev* pcid, PSDevice* ppDevice,
PSDevice p;
- *ppDevice = kmalloc(sizeof(DEVICE_INFO),GFP_ATOMIC);
-
- if (*ppDevice == NULL)
- return FALSE;
-
memset(*ppDevice,0,sizeof(DEVICE_INFO));
if (pDevice_Infos == NULL) {
@@ -2059,7 +2055,7 @@ int __device_open(HANDLE pExDevice) {
#else
static int device_open(struct net_device *dev) {
- PSDevice pDevice=(PSDevice) dev->priv;
+ PSDevice pDevice=(PSDevice) netdev_priv(dev);
int i;
#endif
pDevice->rx_buf_sz = PKT_BUF_SZ;
@@ -2212,7 +2208,7 @@ int __device_close(HANDLE pExDevice) {
#else
static int device_close(struct net_device *dev) {
- PSDevice pDevice=(PSDevice) dev->priv;
+ PSDevice pDevice=(PSDevice) netdev_priv(dev);
#endif
PSMgmtObject pMgmt = pDevice->pMgmt;
//PLICE_DEBUG->
@@ -2282,7 +2278,7 @@ int __device_dma0_tx_80211(HANDLE pExDevice, struct sk_buff *skb) {
static int device_dma0_tx_80211(struct sk_buff *skb, struct net_device *dev) {
- PSDevice pDevice=dev->priv;
+ PSDevice pDevice=netdev_priv(dev);
#endif
PBYTE pbMPDU;
UINT cbMPDULen = 0;
@@ -2494,7 +2490,7 @@ int __device_xmit(HANDLE pExDevice, struct sk_buff *skb) {
#else
static int device_xmit(struct sk_buff *skb, struct net_device *dev) {
- PSDevice pDevice=dev->priv;
+ PSDevice pDevice=netdev_priv(dev);
#endif
PSMgmtObject pMgmt = pDevice->pMgmt;
@@ -2950,7 +2946,7 @@ int __device_intr(int irq, HANDLE pExDevice, struct pt_regs *regs) {
#else
static irqreturn_t device_intr(int irq, void *dev_instance) {
struct net_device* dev=dev_instance;
- PSDevice pDevice=(PSDevice) dev->priv;
+ PSDevice pDevice=(PSDevice) netdev_priv(dev);
#endif
int max_count=0;
@@ -3367,7 +3363,7 @@ void __device_set_multi(HANDLE pExDevice) {
#else
static void device_set_multi(struct net_device *dev) {
- PSDevice pDevice = (PSDevice) dev->priv;
+ PSDevice pDevice = (PSDevice) netdev_priv(dev);
#endif
PSMgmtObject pMgmt = pDevice->pMgmt;
@@ -3441,7 +3437,7 @@ struct net_device_stats *__device_get_stats(HANDLE pExDevice) {
#else
static struct net_device_stats *device_get_stats(struct net_device *dev) {
- PSDevice pDevice=(PSDevice) dev->priv;
+ PSDevice pDevice=(PSDevice) netdev_priv(dev);
#endif
return &pDevice->stats;
@@ -3458,7 +3454,7 @@ int __device_ioctl(HANDLE pExDevice, struct ifreq *rq, int cmd) {
#else
static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) {
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
#endif
#ifdef WIRELESS_EXT
@@ -4116,7 +4112,6 @@ int __device_hw_init(HANDLE pExDevice){
PSDevice_info pDevice_info = (PSDevice_info)pExDevice;
PSDevice pDevice;
-
pDevice = (PSDevice)kmalloc(sizeof(DEVICE_INFO), (int)GFP_ATOMIC);
if (pDevice == NULL)
return FALSE;
diff --git a/drivers/staging/vt6655/hostap.c b/drivers/staging/vt6655/hostap.c
index 7c47f5d..8c52625 100644
--- a/drivers/staging/vt6655/hostap.c
+++ b/drivers/staging/vt6655/hostap.c
@@ -100,6 +100,7 @@ static int msglevel =MSG_LEVEL_INFO;
static int hostap_enable_hostapd(PSDevice pDevice, int rtnl_locked)
{
+ PSDevice apdev_priv;
struct net_device *dev = pDevice->dev;
int ret;
@@ -124,12 +125,13 @@ static int hostap_enable_hostapd(PSDevice pDevice, int rtnl_locked)
dev->name, pDevice->apdev->name);
#else
- pDevice->apdev = (struct net_device *)kmalloc(sizeof(struct net_device), GFP_KERNEL);
+ pDevice->apdev = (struct net_device *)kmalloc(sizeof(struct net_device), GFP_KERNEL);
if (pDevice->apdev == NULL)
return -ENOMEM;
memset(pDevice->apdev, 0, sizeof(struct net_device));
-
- pDevice->apdev->priv = pDevice;
+
+ apdev_priv = netdev_priv(pDevice->apdev);
+ *apdev_priv = *pDevice;
memcpy(pDevice->apdev->dev_addr, dev->dev_addr, ETH_ALEN);
pDevice->apdev->hard_start_xmit = pDevice->tx_80211;
pDevice->apdev->type = ARPHRD_IEEE80211;
diff --git a/drivers/staging/vt6655/iwctl.c b/drivers/staging/vt6655/iwctl.c
index 48e63f8..d8d72c6 100644
--- a/drivers/staging/vt6655/iwctl.c
+++ b/drivers/staging/vt6655/iwctl.c
@@ -113,7 +113,7 @@ static int msglevel =MSG_LEVEL_INFO;
struct iw_statistics *iwctl_get_wireless_stats(struct net_device *dev)
{
- PSDevice pDevice = dev->priv;
+ PSDevice pDevice = netdev_priv(dev);
long ldBm;
pDevice->wstats.status = pDevice->eOPMode;
#ifdef Calcu_LinkQual
@@ -209,7 +209,7 @@ int iwctl_siwscan(struct net_device *dev,
struct iw_point *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
struct iw_scan_req *req = (struct iw_scan_req *)extra;
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
BYTE abyScanSSID[WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1];
@@ -276,7 +276,7 @@ int iwctl_giwscan(struct net_device *dev,
char *extra)
{
int ii, jj, kk;
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
PKnownBSS pBSS;
PWLAN_IE_SSID pItemSSID;
@@ -522,7 +522,7 @@ int iwctl_siwfreq(struct net_device *dev,
struct iw_freq *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
int rc = 0;
DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCSIWFREQ \n");
@@ -568,7 +568,7 @@ int iwctl_giwfreq(struct net_device *dev,
struct iw_freq *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCGIWFREQ \n");
@@ -598,7 +598,7 @@ int iwctl_siwmode(struct net_device *dev,
__u32 *wmode,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
int rc = 0;
@@ -665,7 +665,7 @@ int iwctl_giwmode(struct net_device *dev,
__u32 *wmode,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
@@ -819,7 +819,7 @@ int iwctl_siwap(struct net_device *dev,
struct sockaddr *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
int rc = 0;
BYTE ZeroBSSID[WLAN_BSSID_LEN]={0x00,0x00,0x00,0x00,0x00,0x00};
@@ -877,7 +877,7 @@ int iwctl_giwap(struct net_device *dev,
struct sockaddr *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
@@ -911,7 +911,7 @@ int iwctl_giwaplist(struct net_device *dev,
int ii,jj, rc = 0;
struct sockaddr sock[IW_MAX_AP];
struct iw_quality qual[IW_MAX_AP];
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
@@ -960,7 +960,7 @@ int iwctl_siwessid(struct net_device *dev,
struct iw_point *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
PWLAN_IE_SSID pItemSSID;
//2008-0409-05, <Add> by Einsn Liu
@@ -1089,7 +1089,7 @@ int iwctl_giwessid(struct net_device *dev,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
PWLAN_IE_SSID pItemSSID;
@@ -1125,7 +1125,7 @@ int iwctl_siwrate(struct net_device *dev,
struct iw_param *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
int rc = 0;
u8 brate = 0;
int i;
@@ -1210,7 +1210,7 @@ int iwctl_giwrate(struct net_device *dev,
struct iw_param *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
//2007-0118-05,<Mark> by EinsnLiu
//Mark the unnecessary sentences.
// PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
@@ -1276,7 +1276,7 @@ int iwctl_siwrts(struct net_device *dev,
struct iw_param *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
int rc = 0;
DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCSIWRTS \n");
@@ -1304,7 +1304,7 @@ int iwctl_giwrts(struct net_device *dev,
struct iw_param *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCGIWRTS \n");
wrq->value = pDevice->wRTSThreshold;
@@ -1323,7 +1323,7 @@ int iwctl_siwfrag(struct net_device *dev,
struct iw_param *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
int rc = 0;
int fthr = wrq->value;
@@ -1352,7 +1352,7 @@ int iwctl_giwfrag(struct net_device *dev,
struct iw_param *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCGIWFRAG \n");
wrq->value = pDevice->wFragmentationThreshold;
@@ -1372,7 +1372,7 @@ int iwctl_siwretry(struct net_device *dev,
struct iw_param *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
int rc = 0;
@@ -1410,7 +1410,7 @@ int iwctl_giwretry(struct net_device *dev,
struct iw_param *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCGIWRETRY \n");
wrq->disabled = 0; // Can't be disabled
@@ -1441,7 +1441,7 @@ int iwctl_siwencode(struct net_device *dev,
struct iw_point *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
DWORD dwKeyIndex = (DWORD)(wrq->flags & IW_ENCODE_INDEX);
int ii,uu, rc = 0;
@@ -1660,7 +1660,7 @@ int iwctl_giwencode(struct net_device *dev,
struct iw_point *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
int rc = 0;
char abyKey[WLAN_WEP232_KEYLEN];
@@ -1729,7 +1729,7 @@ int iwctl_giwencode(struct net_device *dev,
struct iw_point *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
char abyKey[WLAN_WEP232_KEYLEN];
@@ -1790,7 +1790,7 @@ int iwctl_siwpower(struct net_device *dev,
struct iw_param *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
int rc = 0;
@@ -1840,7 +1840,7 @@ int iwctl_giwpower(struct net_device *dev,
struct iw_param *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
int mode = pDevice->ePSMode;
@@ -1872,7 +1872,7 @@ int iwctl_giwsens(struct net_device *dev,
struct iw_param *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
long ldBm;
DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCGIWSENS \n");
@@ -1898,7 +1898,7 @@ int iwctl_siwauth(struct net_device *dev,
struct iw_param *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
int ret=0;
static int wpa_version=0; //must be static to save the last value,einsn liu
@@ -2023,7 +2023,7 @@ int iwctl_siwgenie(struct net_device *dev,
struct iw_point *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
int ret=0;
@@ -2056,7 +2056,7 @@ int iwctl_giwgenie(struct net_device *dev,
struct iw_point *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
int ret=0;
int space = wrq->length;
@@ -2081,7 +2081,7 @@ int iwctl_siwencodeext(struct net_device *dev,
struct iw_point *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
struct iw_encode_ext *ext = (struct iw_encode_ext*)extra;
struct viawget_wpa_param *param=NULL;
//original member
@@ -2232,7 +2232,7 @@ int iwctl_siwmlme(struct net_device *dev,
struct iw_point *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
struct iw_mlme *mlme = (struct iw_mlme *)extra;
//u16 reason = cpu_to_le16(mlme->reason_code);
diff --git a/drivers/staging/vt6655/wpactl.c b/drivers/staging/vt6655/wpactl.c
index b4eadb8..a83f950 100644
--- a/drivers/staging/vt6655/wpactl.c
+++ b/drivers/staging/vt6655/wpactl.c
@@ -112,14 +112,17 @@ static void wpadev_setup(struct net_device *dev)
static int wpa_init_wpadev(PSDevice pDevice)
{
+ PSDevice wpadev_priv;
struct net_device *dev = pDevice->dev;
int ret=0;
- pDevice->wpadev = alloc_netdev(0, "vntwpa", wpadev_setup);
+ pDevice->wpadev = alloc_netdev(sizeof(PSDevice), "vntwpa", wpadev_setup);
if (pDevice->wpadev == NULL)
return -ENOMEM;
- pDevice->wpadev->priv = pDevice;
+ wpadev_priv = netdev_priv(pDevice->wpadev);
+ *wpadev_priv = *pDevice;
+
memcpy(pDevice->wpadev->dev_addr, dev->dev_addr, U_ETHER_ADDR_LEN);
pDevice->wpadev->base_addr = dev->base_addr;
pDevice->wpadev->irq = dev->irq;
--
1.5.4.3
--
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
On Fri, Apr 24, 2009 at 08:08:30PM -0400, Forest Bond wrote:
> Hi,
>
> On Fri, Apr 24, 2009 at 03:58:20PM -0700, Greg KH wrote:
> > On Fri, Apr 24, 2009 at 07:03:29AM -0400, Forest Bond wrote:
> > > Hi Greg,
> > >
> > > On Sun, Apr 19, 2009 at 03:32:18PM -0700, Greg KH wrote:
> > > > On Sun, Apr 19, 2009 at 04:01:46PM -0400, Forest Bond wrote:
> > > > > On Sun, Apr 19, 2009 at 02:52:57PM -0500, Larry Finger wrote:
> > > > > > Forest Bond wrote:
> > > > > > >
> > > > > > > However, I did have a question:
> > > > > > >
> > > > > > > The vt6655 driver builds viawget.ko, and the vt6656 driver builds vntwusb.ko.
> > > > > > > Should the directories be named "viawget" and "vntwusb," respectively, or is it
> > > > > > > appropriate for them to be named "vt6655" and "vt6656"?
> > > > > >
> > > > > > Of course Greg has the final say, but I vote to keep the directories with the
> > > > > > vt6656 name and change the name of the driver, which is defined in the line
> > > > > > #define DEVICE_NAME "vntwusb" in file include/device_cfg.h in the vendor driver.
> > > > >
> > > > > This makes sense to me. I'll proceed this way for now. Greg, let me know if
> > > > > you'd prefer I didn't do this.
> > > >
> > > > No objection from me.
> > >
> > > The following git repository has a vt6655 branch and a vt6656 branch:
> > >
> > > http://www.alittletooquiet.net/media/code/vt665x.git
> > >
> > > The vt6655 branch contains pretty much all of the work I'll likely be able to do
> > > for that driver. The vt6656 branch needs more work. I've not gone farther than
> > > build-testing either, at this point.
> > >
> > > As I've mentioned before, some of this kind of work is really a bit outside my
> > > usual domain, so if you do look at it, I'd appreciate feedback.
> > >
> > > Feel free to make requests.
> >
> > Could you send it out as patches so it's easier to review?
>
> Yes, I would've preferred that but the first patch is >1MB, so I figured it
> might be more useful to point you to a git repository, rather than send out a
> compressed patch. I can send it out uncompressed if you prefer, or I can just
> send all but the first patch (which only copies files from the upstream archive,
> anyway).
Well, I'll need all of them, including the first patch, if I'm going to
ever apply them to the tree, so I don't mind :)
Everyone else might not care, so you can just send that one to me...
thanks,
greg k-h
Integrate drivers/staging/vt6655 into build system.
Signed-off-by: Forest Bond <[email protected]>
---
drivers/staging/Kconfig | 2 +
drivers/staging/Makefile | 1 +
drivers/staging/vt6655/Kconfig | 5 +
drivers/staging/vt6655/Makefile | 252 +++++---------------------------------
4 files changed, 42 insertions(+), 218 deletions(-)
create mode 100644 drivers/staging/vt6655/Kconfig
diff --git a/drivers/staging/Kconfig b/drivers/staging/Kconfig
index 0dcf9ca..3a95633 100644
--- a/drivers/staging/Kconfig
+++ b/drivers/staging/Kconfig
@@ -115,5 +115,7 @@ source "drivers/staging/line6/Kconfig"
source "drivers/staging/serqt_usb/Kconfig"
+source "drivers/staging/vt6655/Kconfig"
+
endif # !STAGING_EXCLUDE_BUILD
endif # STAGING
diff --git a/drivers/staging/Makefile b/drivers/staging/Makefile
index 47dfd5b..2a56a60 100644
--- a/drivers/staging/Makefile
+++ b/drivers/staging/Makefile
@@ -40,3 +40,4 @@ obj-$(CONFIG_PLAN9AUTH) += p9auth/
obj-$(CONFIG_HECI) += heci/
obj-$(CONFIG_LINE6_USB) += line6/
obj-$(CONFIG_USB_SERIAL_QUATECH_ESU100) += serqt_usb/
+obj-$(CONFIG_VT6655) += vt6655/
diff --git a/drivers/staging/vt6655/Kconfig b/drivers/staging/vt6655/Kconfig
new file mode 100644
index 0000000..d9bfc81
--- /dev/null
+++ b/drivers/staging/vt6655/Kconfig
@@ -0,0 +1,5 @@
+config VT6655
+ tristate "VIA Technologies VT6655 support"
+ ---help---
+ This is a vendor-written driver for VIA VT6655.
+
diff --git a/drivers/staging/vt6655/Makefile b/drivers/staging/vt6655/Makefile
index 4ba41a1..c9e0936 100644
--- a/drivers/staging/vt6655/Makefile
+++ b/drivers/staging/vt6655/Makefile
@@ -1,218 +1,34 @@
-#
-# Build options:
-# PRIV_OBJ := 1 for object version
-#
-
-IO_MAP := 0
-HOSTAP := 1
-PRIV_OBJ := 0
-
-
-
-#KSP : = 0
-KSP := /lib/modules/$(shell uname -r)/build \
-# /usr/src/linux-$(shell uname -r) \
-# /usr/src/linux-$(shell uname -r | sed 's/-.*//') \
-# /usr/src/kernel-headers-$(shell uname -r) \
-# /usr/src/kernel-source-$(shell uname -r) \
-# /usr/src/linux-$(shell uname -r | sed 's/\([0-9]*\.[0-9]*\)\..*/\1/') \
-# /usr/src/linux /home/plice
-
-#test_dir = $(shell [ -e $(dir)/include/linux ] && echo $(dir))
-
-#KSP := $(foreach dir, $(KSP), $(test_dir))
-
-
-KSRC := $(firstword $(KSP))
-
-#ifeq (,$(KSRC))
-# $( error Linux kernel source not found)
-#endif
-
-# check kernel version
-KVER := $(shell uname -r | cut -c1-3 | sed 's/2\.[56]/2\.6/')
-KERVER2=$(shell uname -r | cut -d. -f2)
-
-ifeq ($(KVER), 2.6)
-# 2.6 kernel
-TARGET = viawget.ko
-
-else
-TARGET = viawget.o
-
-endif
-
-INSTDIR := $(shell find /lib/modules/$(shell uname -r) -name $(TARGET) -printf "%h\n" | sort | head -1)
-ifeq (,$(INSTDIR))
- ifeq (,$(KERVER2))
- ifneq (,$(wildcard /lib/modules/$(shell uname -r)/kernel))
- INSTDIR := /lib/modules/$(shell uname -r)/kernel/drivers/net
- else
- INSTDIR := /lib/modules/$(shell uname -r)/net
- endif
- else
- ifneq ($(KERVER2),2)
- INSTDIR := /lib/modules/$(shell uname -r)/kernel/drivers/net
- else
- INSTDIR := /lib/modules/$(shell uname -r)/net
- endif
- endif
-endif
-
-
-SRC = device_main.c card.c mac.c baseband.c wctl.c 80211mgr.c \
- wcmd.c wmgr.c bssdb.c wpa2.c rxtx.c dpc.c power.c datarate.c \
- srom.c mib.c rc4.c tether.c tcrc.c ioctl.c hostap.c wpa.c key.c \
- tkip.c michael.c wroute.c rf.c iwctl.c wpactl.c aes_ccmp.c \
- vntwifi.c IEEE11h.c
-
-ifeq ($(IO_MAP), 1)
- EXTRA_CFLAGS += -DIO_MAP
-endif
-
-ifeq ($(HOSTAP), 1)
- EXTRA_CFLAGS += -DHOSTAP
-endif
-
-ifeq ($(PRIV_OBJ), 1)
- EXTRA_CFLAGS += -DPRIVATE_OBJ
-endif
-
-EXTRA_CFLAGS += -I$(PWD) -I$(PWD)/../include -I$(PWD)/../solomon
-
-EXTRA_CFLAGS += -I$(PWD)/include -I$(PWD)/solomon
-
-# build rule
-ifeq ($(KVER), 2.6)
-# 2.6 kernel
-
-ifndef KERNEL_CONF
-KERNEL_CONF= $(KSRC)/.config
-endif
-
-include ${KERNEL_CONF}
-
-obj-m += viawget.o
-
-viawget-objs := device_main.o card.o mac.o baseband.o wctl.o 80211mgr.o \
- wcmd.o wmgr.o bssdb.o rxtx.o dpc.o power.o datarate.o srom.o \
- mib.o rc4.o tether.o tcrc.o ioctl.o hostap.o wpa.o key.o tkip.o \
- michael.o wroute.o rf.o iwctl.o wpactl.o wpa2.o aes_ccmp.o \
- vntwifi.o IEEE11h.o
-
-.c.o:
- $(CC) $(CFLAGS) -o $@ $<
-
-default:
- make -C $(KSRC) SUBDIRS=$(shell pwd) modules
-
-else
-
-# 2.2/2.4 kernel
-OBJS := device_main.o card.o mac.o baseband.o wctl.o 80211mgr.o \
- wcmd.o wmgr.o bssdb.o rxtx.o dpc.o power.o datarate.o srom.o \
- mib.o rc4.o tether.o tcrc.o ioctl.o hostap.o wpa.o key.o tkip.o \
- michael.o wroute.o rf.o iwctl.o wpactl.o wpa2.o aes_ccmp.o \
- vntwifi.o IEEE11h.o
-
-VERSION_FILE := $(KSRC)/include/linux/version.h
-CONFIG_FILE := $(KSRC)/include/linux/config.h
-
-
-ifeq (,$(wildcard $(VERSION_FILE)))
- $(error Linux kernel source not configured - missing version.h)
-endif
-
-ifeq (,$(wildcard $(CONFIG_FILE)))
- $(error Linux kernel source not configured - missing config.h)
-endif
-
-ifneq (,$(findstring egcs-2.91.66, $(shell cat /proc/version)))
- CC := kgcc gcc cc
-else
- CC := gcc cc
-endif
-
-test_cc = $(shell which $(cc) > /dev/null 2>&1 && echo $(cc))
-CC := $(foreach cc, $(CC), $(test_cc))
-CC := $(firstword $(CC))
-
-EXTRA_CFLAGS += -Wall -DLINUX -D__KERNEL__ -DMODULE -DEXPORT_SYMTAB -D__NO_VERSION__ -O2 -pipe
-EXTRA_CFLAGS += -I$(KSRC)/include -Wstrict-prototypes -fomit-frame-pointer -fno-strict-aliasing
-EXTRA_CFLAGS += $(shell [ -f $(KSRC)/include/linux/modversions.h ] && \
- echo "-DMODVERSIONS -include $(KSRC)/include/linux/modversions.h")
-
-.SILENT: $(TARGET) clean
-
-
-# look for SMP in config.h
-SMP := $(shell $(CC) $(CFLAGS) -E -dM $(CONFIG_FILE) | \
- grep CONFIG_SMP | awk '{ print $$3 }')
-
-ifneq ($(SMP),1)
- SMP := 0
-endif
-
-
-ifeq ($(SMP), 1)
- EXTRA_CFLAGS += -D__SMP__
-endif
-
-
-ifeq ($(PRIV_OBJ), 1)
- EXTRA_CFLAGS += -DPRIVATE_OBJ
- TARGET = x86g_up.o
-
-ifeq ($(SMP), 1)
- TARGET = x86g_smp.o
-endif
-
-endif
-
-
-# check x86_64
-SUBARCH := $(shell uname -m)
-ifeq ($(SUBARCH),x86_64)
- EXTRA_CFLAGS += -mcmodel=kernel -mno-red-zone
-endif
-
-
-$(TARGET): $(filter-out $(TARGET), $(SRC:.c=.o))
- $(LD) -r $^ -o $@
- echo; echo
- echo "**************************************************"
- echo "Build options:"
- echo " VERSION $(KVER)"
- echo -n " SMP "
- if [ "$(SMP)" = "1" ]; \
- then echo "Enabled"; else echo "Disabled"; fi
-
-
-
-endif # ifeq ($(KVER),2.6)
-
-
-ifeq ($(KVER), 2.6)
-install: default
-else
-install: clean $(TARGET)
-endif
- mkdir -p $(MOD_ROOT)$(INSTDIR)
- install -m 644 -o root $(TARGET) $(MOD_ROOT)$(INSTDIR)
-
-ifeq (,$(MOD_ROOT))
- /sbin/depmod -a || true
-else
- /sbin/depmod -b $(MOD_ROOT) -a || true
-endif
-
-
-uninstall:
- rm -f $(INSTDIR)/$(TARGET)
- /sbin/depmod -a
-
-clean:
- rm -f $(TARGET) $(SRC:.c=.o) *.o *~
- rm -f .*.o.d .*.o.cmd .*.ko.cmd *.mod.c *.mod.o
-
--include .depend.mak
+vt6655-y += device_main.o \
+ card.o \
+ mac.o \
+ baseband.o \
+ wctl.o \
+ 80211mgr.o \
+ wcmd.o \
+ wmgr.o \
+ bssdb.o \
+ rxtx.o \
+ dpc.o \
+ power.o \
+ datarate.o \
+ srom.o \
+ mib.o \
+ rc4.o \
+ tether.o \
+ tcrc.o \
+ ioctl.o \
+ hostap.o \
+ wpa.o \
+ key.o \
+ tkip.o \
+ michael.o \
+ wroute.o \
+ rf.o \
+ iwctl.o \
+ wpactl.o \
+ wpa2.o \
+ aes_ccmp.o \
+ vntwifi.o \
+ IEEE11h.o
+
+obj-$(CONFIG_VT6655) += vt6655.o
--
1.5.4.3
--
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
Hi Larry,
On Sun, Apr 19, 2009 at 02:52:57PM -0500, Larry Finger wrote:
> Forest Bond wrote:
> >
> > However, I did have a question:
> >
> > The vt6655 driver builds viawget.ko, and the vt6656 driver builds vntwusb.ko.
> > Should the directories be named "viawget" and "vntwusb," respectively, or is it
> > appropriate for them to be named "vt6655" and "vt6656"?
>
> Of course Greg has the final say, but I vote to keep the directories with the
> vt6656 name and change the name of the driver, which is defined in the line
> #define DEVICE_NAME "vntwusb" in file include/device_cfg.h in the vendor driver.
This makes sense to me. I'll proceed this way for now. Greg, let me know if
you'd prefer I didn't do this.
Thanks,
Forest
--
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
On Wed, Apr 15, 2009 at 11:43:33AM -0400, Dan Williams wrote:
> On Tue, 2009-04-14 at 18:10 -0700, Greg KH wrote:
> > On Tue, Apr 14, 2009 at 10:19:06AM -0400, Forest Bond wrote:
> > > Hi,
> > >
> > > On Tue, Apr 14, 2009 at 09:02:48AM -0400, John W. Linville wrote:
> > > > On Tue, Apr 14, 2009 at 02:43:54PM +0200, Johannes Berg wrote:
> > > > > Hi Marcel,
> > > > >
> > > > > > just to document the irony here. Two or three years ago at OLS, Kyle and
> > > > > > Greg were making fun of Ubuntu merging its 5th wireless stack into their
> > > > > > kernel. Now the staging crap is doing exactly the same.
> >
> > Yes we are. But we are doing it correctly :)
> >
> > Turns out that people actually want to use their hardware, and no one
> > else was working on merging these drivers, so that is what staging is
> > for.
>
> If nobody else was working on merging them, then adding them to staging
> isn't magically going to make people step up and rewrite the drivers
> into a state where they *can* actually be merged.
>
> The solution isn't to drag crap drivers that have no hope of getting
> merged without a major rewrite into the kernel, the solution is to get
> manufacturers to write drivers that don't suck. And staging doesn't
> help that at all; it doesn't encourage manufacturers to stop pushing out
> crap.
>
> The only fixes that drivers are getting in staging now are netdev_ops,
> whitespace cleanups, and trivial fixes. Nobody is actually rewriting
> the Ralink or Via staging drivers to use mac80211, which is what's
> needed for them to be merged. Given that they are going nowhere, are
> you going to drop them after 6 months of no substantial contributions
> that advance their mergability? Or are they going to sit around in
> staging forever, sapping away focus and resources that could be better
> spent moving wireless forward instead of fixing up a dead-end?
I've been pointing people at the community-based ralink drivers, that is
why there is only minor cleanups for those drivers. That is what the
linux-wireless developers wanted me to do, so to claim that people are
not cleaning them up is totally unfair.
> (yes, some wireless drivers in staging are getting attention, but they
> are 95% NOT vendor drivers; they are community-originated drivers like
> at76_usb or stlc45xx that were written to use mac80211 in the first
> place)
I had patches that added mac80211 to one driver in staging that a
wireless developer asked me to revert. So it is happening.
Again, it seems that if there is a community driver, people will help
out with it and let the staging one lie for a while, until it gets
dropped. Which is what I was told the wireless developers _wanted_ to
have happen. So don't complain if exactly what you all wanted to happen
is now happening...
As for the via driver, if there is no community driver, and people can
find the hardware, let's see what happens.
thanks,
greg k-h
On Tue, 2009-04-14 at 06:52 -0400, Forest Bond wrote:
> This patch adds the vt6656 driver to drivers/staging. This code was literally
> copied from the upstream source archive, available here:
>
> http://www.viaarena.com/Driver/VT6656_Linux_src_v1.19_12_x86.zip
>
> Copyright: VIA Networking Technologies, Inc.
> License: GPL
> Authors: Jerry Chen, Kyle Hsu, Lucas Lin, Lyndon Chen, Tevin Chen, Warren Hsu,
> Yiching Chen
> Signed-off-by: Forest Bond <[email protected]>
>
> Patch: http://www.alittletooquiet.net/media/code/0002-Add-vt6656-driver-to-drivers-staging.patch.gz
> Signature: http://www.alittletooquiet.net/media/code/0002-Add-vt6656-driver-to-drivers-staging.patch.gz.sig
Can we also please add files here saying to not bother the
linux-wireless list about this crap?
Thanks,
Johannes
vt6655: Remove LINUX_VERSION_CODE preprocessor conditionals.
Signed-off-by: Forest Bond <[email protected]>
---
drivers/staging/vt6655/bssdb.c | 5 -
drivers/staging/vt6655/device_main.c | 84 +-------------
drivers/staging/vt6655/dpc.c | 24 +----
drivers/staging/vt6655/iwctl.c | 78 ++-----------
drivers/staging/vt6655/kcompat.h | 218 ----------------------------------
drivers/staging/vt6655/wmgr.c | 16 +--
6 files changed, 16 insertions(+), 409 deletions(-)
diff --git a/drivers/staging/vt6655/bssdb.c b/drivers/staging/vt6655/bssdb.c
index 27b46d7..841e161 100644
--- a/drivers/staging/vt6655/bssdb.c
+++ b/drivers/staging/vt6655/bssdb.c
@@ -1335,12 +1335,7 @@ start:
wpahdr->req_ie_len = 0;
skb_put(pDevice->skb, sizeof(viawget_wpa_header));
pDevice->skb->dev = pDevice->wpadev;
-//2008-4-3 modify by Chester for wpa
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
pDevice->skb->mac_header = pDevice->skb->data;
-#else
- pDevice->skb->mac.raw = pDevice->skb->data;
-#endif
pDevice->skb->pkt_type = PACKET_HOST;
pDevice->skb->protocol = htons(ETH_P_802_2);
memset(pDevice->skb->cb, 0, sizeof(pDevice->skb->cb));
diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
index ca198a2..68ce094 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -367,7 +367,6 @@ static void device_set_multi(struct net_device *dev);
static int device_close(struct net_device *dev);
static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,9)
#ifdef CONFIG_PM
static int device_notify_reboot(struct notifier_block *, unsigned long event, void *ptr);
static int viawget_suspend(struct pci_dev *pcid, u32 state);
@@ -378,7 +377,6 @@ struct notifier_block device_notifier = {
priority: 0
};
#endif
-#endif
#endif // #ifndef PRIVATE_OBJ
@@ -948,12 +946,7 @@ static BOOL device_release_WPADEV(PSDevice pDevice)
wpahdr->req_ie_len = 0;
skb_put(pDevice->skb, sizeof(viawget_wpa_header));
pDevice->skb->dev = pDevice->wpadev;
-//2008-4-3 modify by Chester for wpa
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
pDevice->skb->mac_header = pDevice->skb->data;
-#else
- pDevice->skb->mac.raw = pDevice->skb->data;
-#endif
pDevice->skb->pkt_type = PACKET_HOST;
pDevice->skb->protocol = htons(ETH_P_802_2);
memset(pDevice->skb->cb, 0, sizeof(pDevice->skb->cb));
@@ -984,23 +977,14 @@ device_found1(struct pci_dev *pcid, const struct pci_device_id *ent)
struct net_device* dev = NULL;
PCHIP_INFO pChip_info = (PCHIP_INFO)ent->driver_data;
PSDevice pDevice;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
int rc;
-#endif
-//#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23)
- // BYTE fake_mac[U_ETHER_ADDR_LEN] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x01};//fake MAC address
-//#endif
if (device_nics ++>= MAX_UINTS) {
printk(KERN_NOTICE DEVICE_NAME ": already found %d NICs\n", device_nics);
return -ENODEV;
}
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
dev = alloc_etherdev(sizeof(DEVICE_INFO));
-#else
- dev = init_etherdev(dev, 0);
-#endif
pDevice = (PSDevice) netdev_priv(dev);
@@ -1009,11 +993,9 @@ device_found1(struct pci_dev *pcid, const struct pci_device_id *ent)
return -ENODEV;
}
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
// Chain it all together
// SET_MODULE_OWNER(dev);
SET_NETDEV_DEV(dev, &pcid->dev);
-#endif
if (bFirst) {
printk(KERN_NOTICE "%s Ver. %s\n",DEVICE_FULL_DRV_NAM, DEVICE_VERSION);
@@ -1106,21 +1088,12 @@ device_found1(struct pci_dev *pcid, const struct pci_device_id *ent)
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
rc = pci_request_regions(pcid, DEVICE_NAME);
if (rc) {
printk(KERN_ERR DEVICE_NAME ": Failed to find PCI device\n");
device_free_info(pDevice);
return -ENODEV;
}
-#else
- if (check_region(pDevice->ioaddr, pDevice->io_size)) {
- printk(KERN_ERR DEVICE_NAME ": Failed to find PCI device\n");
- device_free_info(pDevice);
- return -ENODEV;
- }
- request_region(pDevice->ioaddr, pDevice->io_size, DEVICE_NAME);
-#endif
dev->base_addr = pDevice->ioaddr;
#ifdef PLICE_DEBUG
@@ -1177,10 +1150,6 @@ device_found1(struct pci_dev *pcid, const struct pci_device_id *ent)
#endif /* WIRELESS_EXT > 12 */
#endif /* WIRELESS_EXT */
- // #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,23)
- // memcpy(pDevice->dev->dev_addr, fake_mac, U_ETHER_ADDR_LEN); //use fake mac address
- // #endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
rc = register_netdev(dev);
if (rc)
{
@@ -1188,7 +1157,6 @@ device_found1(struct pci_dev *pcid, const struct pci_device_id *ent)
device_free_info(pDevice);
return -ENODEV;
}
-#endif
//2008-07-21-01<Add>by MikeLiu
//register wpadev
if(wpa_set_wpadev(pDevice, 1)!=0) {
@@ -1355,17 +1323,10 @@ device_release_WPADEV(pDevice);
if (pDevice->PortOffset)
iounmap((PVOID)pDevice->PortOffset);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
if (pDevice->pcid)
pci_release_regions(pDevice->pcid);
if (dev)
free_netdev(dev);
-#else
- if (pDevice->ioaddr)
- release_region(pDevice->ioaddr,pDevice->io_size);
- if (dev)
- kfree(dev);
-#endif
if (pDevice->pcid) {
pci_set_drvdata(pDevice->pcid,NULL);
@@ -1880,11 +1841,7 @@ static int device_tx_srv(PSDevice pDevice, UINT uIdx) {
#else
skb = pTD->pTDInfo->skb;
skb->dev = pDevice->apdev;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
- skb->mac_header = skb->data;
-#else
- skb->mac.raw = skb->data;
-#endif
+ skb->mac_header = skb->data;
skb->pkt_type = PACKET_OTHERHOST;
//skb->protocol = htons(ETH_P_802_2);
memset(skb->cb, 0, sizeof(skb->cb));
@@ -2064,11 +2021,7 @@ static int device_open(struct net_device *dev) {
}
//2008-5-13 <add> by chester
#ifndef PRIVATE_OBJ
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,16)
i=request_irq(pDevice->pcid->irq, &device_intr, IRQF_SHARED, dev->name, dev);
-#else
- i=request_irq(pDevice->pcid->irq, &device_intr, (unsigned long)SA_SHIRQ, dev->name, dev);
-#endif
if (i)
return i;
#endif
@@ -2188,12 +2141,6 @@ DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO "call MACvIntEnable\n");
}
pDevice->flags |=DEVICE_FLAGS_OPENED;
-#ifndef PRIVATE_OBJ
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
- MOD_INC_USE_COUNT;
-#endif
-#endif
-
DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO "device_open success.. \n");
return 0;
}
@@ -2258,11 +2205,6 @@ device_release_WPADEV(pDevice);
//PLICE_DEBUG->
//tasklet_kill(&pDevice->RxMngWorkItem);
//PLICE_DEBUG<-
-#ifndef PRIVATE_OBJ
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
- MOD_DEC_USE_COUNT;
-#endif
-#endif
DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO "device_close.. \n");
return 0;
}
@@ -3948,12 +3890,10 @@ static struct pci_driver device_driver = {
id_table: device_id_table,
probe: device_found1,
remove: device_remove1,
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,9)
#ifdef CONFIG_PM
suspend: viawget_suspend,
resume: viawget_resume,
#endif
-#endif
};
static int __init device_init_module(void)
@@ -3963,17 +3903,11 @@ static int __init device_init_module(void)
// ret=pci_module_init(&device_driver);
//ret = pcie_port_service_register(&device_driver);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22)
ret = pci_register_driver(&device_driver);
-#else
- ret = pci_module_init(&device_driver);
-#endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,9)
#ifdef CONFIG_PM
if(ret >= 0)
register_reboot_notifier(&device_notifier);
#endif
-#endif
return ret;
}
@@ -3982,11 +3916,9 @@ static void __exit device_cleanup_module(void)
{
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,9)
#ifdef CONFIG_PM
unregister_reboot_notifier(&device_notifier);
#endif
-#endif
pci_unregister_driver(&device_driver);
}
@@ -3995,7 +3927,6 @@ module_init(device_init_module);
module_exit(device_cleanup_module);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,9)
#ifdef CONFIG_PM
static int
device_notify_reboot(struct notifier_block *nb, unsigned long event, void *p)
@@ -4005,11 +3936,7 @@ device_notify_reboot(struct notifier_block *nb, unsigned long event, void *p)
case SYS_DOWN:
case SYS_HALT:
case SYS_POWER_OFF:
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
while ((pdev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pdev)) != NULL) {
-#else
- pci_for_each_dev(pdev) {
-#endif
if(pci_dev_driver(pdev) == &device_driver) {
if (pci_get_drvdata(pdev))
viawget_suspend(pdev, 3);
@@ -4029,11 +3956,7 @@ viawget_suspend(struct pci_dev *pcid, u32 state)
netif_stop_queue(pDevice->dev);
spin_lock_irq(&pDevice->lock);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)
pci_save_state(pcid);
-#else
- pci_save_state(pcid, pDevice->pci_state);
-#endif
del_timer(&pDevice->sTimerCommand);
del_timer(&pMgmt->sTimerSecondCallback);
pDevice->cbFreeCmdQueue = CMD_Q_SIZE;
@@ -4061,11 +3984,7 @@ viawget_resume(struct pci_dev *pcid)
power_status = pci_set_power_state(pcid, 0);
power_status = pci_enable_wake(pcid, 0, 0);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,10)
pci_restore_state(pcid);
-#else
- pci_restore_state(pcid, pDevice->pci_state);
-#endif
if (netif_running(pDevice->dev)) {
spin_lock_irq(&pDevice->lock);
MACvRestoreContext(pDevice->PortOffset, pDevice->abyMacContext);
@@ -4094,7 +4013,6 @@ viawget_resume(struct pci_dev *pcid)
}
#endif
-#endif
#endif //#ifndef PRIVATE_OBJ
diff --git a/drivers/staging/vt6655/dpc.c b/drivers/staging/vt6655/dpc.c
index f8424bd..75496a7 100644
--- a/drivers/staging/vt6655/dpc.c
+++ b/drivers/staging/vt6655/dpc.c
@@ -709,11 +709,7 @@ device_receive_frame (
ref_skb_add_offset(skb->skb, 4);
ref_skb_set_dev(pDevice->apdev, skb->skb);
skb_put(skb->skb, FrameSize);
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,21)
skb->mac_header = skb->data;
-#else
- skb->mac.raw = skb->data;
-#endif
*(skb->pkt_type) = PACKET_OTHERHOST;
*(skb->protocol) = htons(ETH_P_802_2);
memset(skb->cb, 0, sizeof(skb->cb));
@@ -722,11 +718,7 @@ device_receive_frame (
skb->data += 4;
skb->tail += 4;
skb_put(skb, FrameSize);
-#if LINUX_VERSION_CODE > KERNEL_VERSION (2,6,21)
skb->mac_header = skb->data;
-#else
- skb->mac.raw = skb->data;
-#endif
skb->pkt_type = PACKET_OTHERHOST;
skb->protocol = htons(ETH_P_802_2);
memset(skb->cb, 0, sizeof(skb->cb));
@@ -858,11 +850,7 @@ device_receive_frame (
ref_skb_add_offset(skb->skb, (cbIVOffset + 4));
ref_skb_set_dev(pDevice->apdev, skb->skb);
skb_put(skb->skb, FrameSize);
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,21)
skb->mac_header = skb->data;
-#else
- skb->mac.raw = skb->data;
-#endif
*(skb->pkt_type) = PACKET_OTHERHOST;
*(skb->protocol) = htons(ETH_P_802_2);
memset(skb->cb, 0, sizeof(skb->cb));
@@ -871,11 +859,7 @@ device_receive_frame (
skb->data += (cbIVOffset + 4);
skb->tail += (cbIVOffset + 4);
skb_put(skb, FrameSize);
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,21)
skb->mac_header = skb->data;
-#else
- skb->mac.raw = skb->data;
-#endif
skb->pkt_type = PACKET_OTHERHOST;
skb->protocol = htons(ETH_P_802_2);
@@ -998,12 +982,8 @@ device_receive_frame (
wpahdr->req_ie_len = 0;
skb_put(pDevice->skb, sizeof(viawget_wpa_header));
pDevice->skb->dev = pDevice->wpadev;
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,21)
- pDevice->skb->mac_header = pDevice->skb->data;
-#else
- pDevice->skb->mac.raw=pDevice->skb->data;
-#endif
- pDevice->skb->pkt_type = PACKET_HOST;
+ pDevice->skb->mac_header = pDevice->skb->data;
+ pDevice->skb->pkt_type = PACKET_HOST;
pDevice->skb->protocol = htons(ETH_P_802_2);
memset(pDevice->skb->cb, 0, sizeof(pDevice->skb->cb));
netif_rx(pDevice->skb);
diff --git a/drivers/staging/vt6655/iwctl.c b/drivers/staging/vt6655/iwctl.c
index d8d72c6..c538fa5 100644
--- a/drivers/staging/vt6655/iwctl.c
+++ b/drivers/staging/vt6655/iwctl.c
@@ -307,22 +307,14 @@ int iwctl_giwscan(struct net_device *dev,
iwe.cmd = SIOCGIWAP;
iwe.u.ap_addr.sa_family = ARPHRD_ETHER;
memcpy(iwe.u.ap_addr.sa_data, pBSS->abyBSSID, WLAN_BSSID_LEN);
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) //mike add
- current_ev = iwe_stream_add_event(info,current_ev,end_buf, &iwe, IW_EV_ADDR_LEN);
- #else
- current_ev = iwe_stream_add_event(current_ev,end_buf, &iwe, IW_EV_ADDR_LEN);
- #endif
+ current_ev = iwe_stream_add_event(info,current_ev,end_buf, &iwe, IW_EV_ADDR_LEN);
//ADD ssid
memset(&iwe, 0, sizeof(iwe));
iwe.cmd = SIOCGIWESSID;
pItemSSID = (PWLAN_IE_SSID)pBSS->abySSID;
iwe.u.data.length = pItemSSID->len;
iwe.u.data.flags = 1;
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) //mike add
- current_ev = iwe_stream_add_point(info,current_ev,end_buf, &iwe, pItemSSID->abySSID);
- #else
- current_ev = iwe_stream_add_point(current_ev,end_buf, &iwe, pItemSSID->abySSID);
- #endif
+ current_ev = iwe_stream_add_point(info,current_ev,end_buf, &iwe, pItemSSID->abySSID);
//ADD mode
memset(&iwe, 0, sizeof(iwe));
iwe.cmd = SIOCGIWMODE;
@@ -333,11 +325,7 @@ int iwctl_giwscan(struct net_device *dev,
iwe.u.mode = IW_MODE_ADHOC;
}
iwe.len = IW_EV_UINT_LEN;
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) //mike add
- current_ev = iwe_stream_add_event(info,current_ev, end_buf, &iwe, IW_EV_UINT_LEN);
- #else
- current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, IW_EV_UINT_LEN);
- #endif
+ current_ev = iwe_stream_add_event(info,current_ev, end_buf, &iwe, IW_EV_UINT_LEN);
//ADD frequency
pSuppRates = (PWLAN_IE_SUPP_RATES)pBSS->abySuppRates;
pExtSuppRates = (PWLAN_IE_SUPP_RATES)pBSS->abyExtSuppRates;
@@ -346,11 +334,7 @@ int iwctl_giwscan(struct net_device *dev,
iwe.u.freq.m = pBSS->uChannel;
iwe.u.freq.e = 0;
iwe.u.freq.i = 0;
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) //mike add
- current_ev = iwe_stream_add_event(info,current_ev,end_buf, &iwe, IW_EV_FREQ_LEN);
- #else
- current_ev = iwe_stream_add_event(current_ev,end_buf, &iwe, IW_EV_FREQ_LEN);
- #endif
+ current_ev = iwe_stream_add_event(info,current_ev,end_buf, &iwe, IW_EV_FREQ_LEN);
//2008-0409-04, <Add> by Einsn Liu
@@ -360,11 +344,7 @@ int iwctl_giwscan(struct net_device *dev,
iwe.u.freq.m = frequency_list[f] * 100000;
iwe.u.freq.e = 1;
}
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) //mike add
- current_ev = iwe_stream_add_event(info,current_ev,end_buf, &iwe, IW_EV_FREQ_LEN);
- #else
- current_ev = iwe_stream_add_event(current_ev,end_buf, &iwe, IW_EV_FREQ_LEN);
- #endif
+ current_ev = iwe_stream_add_event(info,current_ev,end_buf, &iwe, IW_EV_FREQ_LEN);
//ADD quality
memset(&iwe, 0, sizeof(iwe));
iwe.cmd = IWEVQUAL;
@@ -382,11 +362,7 @@ int iwctl_giwscan(struct net_device *dev,
iwe.u.qual.updated=7;
// iwe.u.qual.qual = 0;
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) //mike add
- current_ev = iwe_stream_add_event(info,current_ev, end_buf, &iwe, IW_EV_QUAL_LEN);
- #else
- current_ev = iwe_stream_add_event(current_ev, end_buf, &iwe, IW_EV_QUAL_LEN);
- #endif
+ current_ev = iwe_stream_add_event(info,current_ev, end_buf, &iwe, IW_EV_QUAL_LEN);
memset(&iwe, 0, sizeof(iwe));
iwe.cmd = SIOCGIWENCODE;
@@ -396,11 +372,7 @@ int iwctl_giwscan(struct net_device *dev,
}else {
iwe.u.data.flags = IW_ENCODE_DISABLED;
}
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) //mike add
current_ev = iwe_stream_add_point(info,current_ev,end_buf, &iwe, pItemSSID->abySSID);
- #else
- current_ev = iwe_stream_add_point(current_ev,end_buf, &iwe, pItemSSID->abySSID);
- #endif
memset(&iwe, 0, sizeof(iwe));
iwe.cmd = SIOCGIWRATE;
@@ -412,22 +384,14 @@ int iwctl_giwscan(struct net_device *dev,
break;
// Bit rate given in 500 kb/s units (+ 0x80)
iwe.u.bitrate.value = ((pSuppRates->abyRates[kk] & 0x7f) * 500000);
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) //mike add
- current_val = iwe_stream_add_value(info,current_ev, current_val, end_buf, &iwe, IW_EV_PARAM_LEN);
- #else
- current_val = iwe_stream_add_value(current_ev, current_val, end_buf, &iwe, IW_EV_PARAM_LEN);
- #endif
+ current_val = iwe_stream_add_value(info,current_ev, current_val, end_buf, &iwe, IW_EV_PARAM_LEN);
}
for (kk = 0 ; kk < 8 ; kk++) {
if (pExtSuppRates->abyRates[kk] == 0)
break;
// Bit rate given in 500 kb/s units (+ 0x80)
iwe.u.bitrate.value = ((pExtSuppRates->abyRates[kk] & 0x7f) * 500000);
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) //mike add
- current_val = iwe_stream_add_value(info,current_ev, current_val, end_buf, &iwe, IW_EV_PARAM_LEN);
- #else
- current_val = iwe_stream_add_value(current_ev, current_val, end_buf, &iwe, IW_EV_PARAM_LEN);
- #endif
+ current_val = iwe_stream_add_value(info,current_ev, current_val, end_buf, &iwe, IW_EV_PARAM_LEN);
}
if((current_val - current_ev) > IW_EV_LCP_LEN)
@@ -438,33 +402,21 @@ int iwctl_giwscan(struct net_device *dev,
iwe.cmd = IWEVCUSTOM;
sprintf(buf, "bcn_int=%d", pBSS->wBeaconInterval);
iwe.u.data.length = strlen(buf);
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) //mike add
- current_ev = iwe_stream_add_point(info,current_ev, end_buf, &iwe, buf);
- #else
- current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, buf);
- #endif
+ current_ev = iwe_stream_add_point(info,current_ev, end_buf, &iwe, buf);
#if WIRELESS_EXT > 17
if ((pBSS->wWPALen > 0) && (pBSS->wWPALen <= MAX_WPA_IE_LEN)) {
memset(&iwe, 0, sizeof(iwe));
iwe.cmd = IWEVGENIE;
iwe.u.data.length = pBSS->wWPALen;
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) //mike add
current_ev = iwe_stream_add_point(info,current_ev, end_buf, &iwe, pBSS->byWPAIE);
- #else
- current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, pBSS->byWPAIE);
- #endif
}
if ((pBSS->wRSNLen > 0) && (pBSS->wRSNLen <= MAX_WPA_IE_LEN)) {
memset(&iwe, 0, sizeof(iwe));
iwe.cmd = IWEVGENIE;
iwe.u.data.length = pBSS->wRSNLen;
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) //mike add
current_ev = iwe_stream_add_point(info,current_ev, end_buf, &iwe, pBSS->byRSNIE);
- #else
- current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, pBSS->byRSNIE);
- #endif
}
#else // WIRELESS_EXT > 17
@@ -477,11 +429,7 @@ int iwctl_giwscan(struct net_device *dev,
p += sprintf(p, "%02x", pBSS->byWPAIE[ii]);
}
iwe.u.data.length = strlen(buf);
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) //mike add
- current_ev = iwe_stream_add_point(info,current_ev, end_buf, &iwe, buf);
- #else
- current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, buf);
- #endif
+ current_ev = iwe_stream_add_point(info,current_ev, end_buf, &iwe, buf);
}
@@ -494,11 +442,7 @@ int iwctl_giwscan(struct net_device *dev,
p += sprintf(p, "%02x", pBSS->byRSNIE[ii]);
}
iwe.u.data.length = strlen(buf);
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27) //mike add
- current_ev = iwe_stream_add_point(info,current_ev, end_buf, &iwe, buf);
- #else
- current_ev = iwe_stream_add_point(current_ev, end_buf, &iwe, buf);
- #endif
+ current_ev = iwe_stream_add_point(info,current_ev, end_buf, &iwe, buf);
}
#endif
#endif
diff --git a/drivers/staging/vt6655/kcompat.h b/drivers/staging/vt6655/kcompat.h
index a35959c..5923e14 100644
--- a/drivers/staging/vt6655/kcompat.h
+++ b/drivers/staging/vt6655/kcompat.h
@@ -74,229 +74,11 @@ typedef void irqreturn_t;
#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18)
-
-typedef unsigned long dma_addr_t;
-typedef struct wait_queue *wait_queue_head_t;
-#define init_waitqueue_head(x) *(x)=NULL
-#define set_current_state(status) { current->state = (status); mb(); }
-
-#ifdef MODULE
-
-#define module_init(fn) int init_module (void) { return fn(); }
-#define module_exit(fn) void cleanup_module(void) { return fn(); }
-
-#else /* MODULE */
-
-#define module_init(fn) int e100_probe (void) { return fn(); }
-#define module_exit(fn) /* NOTHING */
-
-#endif /* MODULE */
-
-#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,2,18) */
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0)
-
-#ifdef MODVERSIONS
-#include <linux/modversions.h>
-#endif
-
-#include <linux/types.h>
-#include <linux/pci.h>
-#include <linux/slab.h>
-#include <asm/io.h>
-
-#define pci_resource_start(dev, bar) \
- (((dev)->base_address[(bar)] & PCI_BASE_ADDRESS_SPACE_IO) ? \
- ((dev)->base_address[(bar)] & PCI_BASE_ADDRESS_IO_MASK) : \
- ((dev)->base_address[(bar)] & PCI_BASE_ADDRESS_MEM_MASK))
-
-static inline int pci_enable_device(struct pci_dev *dev)
-{
- 1112
- return 0;
-}
-#define __constant_cpu_to_le32 cpu_to_le32
-#define __constant_cpu_to_le16 cpu_to_le16
-
-#define PCI_DMA_TODEVICE 1
-#define PCI_DMA_FROMDEVICE 2
-
-extern inline void *pci_alloc_consistent (struct pci_dev *dev,
- size_t size,
- dma_addr_t *dma_handle) {
- void *vaddr = kmalloc(size, GFP_ATOMIC);
- if(vaddr != NULL) {
- *dma_handle = virt_to_bus(vaddr);
- }
- return vaddr;
-}
-
-#define pci_dma_sync_single(dev,dma_handle,size,direction) do{} while(0)
-#define pci_dma_supported(dev, addr_mask) (1)
-#define pci_free_consistent(dev, size, cpu_addr, dma_handle) kfree(cpu_addr)
-#define pci_map_single(dev, addr, size, direction) virt_to_bus(addr)
-#define pci_unmap_single(dev, dma_handle, size, direction) do{} while(0)
-
-
-#define spin_lock_bh spin_lock_irq
-#define spin_unlock_bh spin_unlock_irq
-#define del_timer_sync(timer) del_timer(timer)
-#define net_device device
-
-#define netif_start_queue(dev) ( clear_bit(0, &(dev)->tbusy))
-#define netif_stop_queue(dev) ( set_bit(0, &(dev)->tbusy))
-#define netif_wake_queue(dev) { clear_bit(0, &(dev)->tbusy); \
- mark_bh(NET_BH); }
-#define netif_running(dev) ( test_bit(0, &(dev)->start))
-#define netif_queue_stopped(dev) ( test_bit(0, &(dev)->tbusy))
-
-#define netif_device_attach(dev) \
- do{ (dev)->start = 1; netif_start_queue(dev); } while (0)
-#define netif_device_detach(dev) \
- do{ (dev)->start = 0; netif_stop_queue(dev); } while (0)
-
-#define dev_kfree_skb_irq(skb) dev_kfree_skb(skb)
-
-#define netif_carrier_on(dev) do {} while (0)
-#define netif_carrier_off(dev) do {} while (0)
-
-
-#define PCI_ANY_ID (~0U)
-
-struct pci_device_id {
- unsigned int vendor, device;
- unsigned int subvendor, subdevice;
- unsigned int class, classmask;
- unsigned long driver_data;
-};
-
-#define MODULE_DEVICE_TABLE(bus, dev_table)
-#define PCI_MAX_NUM_NICS 256
-
-struct pci_driver {
- char *name;
- struct pci_device_id *id_table;
- int (*probe)(struct pci_dev *dev, const struct pci_device_id *id);
- void (*remove)(struct pci_dev *dev);
- void (*suspend)(struct pci_dev *dev);
- void (*resume)(struct pci_dev *dev);
- struct pci_dev *pcimap[PCI_MAX_NUM_NICS];
-};
-
-static inline int pci_module_init(struct pci_driver *drv)
-{
- struct pci_dev *pdev;
- struct pci_device_id *pcid;
- uint16_t subvendor, subdevice;
- int board_count = 0;
-
- /* walk the global pci device list looking for matches */
- for (pdev = pci_devices; pdev && (board_count < PCI_MAX_NUM_NICS); pdev = pdev->next) {
-
- pcid = &drv->id_table[0];
- pci_read_config_word(pdev, PCI_SUBSYSTEM_VENDOR_ID, &subvendor);
- pci_read_config_word(pdev, PCI_SUBSYSTEM_ID, &subdevice);
-
- while (pcid->vendor != 0) {
- if (((pcid->vendor == pdev->vendor) || (pcid->vendor == PCI_ANY_ID)) &&
- ((pcid->device == pdev->device) || (pcid->device == PCI_ANY_ID)) &&
- ((pcid->subvendor == subvendor) || (pcid->subvendor == PCI_ANY_ID)) &&
- ((pcid->subdevice == subdevice) || (pcid->subdevice == PCI_ANY_ID))) {
-
- if (drv->probe(pdev, pcid) == 0) {
- drv->pcimap[board_count] = pdev;
- board_count++;
- }
- break;
- }
- pcid++;
- }
- }
-
- if (board_count < PCI_MAX_NUM_NICS) {
- drv->pcimap[board_count] = NULL;
- }
-
- return (board_count > 0) ? 0 : -ENODEV;
-}
-
-static inline void pci_unregister_driver(struct pci_driver *drv)
-{
- int i;
-
- for (i = 0; i < PCI_MAX_NUM_NICS; i++) {
- if (!drv->pcimap[i])
- break;
-
- drv->remove(drv->pcimap[i]);
- }
-}
-
-
-#define pci_set_drvdata(pcid, data)
-
-#define pci_get_drvdata(pcid) ({ \
- PSDevice pInfo; \
- for (pInfo = pDevice_Infos; \
- pInfo; pInfo = pInfo->next) { \
- if (pInfo->pcid == pcid) \
- break; \
- } \
- pInfo; })
-
-#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0) */
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,5)
-
-#define skb_linearize(skb, gfp_mask) ({ \
- struct sk_buff *tmp_skb; \
- tmp_skb = skb; \
- skb = skb_copy(tmp_skb, gfp_mask); \
- dev_kfree_skb_irq(tmp_skb); })
-
-#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,4,5) */
#ifndef MODULE_LICESEN
#define MODULE_LICESEN(x)
#endif
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,6)
-
-#include <linux/types.h>
-#include <linux/pci.h>
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,2)
-static inline int pci_set_power_state(struct pci_dev* pcid, int state) { return 0; }
-#endif
-
-#define PMCSR 0xe0
-#define PM_ENABLE_BIT 0x0100
-#define PM_CLEAR_BIT 0x8000
-#define PM_STATE_MASK 0xFFFC
-#define PM_STATE_D1 0x0001
-
-static inline int
-pci_enable_wake(struct pci_dev *dev, u32 state, int enable)
-{
- u16 p_state;
-
- pci_read_config_word(dev, PMCSR, &p_state);
- pci_write_config_word(dev, PMCSR, p_state | PM_CLEAR_BIT);
-
- if (enable == 0) {
- p_state &= ~PM_ENABLE_BIT;
- } else {
- p_state |= PM_ENABLE_BIT;
- }
- p_state &= PM_STATE_MASK;
- p_state |= state;
-
- pci_write_config_word(dev, PMCSR, p_state);
-
- return 0;
-}
-#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,4,6) */
#endif
diff --git a/drivers/staging/vt6655/wmgr.c b/drivers/staging/vt6655/wmgr.c
index 3b253b0..29fd0f2 100644
--- a/drivers/staging/vt6655/wmgr.c
+++ b/drivers/staging/vt6655/wmgr.c
@@ -1125,11 +1125,7 @@ s_vMgrRxAssocResponse(
);
skb_put(pDevice->skb, sizeof(viawget_wpa_header) + wpahdr->resp_ie_len + wpahdr->req_ie_len);
pDevice->skb->dev = pDevice->wpadev;
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,21)
- pDevice->skb->mac_header = pDevice->skb->data;
-#else
- pDevice->skb->mac.raw = pDevice->skb->data;
-#endif
+ pDevice->skb->mac_header = pDevice->skb->data;
pDevice->skb->pkt_type = PACKET_HOST;
pDevice->skb->protocol = htons(ETH_P_802_2);
memset(pDevice->skb->cb, 0, sizeof(pDevice->skb->cb));
@@ -1765,11 +1761,7 @@ s_vMgrRxDisassociation(
wpahdr->req_ie_len = 0;
skb_put(pDevice->skb, sizeof(viawget_wpa_header));
pDevice->skb->dev = pDevice->wpadev;
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,21)
pDevice->skb->mac_header = pDevice->skb->data;
-#else
- pDevice->skb->mac.raw = pDevice->skb->data;
-#endif
pDevice->skb->pkt_type = PACKET_HOST;
pDevice->skb->protocol = htons(ETH_P_802_2);
@@ -1857,11 +1849,7 @@ s_vMgrRxDeauthentication(
wpahdr->req_ie_len = 0;
skb_put(pDevice->skb, sizeof(viawget_wpa_header));
pDevice->skb->dev = pDevice->wpadev;
-#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,21)
- pDevice->skb->mac_header = pDevice->skb->data;
-#else
- pDevice->skb->mac.raw = pDevice->skb->data;
-#endif
+ pDevice->skb->mac_header = pDevice->skb->data;
pDevice->skb->pkt_type = PACKET_HOST;
pDevice->skb->protocol = htons(ETH_P_802_2);
memset(pDevice->skb->cb, 0, sizeof(pDevice->skb->cb));
--
1.5.4.3
--
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
=46orest Bond wrote:
>=20
> The following git repository has a vt6655 branch and a vt6656 branch:
>=20
> http://www.alittletooquiet.net/media/code/vt665x.git
>=20
> The vt6655 branch contains pretty much all of the work I'll likely be=
able to do
> for that driver. The vt6656 branch needs more work. I've not gone f=
arther than
> build-testing either, at this point.
It would be a little easier for looking at the code if both vt6655 and =
vt6656
directories were in the same branch of the git repo, but it's not a big=
deal.
> As I've mentioned before, some of this kind of work is really a bit o=
utside my
> usual domain, so if you do look at it, I'd appreciate feedback.
There are a number of warnings when compiling the vt6655 driver on x86_=
64
architecture that arise from pointers having 64 bits while integers hav=
e 32
bits. I think the warnings will not cause any problems. There is, howev=
er, one
error, namely:
CC [M] drivers/staging/vt6655/device_main.o
drivers/staging/vt6655/device_main.c:347: error: initializer element is=
not constant
drivers/staging/vt6655/device_main.c:347: error: (near initialization f=
or
=E2=80=98device_id_table[0].driver_data=E2=80=99)
The following patch fixes the compilation by removing the integer cast =
on
chip_info_table:
Index: vt665x/drivers/staging/vt6655/device_main.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- vt665x.orig/drivers/staging/vt6655/device_main.c
+++ vt665x/drivers/staging/vt6655/device_main.c
@@ -344,7 +344,7 @@ static CHIP_INFO chip_info_table[]=3D {
};
static struct pci_device_id device_id_table[] __devinitdata =3D {
-{ 0x1106, 0x3253, PCI_ANY_ID, PCI_ANY_ID, 0, 0, (int)&chip_info_table[=
0]},
+{ 0x1106, 0x3253, PCI_ANY_ID, PCI_ANY_ID, 0, 0, &chip_info_table[0]},
{ 0, }
};
#endif
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D
Driver vt6656 also does not build, but that does not seem to be 64-bit =
related.
If it builds on your system, let me know and I'll send you the error me=
ssages.
I didn't look that thoroughly at the code, but I did notice one thing. =
The
constructions like "#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)" ar=
e in the
code so that it can build on a number of different kernels. Once it is =
in
staging, it only has to build on the current kernel and you can trim ou=
t those
conditionals.
Larry
Greg KH <[email protected]> writes:
> Note, whenever a "real" wireless driver goes into the tree that
> obsoletes any of the staging drivers, please let me know and I'll
> instantly remove it.
>
> Right now the otus code is staying because the ar9170 developers want it
> to.
>
> But what about at76_usb? stlc45xx? Do they now have workable drivers
> to replace them in the tree today? If so, _please_ let me know.
I have received a report that at76_usb has worked better than
at76c50x-usb. Also p54spi implementation is quite new and not that much
tested.
If it's ok for you, I would like to have both at76_usb and stlc45xx in
the staging area for some time still. I will let you know when they can
be removed.
--
Kalle Valo
Hi,
On Fri, Apr 24, 2009 at 03:58:20PM -0700, Greg KH wrote:
> On Fri, Apr 24, 2009 at 07:03:29AM -0400, Forest Bond wrote:
> > Hi Greg,
> >
> > On Sun, Apr 19, 2009 at 03:32:18PM -0700, Greg KH wrote:
> > > On Sun, Apr 19, 2009 at 04:01:46PM -0400, Forest Bond wrote:
> > > > On Sun, Apr 19, 2009 at 02:52:57PM -0500, Larry Finger wrote:
> > > > > Forest Bond wrote:
> > > > > >
> > > > > > However, I did have a question:
> > > > > >
> > > > > > The vt6655 driver builds viawget.ko, and the vt6656 driver builds vntwusb.ko.
> > > > > > Should the directories be named "viawget" and "vntwusb," respectively, or is it
> > > > > > appropriate for them to be named "vt6655" and "vt6656"?
> > > > >
> > > > > Of course Greg has the final say, but I vote to keep the directories with the
> > > > > vt6656 name and change the name of the driver, which is defined in the line
> > > > > #define DEVICE_NAME "vntwusb" in file include/device_cfg.h in the vendor driver.
> > > >
> > > > This makes sense to me. I'll proceed this way for now. Greg, let me know if
> > > > you'd prefer I didn't do this.
> > >
> > > No objection from me.
> >
> > The following git repository has a vt6655 branch and a vt6656 branch:
> >
> > http://www.alittletooquiet.net/media/code/vt665x.git
> >
> > The vt6655 branch contains pretty much all of the work I'll likely be able to do
> > for that driver. The vt6656 branch needs more work. I've not gone farther than
> > build-testing either, at this point.
> >
> > As I've mentioned before, some of this kind of work is really a bit outside my
> > usual domain, so if you do look at it, I'd appreciate feedback.
> >
> > Feel free to make requests.
>
> Could you send it out as patches so it's easier to review?
Yes, I would've preferred that but the first patch is >1MB, so I figured it
might be more useful to point you to a git repository, rather than send out a
compressed patch. I can send it out uncompressed if you prefer, or I can just
send all but the first patch (which only copies files from the upstream archive,
anyway).
-Forest
--
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
On Tue, Apr 14, 2009 at 10:19:06AM -0400, Forest Bond wrote:
> On Tue, Apr 14, 2009 at 09:02:48AM -0400, John W. Linville wrote:
> > None of the above is meant to disagree about the staging crap.
> > Having that stuff around is at best an optimistic attempt to help a
> > few stray users... :-)
>
> Well, gosh, I understand the criticism here and if I were a kernel developer I
> imagine my perspective would be much the same. But I can't help but feel that
> there's some amount of hypocrisy when we hammer on a manufacturer to properly
> license their driver and then let it drop dead when they do.
Proper licensing is a prerequisite, not the final objective.
> I understand that the problem would be solved if they manufacturers would
> suddenly "get it," but the scale of social problem preventing that is likely too
> large to change anytime soon.
>
> If kernel developers are too busy to support the hardware, why do the
> manufacturers take so much criticism for releasing binary-only drivers or badly
> licensed drivers, or for neglecting to release technical specifications? If
> what I'm sensing is correct and there's no practical likelihood of these devices
> getting in-kernel support even with those issues resolved, the criticism almost
> seems unjustified.
Swimming with the red fishes..."next to no support" may be infinitely
greater than "no support", but it still is only a first step.
It amounts to throwing something over the wall and walking away.
Most kernel developers have neither financial nor personal interest
in supporting hardware they don't have in their possession. Some may
still lack both of those for random hardware in their collection.
A vendor choosing to take a minimal step towards the community does
not obligate us to take great leaps in their direction, especially
not at our own expense of time or money.
> I appreciate what the kernel developers do, of course, and my intention is not
> to ruffle feathers. But when a manufacturer that has taken a lot of criticism
> for its approach to the Linux community shows some good will, it seems like we
> ought to be able to turn that into something productive. If we can't, what have
> we been complaining about?
I would love to see this hardware properly supported in the kernel.
I sincerely hope someone finds the time to do something positive
with it. But as it stands neither I nor any of the other known
wireless developers have infinite time to support a driver for hardware
that none of us has -- especially not simply out of the goodness of
our hearts. I'm sorry, but that is just the way it is.
> My apologies if I'm way off on this. I haven't been around all that long so it
> is certainly possible.
Greg has provided drivers/staging as a compromise. I'm sorry if some
of the comments seem too harsh, but I think there is room for both
positive and negative opinions about drivers/staging. If anything,
I'm a bit neutral about it -- I think it helps some users but is
probably a net demotivator for development of proper drivers.
Hth...
John
--
John W. Linville Someday the world will need a hero, and you
[email protected] might be all we have. Be ready.
Hi Marcel,
> just to document the irony here. Two or three years ago at OLS, Kyle and
> Greg were making fun of Ubuntu merging its 5th wireless stack into their
> kernel. Now the staging crap is doing exactly the same.
:)
Actually, last I counted it was already 7 or 8 stacks in staging _only_.
This (and the other patch) will add two more. Not to mention that of
course we already have something like two and a half stacks in the
kernel tree (mac80211, in hostapd, and libipw [former ieee80211]).
> At some point I like to see some proper future development/cleanup
> planning for drivers in the staging area. Dumping stuff in there doesn't
> help at all and personally I don't see anybody cleaning up this mess.
Which is why, for all wireless "drivers" but agnx and stlc45xx in
staging I have requested that the linux-wireless list not be copied on
any of the "patches" for those drivers. All of these other drivers are,
in my opinion, entirely pointless and need to be rewritten from scratch
using the current infrastructure. No amount of cleanup will help --
there is a _fundamental_ design difference. Compare ar9170 (rewritten)
with otus (vendor) for an example.
Mind you, there don't seem to be many developers capable of doing that,
and therefore all these drivers will never "make it". All wireless
patches in staging, that haven't been proposed by people very familiar
with the wireless code, have so far been in the "brain-dead cleanup"
category.
> Do we have an option to taint the kernel when a staging driver is used.
> Similar to what we do with binary drivers or ndiswrapper?
It's already doing that. FWIW, I trust many of those staging drivers a
lot _less_ than, for instance, Broadcom's binary-only wl.ko driver.
johannes
> I have received a report that at76_usb has worked better than
> at76c50x-usb. Also p54spi implementation is quite new and not that much
> tested.
>
> If it's ok for you, I would like to have both at76_usb and stlc45xx in
> the staging area for some time still. I will let you know when they can
> be removed.
>
> --
> Kalle Valo
Kalle, what is the primary location for stlc45xx sources then? I see
that version in staging is pretty old.
--
Max
Hi Greg,
On Sun, Apr 19, 2009 at 03:32:18PM -0700, Greg KH wrote:
> On Sun, Apr 19, 2009 at 04:01:46PM -0400, Forest Bond wrote:
> > On Sun, Apr 19, 2009 at 02:52:57PM -0500, Larry Finger wrote:
> > > Forest Bond wrote:
> > > >
> > > > However, I did have a question:
> > > >
> > > > The vt6655 driver builds viawget.ko, and the vt6656 driver builds vntwusb.ko.
> > > > Should the directories be named "viawget" and "vntwusb," respectively, or is it
> > > > appropriate for them to be named "vt6655" and "vt6656"?
> > >
> > > Of course Greg has the final say, but I vote to keep the directories with the
> > > vt6656 name and change the name of the driver, which is defined in the line
> > > #define DEVICE_NAME "vntwusb" in file include/device_cfg.h in the vendor driver.
> >
> > This makes sense to me. I'll proceed this way for now. Greg, let me know if
> > you'd prefer I didn't do this.
>
> No objection from me.
The following git repository has a vt6655 branch and a vt6656 branch:
http://www.alittletooquiet.net/media/code/vt665x.git
The vt6655 branch contains pretty much all of the work I'll likely be able to do
for that driver. The vt6656 branch needs more work. I've not gone farther than
build-testing either, at this point.
As I've mentioned before, some of this kind of work is really a bit outside my
usual domain, so if you do look at it, I'd appreciate feedback.
Feel free to make requests.
Thanks,
Forest
--
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
>> Kalle, what is the primary location for stlc45xx sources then?
>
> I have been thinking about using staging the primary location. What do
> you think?
Partly agree: drivers/staging is better than gitorious and there are
more potential testers than at [email protected].
But I don't realize what is the purpose to have two drivers for one
hw? p54spi IMHO only lacks firmware restart feature now. And most of
the p54 code is used collectively by the pci, usb and spi, so it is
probably more tested than stlc45xx.
--
Max
Hi,
On Fri, Apr 24, 2009 at 09:44:06AM -0500, Larry Finger wrote:
> Forest Bond wrote:
> >
> > The following git repository has a vt6655 branch and a vt6656 branch:
> >
> > http://www.alittletooquiet.net/media/code/vt665x.git
> >
> > The vt6655 branch contains pretty much all of the work I'll likely be able to do
> > for that driver. The vt6656 branch needs more work. I've not gone farther than
> > build-testing either, at this point.
>
> It would be a little easier for looking at the code if both vt6655 and vt6656
> directories were in the same branch of the git repo, but it's not a big deal.
>
> > As I've mentioned before, some of this kind of work is really a bit outside my
> > usual domain, so if you do look at it, I'd appreciate feedback.
>
> There are a number of warnings when compiling the vt6655 driver on x86_64
> architecture that arise from pointers having 64 bits while integers have 32
> bits. I think the warnings will not cause any problems.
I'll have a closer look at the warnings.
> There is, however, one error, namely:
>
> CC [M] drivers/staging/vt6655/device_main.o
> drivers/staging/vt6655/device_main.c:347: error: initializer element is not constant
> drivers/staging/vt6655/device_main.c:347: error: (near initialization for
> ‘device_id_table[0].driver_data’)
Hm, didn't see this on my system. Not sure why. Thanks for the patch.
> Driver vt6656 also does not build, but that does not seem to be 64-bit related.
> If it builds on your system, let me know and I'll send you the error messages.
No, I haven't gotten that in a good state yet.
> I didn't look that thoroughly at the code, but I did notice one thing. The
> constructions like "#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)" are in the
> code so that it can build on a number of different kernels. Once it is in
> staging, it only has to build on the current kernel and you can trim out those
> conditionals.
Right, my intention was to look at those once the major build issues were sorted
out.
Were you able to look over my changes for net device private data accesses in
the vt6655 driver? That is what I'm most concerned about.
Thanks,
Forest
--
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
On Tue, Apr 14, 2009 at 10:19:06AM -0400, Forest Bond wrote:
> Hi,
>
> On Tue, Apr 14, 2009 at 09:02:48AM -0400, John W. Linville wrote:
> > On Tue, Apr 14, 2009 at 02:43:54PM +0200, Johannes Berg wrote:
> > > Hi Marcel,
> > >
> > > > just to document the irony here. Two or three years ago at OLS, Kyle and
> > > > Greg were making fun of Ubuntu merging its 5th wireless stack into their
> > > > kernel. Now the staging crap is doing exactly the same.
Yes we are. But we are doing it correctly :)
Turns out that people actually want to use their hardware, and no one
else was working on merging these drivers, so that is what staging is
for.
> Well, gosh, I understand the criticism here and if I were a kernel developer I
> imagine my perspective would be much the same. But I can't help but feel that
> there's some amount of hypocrisy when we hammer on a manufacturer to properly
> license their driver and then let it drop dead when they do.
I agree.
> I understand that the problem would be solved if they manufacturers would
> suddenly "get it," but the scale of social problem preventing that is likely too
> large to change anytime soon.
Agreed.
> If kernel developers are too busy to support the hardware, why do the
> manufacturers take so much criticism for releasing binary-only drivers or badly
> licensed drivers, or for neglecting to release technical specifications? If
> what I'm sensing is correct and there's no practical likelihood of these devices
> getting in-kernel support even with those issues resolved, the criticism almost
> seems unjustified.
>
> I appreciate what the kernel developers do, of course, and my intention is not
> to ruffle feathers. But when a manufacturer that has taken a lot of criticism
> for its approach to the Linux community shows some good will, it seems like we
> ought to be able to turn that into something productive. If we can't, what have
> we been complaining about?
>
> My apologies if I'm way off on this. I haven't been around all that long so it
> is certainly possible.
You aren't way off at all.
Thanks for the patches, I'll get to them in a few days when my "real
job" calms down a bit. They're now in my queue, and will not get lost.
thanks,
greg k-h
Forest Bond wrote:
>
> However, I did have a question:
>
> The vt6655 driver builds viawget.ko, and the vt6656 driver builds vntwusb.ko.
> Should the directories be named "viawget" and "vntwusb," respectively, or is it
> appropriate for them to be named "vt6655" and "vt6656"?
Of course Greg has the final say, but I vote to keep the directories with the
vt6656 name and change the name of the driver, which is defined in the line
#define DEVICE_NAME "vntwusb" in file include/device_cfg.h in the vendor driver.
Larry
Max Filippov <[email protected]> writes:
>>> Kalle, what is the primary location for stlc45xx sources then?
>>
>> I have been thinking about using staging the primary location. What do
>> you think?
>
> Partly agree: drivers/staging is better than gitorious and there are
> more potential testers than at [email protected].
Good.
> But I don't realize what is the purpose to have two drivers for one
> hw? p54spi IMHO only lacks firmware restart feature now. And most of
> the p54 code is used collectively by the pci, usb and spi, so it is
> probably more tested than stlc45xx.
p54spi is definitely the future. Christian and you have done great work
to get p54spi working N800/N810.
--
Kalle Valo
Dan Williams wrote:
> The only fixes that drivers are getting in staging now are netdev_ops,
> whitespace cleanups, and trivial fixes. Nobody is actually rewriting
> the Ralink or Via staging drivers to use mac80211, which is what's
> needed for them to be merged. Given that they are going nowhere, are
Only rtl8187se and wlan-ng don't have a mac80211 port.
mac80211 drivers:
agnx -> http://git.sipsolutions.net/agnx.git
at76_usb -> replacement already in kernel.org code at drivers/net/wireless/at76c50x-usb.[ch]
otus -> replacement already in kernel.org code at drivers/net/wireless/ar9170/
rt2860 -> rt2800pci.[ch] http://git.kernel.org/?p=linux/kernel/git/ivd/rt2x00.git
rt2870 -> rt2800usb.[ch] http://git.kernel.org/?p=linux/kernel/git/ivd/rt2x00.git
rt3070 -> rt2800usb.[ch] http://git.kernel.org/?p=linux/kernel/git/ivd/rt2x00.git
rtl8187se -> ???
stlc45xx -> replacement already in kernel.org code at drivers/net/wireless/p54/p54spi*
winbond -> http://code.google.com/p/winbondport/
wlan-ng -> ftp://ftp.linux-wlan.org/pub/linux-wlan-ng/FAQ ???
I hope rt2800pci/usb to be included *ASAP*, because rt2800usb supports
more than 1oo USB devices and rt2800pci is included in a lot of
laptops(ask Torvalds [1] [2])
[1] http://marc.info/?l=linux-netdev&m=121799144422863&w=2
[2] http://marc.info/?l=linux-kernel&m=123187052023831&w=2
regards,
--
Polycommander, Erkowit, Urquiola, Andros Patria, Cason, Aegean Sea, Prestige, ...
Add includes to drivers/staging/vt6655. These came from the includes directory
in the upstream source archive.
Signed-off-by: Forest Bond <[email protected]>
---
drivers/staging/vt6655/device_cfg.h | 142 ++++++++++
drivers/staging/vt6655/iocmd.h | 481 +++++++++++++++++++++++++++++++++++
drivers/staging/vt6655/iowpa.h | 159 ++++++++++++
drivers/staging/vt6655/ttype.h | 386 ++++++++++++++++++++++++++++
4 files changed, 1168 insertions(+), 0 deletions(-)
create mode 100644 drivers/staging/vt6655/device_cfg.h
create mode 100644 drivers/staging/vt6655/iocmd.h
create mode 100644 drivers/staging/vt6655/iowpa.h
create mode 100644 drivers/staging/vt6655/ttype.h
diff --git a/drivers/staging/vt6655/device_cfg.h b/drivers/staging/vt6655/device_cfg.h
new file mode 100644
index 0000000..9e18f7c
--- /dev/null
+++ b/drivers/staging/vt6655/device_cfg.h
@@ -0,0 +1,142 @@
+/*
+ * Copyright (c) 1996, 2003 VIA Networking, Inc. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ *
+ * File: device_cfg.h
+ *
+ * Purpose: Driver configuration header
+ * Author: Lyndon Chen
+ *
+ * Date: Dec 17, 2002
+ *
+ */
+#ifndef __DEVICE_CONFIG_H
+#define __DEVICE_CONFIG_H
+
+//#include <linux/config.h>
+#include <linux/types.h>
+
+#if !defined(__TTYPE_H__)
+#include "ttype.h"
+#endif
+
+
+
+typedef __u8 UINT8, *PUINT8;
+typedef __u16 UINT16, *PUINT16;
+typedef __u32 UINT32, *PUINT32;
+
+
+#ifndef VOID
+#define VOID void
+#endif
+
+#ifndef CONST
+#define CONST const
+#endif
+
+#ifndef STATIC
+#define STATIC static
+#endif
+
+#ifndef DEF
+#define DEF
+#endif
+
+#ifndef IN
+#define IN
+#endif
+
+#ifndef OUT
+#define OUT
+#endif
+
+typedef
+struct _version {
+ UINT8 major;
+ UINT8 minor;
+ UINT8 build;
+} version_t, *pversion_t;
+
+#ifndef FALSE
+#define FALSE (0)
+#endif
+
+#ifndef TRUE
+#define TRUE (!(FALSE))
+#endif
+
+#define VID_TABLE_SIZE 64
+#define MCAST_TABLE_SIZE 64
+#define MCAM_SIZE 32
+#define VCAM_SIZE 32
+#define TX_QUEUE_NO 8
+
+#define DEVICE_NAME "viawget"
+#define DEVICE_FULL_DRV_NAM "VIA Networking Solomon-A/B/G Wireless LAN Adapter Driver"
+
+#ifndef MAJOR_VERSION
+#define MAJOR_VERSION 1
+#endif
+
+#ifndef MINOR_VERSION
+#define MINOR_VERSION 17
+#endif
+
+#ifndef DEVICE_VERSION
+#define DEVICE_VERSION "1.19.12"
+#endif
+//config file
+#include <linux/fs.h>
+#include <linux/fcntl.h>
+#ifndef CONFIG_PATH
+#define CONFIG_PATH "/etc/vntconfiguration.dat"
+#endif
+
+//Max: 2378=2312Payload + 30HD +4CRC + 2Padding + 4Len + 8TSF + 4RSR
+#define PKT_BUF_SZ 2390
+
+
+#define MALLOC(x,y) kmalloc((x),(y))
+#define FREE(x) kfree((x))
+#define MAX_UINTS 8
+#define OPTION_DEFAULT { [0 ... MAX_UINTS-1] = -1}
+
+
+
+typedef enum _chip_type{
+ VT3253=1
+} CHIP_TYPE, *PCHIP_TYPE;
+
+
+
+#ifdef VIAWET_DEBUG
+#define ASSERT(x) { \
+ if (!(x)) { \
+ printk(KERN_ERR "assertion %s failed: file %s line %d\n", #x,\
+ __FUNCTION__, __LINE__);\
+ *(int*) 0=0;\
+ }\
+}
+#define DBG_PORT80(value) outb(value, 0x80)
+#else
+#define ASSERT(x)
+#define DBG_PORT80(value)
+#endif
+
+
+#endif
diff --git a/drivers/staging/vt6655/iocmd.h b/drivers/staging/vt6655/iocmd.h
new file mode 100644
index 0000000..2fff3a4
--- /dev/null
+++ b/drivers/staging/vt6655/iocmd.h
@@ -0,0 +1,481 @@
+/*
+ * Copyright (c) 1996, 2003 VIA Networking, Inc. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * File: iocmd.h
+ *
+ * Purpose: Handles the viawget ioctl private interface functions
+ *
+ * Author: Lyndon Chen
+ *
+ * Date: May 8, 2002
+ *
+ */
+
+#ifndef __IOCMD_H__
+#define __IOCMD_H__
+
+#if !defined(__TTYPE_H__)
+#include "ttype.h"
+#endif
+
+
+/*--------------------- Export Definitions -------------------------*/
+
+#if !defined(DEF)
+#define DEF
+#endif
+
+//typedef int BOOL;
+//typedef uint32_t u32;
+//typedef uint16_t u16;
+//typedef uint8_t u8;
+
+
+// ioctl Command code
+#define MAGIC_CODE 0x3142
+#define IOCTL_CMD_TEST (SIOCDEVPRIVATE + 0)
+#define IOCTL_CMD_SET (SIOCDEVPRIVATE + 1)
+#define IOCTL_CMD_HOSTAPD (SIOCDEVPRIVATE + 2)
+#define IOCTL_CMD_WPA (SIOCDEVPRIVATE + 3)
+
+
+typedef enum tagWMAC_CMD {
+
+ WLAN_CMD_BSS_SCAN,
+ WLAN_CMD_BSS_JOIN,
+ WLAN_CMD_DISASSOC,
+ WLAN_CMD_SET_WEP,
+ WLAN_CMD_GET_LINK,
+ WLAN_CMD_GET_LISTLEN,
+ WLAN_CMD_GET_LIST,
+ WLAN_CMD_GET_MIB,
+ WLAN_CMD_GET_STAT,
+ WLAN_CMD_STOP_MAC,
+ WLAN_CMD_START_MAC,
+ WLAN_CMD_AP_START,
+ WLAN_CMD_SET_HOSTAPD,
+ WLAN_CMD_SET_HOSTAPD_STA,
+ WLAN_CMD_SET_802_1X,
+ WLAN_CMD_SET_HOST_WEP,
+ WLAN_CMD_SET_WPA,
+ WLAN_CMD_GET_NODE_CNT,
+ WLAN_CMD_ZONETYPE_SET,
+ WLAN_CMD_GET_NODE_LIST
+
+} WMAC_CMD, DEF* PWMAC_CMD;
+
+ typedef enum tagWZONETYPE {
+ ZoneType_USA=0,
+ ZoneType_Japan=1,
+ ZoneType_Europe=2
+}WZONETYPE;
+
+#define ADHOC 0
+#define INFRA 1
+#define BOTH 2
+#define AP 3
+
+#define ADHOC_STARTED 1
+#define ADHOC_JOINTED 2
+
+
+#define PHY80211a 0
+#define PHY80211b 1
+#define PHY80211g 2
+
+#define SSID_ID 0
+#define SSID_MAXLEN 32
+#define BSSID_LEN 6
+#define WEP_NKEYS 4
+#define WEP_KEYMAXLEN 29
+#define WEP_40BIT_LEN 5
+#define WEP_104BIT_LEN 13
+#define WEP_232BIT_LEN 16
+
+
+// Ioctl interface structure
+// Command structure
+//
+#pragma pack(1)
+typedef struct tagSCmdRequest {
+ U8 name[16];
+ void *data;
+ U16 wResult;
+ U16 wCmdCode;
+} SCmdRequest, *PSCmdRequest;
+
+
+//
+// Scan
+//
+
+typedef struct tagSCmdScan {
+
+ U8 ssid[SSID_MAXLEN + 2];
+
+} SCmdScan, *PSCmdScan;
+
+
+//
+// BSS Join
+//
+
+typedef struct tagSCmdBSSJoin {
+
+ U16 wBSSType;
+ U16 wBBPType;
+ U8 ssid[SSID_MAXLEN + 2];
+ U32 uChannel;
+ BOOL bPSEnable;
+ BOOL bShareKeyAuth;
+
+} SCmdBSSJoin, *PSCmdBSSJoin;
+
+typedef struct tagSCmdZoneTypeSet {
+
+ BOOL bWrite;
+ WZONETYPE ZoneType;
+
+} SCmdZoneTypeSet, *PSCmdZoneTypeSet;
+
+#ifdef WPA_SM_Transtatus
+typedef struct tagSWPAResult {
+ char ifname[100];
+ U8 proto;
+ U8 key_mgmt;
+ U8 eap_type;
+ BOOL authenticated;
+} SWPAResult, *PSWPAResult;
+#endif
+
+
+typedef struct tagSCmdStartAP {
+
+ U16 wBSSType;
+ U16 wBBPType;
+ U8 ssid[SSID_MAXLEN + 2];
+ U32 uChannel;
+ U32 uBeaconInt;
+ BOOL bShareKeyAuth;
+ U8 byBasicRate;
+
+} SCmdStartAP, *PSCmdStartAP;
+
+
+typedef struct tagSCmdSetWEP {
+
+ BOOL bEnableWep;
+ U8 byKeyIndex;
+ U8 abyWepKey[WEP_NKEYS][WEP_KEYMAXLEN];
+ BOOL bWepKeyAvailable[WEP_NKEYS];
+ U32 auWepKeyLength[WEP_NKEYS];
+
+} SCmdSetWEP, *PSCmdSetWEP;
+
+
+
+typedef struct tagSBSSIDItem {
+
+ U32 uChannel;
+ U8 abyBSSID[BSSID_LEN];
+ U8 abySSID[SSID_MAXLEN + 1];
+ //2006-1116-01,<Modify> by NomadZhao
+ //U16 wBeaconInterval;
+ //U16 wCapInfo;
+ //U8 byNetType;
+ U8 byNetType;
+ U16 wBeaconInterval;
+ U16 wCapInfo; // for address of byNetType at align 4
+
+ BOOL bWEPOn;
+ U32 uRSSI;
+
+} SBSSIDItem;
+
+
+typedef struct tagSBSSIDList {
+
+ U32 uItem;
+ SBSSIDItem sBSSIDList[0];
+} SBSSIDList, *PSBSSIDList;
+
+
+typedef struct tagSCmdLinkStatus {
+
+ BOOL bLink;
+ U16 wBSSType;
+ U8 byState;
+ U8 abyBSSID[BSSID_LEN];
+ U8 abySSID[SSID_MAXLEN + 2];
+ U32 uChannel;
+ U32 uLinkRate;
+
+} SCmdLinkStatus, *PSCmdLinkStatus;
+
+//
+// 802.11 counter
+//
+typedef struct tagSDot11MIBCount {
+ U32 TransmittedFragmentCount;
+ U32 MulticastTransmittedFrameCount;
+ U32 FailedCount;
+ U32 RetryCount;
+ U32 MultipleRetryCount;
+ U32 RTSSuccessCount;
+ U32 RTSFailureCount;
+ U32 ACKFailureCount;
+ U32 FrameDuplicateCount;
+ U32 ReceivedFragmentCount;
+ U32 MulticastReceivedFrameCount;
+ U32 FCSErrorCount;
+} SDot11MIBCount, DEF* PSDot11MIBCount;
+
+
+
+//
+// statistic counter
+//
+typedef struct tagSStatMIBCount {
+ //
+ // ISR status count
+ //
+ U32 dwIsrTx0OK;
+ U32 dwIsrTx1OK;
+ U32 dwIsrBeaconTxOK;
+ U32 dwIsrRxOK;
+ U32 dwIsrTBTTInt;
+ U32 dwIsrSTIMERInt;
+ U32 dwIsrUnrecoverableError;
+ U32 dwIsrSoftInterrupt;
+ U32 dwIsrRxNoBuf;
+ /////////////////////////////////////
+
+ U32 dwIsrUnknown; // unknown interrupt count
+
+ // RSR status count
+ //
+ U32 dwRsrFrmAlgnErr;
+ U32 dwRsrErr;
+ U32 dwRsrCRCErr;
+ U32 dwRsrCRCOk;
+ U32 dwRsrBSSIDOk;
+ U32 dwRsrADDROk;
+ U32 dwRsrICVOk;
+ U32 dwNewRsrShortPreamble;
+ U32 dwRsrLong;
+ U32 dwRsrRunt;
+
+ U32 dwRsrRxControl;
+ U32 dwRsrRxData;
+ U32 dwRsrRxManage;
+
+ U32 dwRsrRxPacket;
+ U32 dwRsrRxOctet;
+ U32 dwRsrBroadcast;
+ U32 dwRsrMulticast;
+ U32 dwRsrDirected;
+ // 64-bit OID
+ U32 ullRsrOK;
+
+ // for some optional OIDs (64 bits) and DMI support
+ U32 ullRxBroadcastBytes;
+ U32 ullRxMulticastBytes;
+ U32 ullRxDirectedBytes;
+ U32 ullRxBroadcastFrames;
+ U32 ullRxMulticastFrames;
+ U32 ullRxDirectedFrames;
+
+ U32 dwRsrRxFragment;
+ U32 dwRsrRxFrmLen64;
+ U32 dwRsrRxFrmLen65_127;
+ U32 dwRsrRxFrmLen128_255;
+ U32 dwRsrRxFrmLen256_511;
+ U32 dwRsrRxFrmLen512_1023;
+ U32 dwRsrRxFrmLen1024_1518;
+
+ // TSR0,1 status count
+ //
+ U32 dwTsrTotalRetry[2]; // total collision retry count
+ U32 dwTsrOnceRetry[2]; // this packet only occur one collision
+ U32 dwTsrMoreThanOnceRetry[2]; // this packet occur more than one collision
+ U32 dwTsrRetry[2]; // this packet has ever occur collision,
+ // that is (dwTsrOnceCollision0 + dwTsrMoreThanOnceCollision0)
+ U32 dwTsrACKData[2];
+ U32 dwTsrErr[2];
+ U32 dwAllTsrOK[2];
+ U32 dwTsrRetryTimeout[2];
+ U32 dwTsrTransmitTimeout[2];
+
+ U32 dwTsrTxPacket[2];
+ U32 dwTsrTxOctet[2];
+ U32 dwTsrBroadcast[2];
+ U32 dwTsrMulticast[2];
+ U32 dwTsrDirected[2];
+
+ // RD/TD count
+ U32 dwCntRxFrmLength;
+ U32 dwCntTxBufLength;
+
+ U8 abyCntRxPattern[16];
+ U8 abyCntTxPattern[16];
+
+ // Software check....
+ U32 dwCntRxDataErr; // rx buffer data software compare CRC err count
+ U32 dwCntDecryptErr; // rx buffer data software compare CRC err count
+ U32 dwCntRxICVErr; // rx buffer data software compare CRC err count
+ U32 idxRxErrorDesc; // index for rx data error RD
+
+ // 64-bit OID
+ U32 ullTsrOK[2];
+
+ // for some optional OIDs (64 bits) and DMI support
+ U32 ullTxBroadcastFrames[2];
+ U32 ullTxMulticastFrames[2];
+ U32 ullTxDirectedFrames[2];
+ U32 ullTxBroadcastBytes[2];
+ U32 ullTxMulticastBytes[2];
+ U32 ullTxDirectedBytes[2];
+} SStatMIBCount, DEF* PSStatMIBCount;
+
+
+typedef struct tagSNodeItem {
+ // STA info
+ U16 wAID;
+ U8 abyMACAddr[6];
+ U16 wTxDataRate;
+ U16 wInActiveCount;
+ U16 wEnQueueCnt;
+ U16 wFlags;
+ BOOL bPWBitOn;
+ U8 byKeyIndex;
+ U16 wWepKeyLength;
+ U8 abyWepKey[WEP_KEYMAXLEN];
+ // Auto rate fallback vars
+ BOOL bIsInFallback;
+ U32 uTxFailures;
+ U32 uTxAttempts;
+ U16 wFailureRatio;
+
+} SNodeItem;
+
+
+typedef struct tagSNodeList {
+
+ U32 uItem;
+ SNodeItem sNodeList[0];
+
+} SNodeList, *PSNodeList;
+
+
+
+typedef struct tagSCmdValue {
+
+ U32 dwValue;
+
+} SCmdValue, *PSCmdValue;
+
+
+//
+// hostapd & viawget ioctl related
+//
+
+
+// VIAGWET_IOCTL_HOSTAPD ioctl() cmd:
+enum {
+ VIAWGET_HOSTAPD_FLUSH = 1,
+ VIAWGET_HOSTAPD_ADD_STA = 2,
+ VIAWGET_HOSTAPD_REMOVE_STA = 3,
+ VIAWGET_HOSTAPD_GET_INFO_STA = 4,
+ VIAWGET_HOSTAPD_SET_ENCRYPTION = 5,
+ VIAWGET_HOSTAPD_GET_ENCRYPTION = 6,
+ VIAWGET_HOSTAPD_SET_FLAGS_STA = 7,
+ VIAWGET_HOSTAPD_SET_ASSOC_AP_ADDR = 8,
+ VIAWGET_HOSTAPD_SET_GENERIC_ELEMENT = 9,
+ VIAWGET_HOSTAPD_MLME = 10,
+ VIAWGET_HOSTAPD_SCAN_REQ = 11,
+ VIAWGET_HOSTAPD_STA_CLEAR_STATS = 12,
+};
+
+
+#define VIAWGET_HOSTAPD_GENERIC_ELEMENT_HDR_LEN \
+((int) (&((struct viawget_hostapd_param *) 0)->u.generic_elem.data))
+
+// Maximum length for algorithm names (-1 for nul termination) used in ioctl()
+
+
+
+struct viawget_hostapd_param {
+ U32 cmd;
+ U8 sta_addr[6];
+ union {
+ struct {
+ U16 aid;
+ U16 capability;
+ U8 tx_supp_rates;
+ } add_sta;
+ struct {
+ U32 inactive_sec;
+ } get_info_sta;
+ struct {
+ U8 alg;
+ U32 flags;
+ U32 err;
+ U8 idx;
+ U8 seq[8];
+ U16 key_len;
+ U8 key[0];
+ } crypt;
+ struct {
+ U32 flags_and;
+ U32 flags_or;
+ } set_flags_sta;
+ struct {
+ U16 rid;
+ U16 len;
+ U8 data[0];
+ } rid;
+ struct {
+ U8 len;
+ U8 data[0];
+ } generic_elem;
+ struct {
+ U16 cmd;
+ U16 reason_code;
+ } mlme;
+ struct {
+ U8 ssid_len;
+ U8 ssid[32];
+ } scan_req;
+ } u;
+};
+
+//2006-1116-01,<Add> by NomadZhao
+#pragma pack()
+
+/*--------------------- Export Classes ----------------------------*/
+
+/*--------------------- Export Variables --------------------------*/
+
+
+/*--------------------- Export Types ------------------------------*/
+
+
+/*--------------------- Export Functions --------------------------*/
+
+
+
+#endif //__IOCMD_H__
diff --git a/drivers/staging/vt6655/iowpa.h b/drivers/staging/vt6655/iowpa.h
new file mode 100644
index 0000000..392b3f7
--- /dev/null
+++ b/drivers/staging/vt6655/iowpa.h
@@ -0,0 +1,159 @@
+/*
+ * Copyright (c) 1996, 2003 VIA Networking, Inc. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * File: iowpa.h
+ *
+ * Purpose: Handles wpa supplicant ioctl interface
+ *
+ * Author: Lyndon Chen
+ *
+ * Date: May 8, 2002
+ *
+ */
+
+#ifndef __IOWPA_H__
+#define __IOWPA_H__
+
+
+/*--------------------- Export Definitions -------------------------*/
+
+
+#define WPA_IE_LEN 64
+
+
+//WPA related
+/*
+typedef enum { WPA_ALG_NONE, WPA_ALG_WEP, WPA_ALG_TKIP, WPA_ALG_CCMP } wpa_alg;
+typedef enum { CIPHER_NONE, CIPHER_WEP40, CIPHER_TKIP, CIPHER_CCMP,
+ CIPHER_WEP104 } wpa_cipher;
+typedef enum { KEY_MGMT_802_1X, KEY_MGMT_PSK, KEY_MGMT_NONE,
+ KEY_MGMT_802_1X_NO_WPA, KEY_MGMT_WPA_NONE } wpa_key_mgmt;
+*/
+
+enum {
+ VIAWGET_SET_WPA = 1,
+ VIAWGET_SET_KEY = 2,
+ VIAWGET_SET_SCAN = 3,
+ VIAWGET_GET_SCAN = 4,
+ VIAWGET_GET_SSID = 5,
+ VIAWGET_GET_BSSID = 6,
+ VIAWGET_SET_DROP_UNENCRYPT = 7,
+ VIAWGET_SET_DEAUTHENTICATE = 8,
+ VIAWGET_SET_ASSOCIATE = 9,
+ VIAWGET_SET_DISASSOCIATE= 10
+};
+
+
+enum {
+ VIAWGET_ASSOC_MSG = 1,
+ VIAWGET_DISASSOC_MSG = 2,
+ VIAWGET_PTK_MIC_MSG = 3,
+ VIAWGET_GTK_MIC_MSG = 4,
+ VIAWGET_CCKM_ROAM_MSG = 5,
+ VIAWGET_DEVICECLOSE_MSG = 6
+};
+
+
+
+#pragma pack(1)
+typedef struct viawget_wpa_header {
+ u8 type;
+ u16 req_ie_len;
+ u16 resp_ie_len;
+} viawget_wpa_header;
+
+
+
+struct viawget_wpa_param {
+ u32 cmd;
+ u8 addr[6];
+ union {
+ struct {
+ u8 len;
+ u8 data[0];
+ } generic_elem;
+
+ struct {
+ u8 bssid[6];
+ u8 ssid[32];
+ u8 ssid_len;
+ u8 *wpa_ie;
+ u16 wpa_ie_len;
+ int pairwise_suite;
+ int group_suite;
+ int key_mgmt_suite;
+ int auth_alg;
+ int mode;
+
+ } wpa_associate;
+
+ struct {
+ int alg_name;
+ u16 key_index;
+ u16 set_tx;
+ u8 *seq;
+ u16 seq_len;
+ u8 *key;
+ u16 key_len;
+ } wpa_key;
+
+ struct {
+ u8 ssid_len;
+ u8 ssid[32];
+ } scan_req;
+
+ struct {
+ u16 scan_count;
+ u8 *buf;
+ } scan_results;
+
+ } u;
+
+};
+
+#pragma pack(1)
+struct viawget_scan_result {
+ u8 bssid[6];
+ u8 ssid[32];
+ u16 ssid_len;
+ u8 wpa_ie[WPA_IE_LEN];
+ u16 wpa_ie_len;
+ u8 rsn_ie[WPA_IE_LEN];
+ u16 rsn_ie_len;
+ int freq; // MHz
+ int caps; // e.g. privacy
+ int qual; // signal quality
+ int noise;
+ int level;
+ int maxrate;
+};
+
+//2006-1116-01,<Add> by NomadZhao
+#pragma pack()
+/*--------------------- Export Classes ----------------------------*/
+
+/*--------------------- Export Variables --------------------------*/
+
+
+/*--------------------- Export Types ------------------------------*/
+
+
+/*--------------------- Export Functions --------------------------*/
+
+
+
+#endif //__IOWPA_H__
diff --git a/drivers/staging/vt6655/ttype.h b/drivers/staging/vt6655/ttype.h
new file mode 100644
index 0000000..3a075a6
--- /dev/null
+++ b/drivers/staging/vt6655/ttype.h
@@ -0,0 +1,386 @@
+/*
+ * File: ttype.h
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Purpose: define basic common types and macros
+ *
+ * Author: Tevin Chen
+ *
+ * Date: May 21, 1996
+ *
+ */
+
+
+#ifndef __TTYPE_H__
+#define __TTYPE_H__
+
+
+/******* Common definitions and typedefs ***********************************/
+
+#ifndef VOID
+#define VOID void
+#endif
+
+#ifndef CONST
+#define CONST const
+#endif
+
+#ifndef STATIC
+#define STATIC static
+#endif
+
+#ifndef IN
+#define IN
+#endif
+
+#ifndef OUT
+#define OUT
+#endif
+
+#ifndef TxInSleep
+#define TxInSleep
+#endif
+#if! defined(__CPU8051)
+typedef int BOOL;
+#else // __CPU8051
+#define BOOL int
+#endif // __CPU8051
+
+#if !defined(TRUE)
+#define TRUE 1
+#endif
+#if !defined(FALSE)
+#define FALSE 0
+#endif
+
+
+#if !defined(SUCCESS)
+#define SUCCESS 0
+#endif
+#if !defined(FAILED)
+#define FAILED -1
+#endif
+
+//2007-0809-01<Add>by MikeLiu
+#ifndef update_BssList
+#define update_BssList
+#endif
+
+
+
+#ifndef WPA_SM_Transtatus
+#define WPA_SM_Transtatus
+#endif
+
+#ifndef Calcu_LinkQual
+#define Calcu_LinkQual
+#endif
+
+#ifndef Calcu_LinkQual
+#define Calcu_LinkQual
+#endif
+
+/****** Simple typedefs ***************************************************/
+
+#if! defined(__CPU8051)
+
+/* These lines assume that your compiler's longs are 32 bits and
+ * shorts are 16 bits. It is already assumed that chars are 8 bits,
+ * but it doesn't matter if they're signed or unsigned.
+ */
+
+typedef signed char I8; /* 8-bit signed integer */
+typedef signed short I16; /* 16-bit signed integer */
+typedef signed long I32; /* 32-bit signed integer */
+
+typedef unsigned char U8; /* 8-bit unsigned integer */
+typedef unsigned short U16; /* 16-bit unsigned integer */
+typedef unsigned long U32; /* 32-bit unsigned integer */
+
+
+#if defined(__WIN32)
+typedef signed __int64 I64; /* 64-bit signed integer */
+typedef unsigned __int64 U64; /* 64-bit unsigned integer */
+#endif // __WIN32
+
+
+typedef char CHAR;
+typedef signed short SHORT;
+typedef signed int INT;
+typedef signed long LONG;
+
+typedef unsigned char UCHAR;
+typedef unsigned short USHORT;
+typedef unsigned int UINT;
+typedef unsigned long ULONG;
+typedef unsigned long long ULONGLONG; //64 bit
+typedef unsigned long long ULONGULONG;
+
+
+
+typedef unsigned char BYTE; // 8-bit
+typedef unsigned short WORD; // 16-bit
+typedef unsigned long DWORD; // 32-bit
+
+// QWORD is for those situation that we want
+// an 8-byte-aligned 8 byte long structure
+// which is NOT really a floating point number.
+typedef union tagUQuadWord {
+ struct {
+ DWORD dwLowDword;
+ DWORD dwHighDword;
+ } u;
+ double DoNotUseThisField;
+} UQuadWord;
+typedef UQuadWord QWORD; // 64-bit
+
+
+
+#ifndef _TCHAR_DEFINED
+typedef char TCHAR;
+typedef char* PTCHAR;
+typedef unsigned char TBYTE;
+typedef unsigned char* PTBYTE;
+#define _TCHAR_DEFINED
+#endif
+
+#else // __CPU8051
+
+#define U8 unsigned char
+#define U16 unsigned short
+#define U32 unsigned long
+
+#define USHORT unsigned short
+#define UINT unsigned int
+
+#define BYTE unsigned char
+#define WORD unsigned short
+#define DWORD unsigned long
+
+
+#endif // __CPU8051
+
+
+// maybe this should be defined in <limits.h>
+#define U8_MAX 0xFFU
+#define U16_MAX 0xFFFFU
+#define U32_MAX 0xFFFFFFFFUL
+
+#define BYTE_MAX 0xFFU
+#define WORD_MAX 0xFFFFU
+#define DWORD_MAX 0xFFFFFFFFUL
+
+
+
+
+/******* 32-bit vs. 16-bit definitions and typedefs ************************/
+
+#if !defined(NULL)
+#ifdef __cplusplus
+#define NULL 0
+#else
+#define NULL ((void *)0)
+#endif // __cplusplus
+#endif // !NULL
+
+
+
+
+#if defined(__WIN32) || defined(__CPU8051)
+
+#if !defined(FAR)
+#define FAR
+#endif
+#if !defined(NEAR)
+#define NEAR
+#endif
+#if !defined(DEF)
+#define DEF
+#endif
+#if !defined(CALLBACK)
+#define CALLBACK
+#endif
+
+#else // !__WIN32__
+
+#if !defined(FAR)
+#define FAR
+#endif
+#if !defined(NEAR)
+#define NEAR
+#endif
+#if !defined(DEF)
+// default pointer type is FAR, if you want near pointer just redefine it to NEAR
+#define DEF
+#endif
+#if !defined(CALLBACK)
+#define CALLBACK
+#endif
+
+#endif // !__WIN32__
+
+
+
+
+/****** Common pointer types ***********************************************/
+
+#if! defined(__CPU8051)
+
+typedef signed char DEF* PI8;
+typedef signed short DEF* PI16;
+typedef signed long DEF* PI32;
+
+typedef unsigned char DEF* PU8;
+typedef unsigned short DEF* PU16;
+typedef unsigned long DEF* PU32;
+
+#if defined(__WIN32)
+typedef signed __int64 DEF* PI64;
+typedef unsigned __int64 DEF* PU64;
+#endif // __WIN32
+
+#if !defined(_WIN64)
+typedef unsigned long ULONG_PTR; // 32-bit
+typedef unsigned long DWORD_PTR; // 32-bit
+#endif // _WIN64
+
+
+// boolean pointer
+typedef int DEF* PBOOL;
+typedef int NEAR* NPBOOL;
+typedef int FAR* LPBOOL;
+
+typedef int DEF* PINT;
+typedef int NEAR* NPINT;
+typedef int FAR* LPINT;
+typedef const int DEF* PCINT;
+typedef const int NEAR* NPCINT;
+typedef const int FAR* LPCINT;
+
+typedef unsigned int DEF* PUINT;
+typedef const unsigned int DEF* PCUINT;
+
+typedef long DEF* PLONG;
+typedef long NEAR* NPLONG;
+typedef long FAR* LPLONG;
+//typedef const long DEF* PCLONG;
+typedef const long NEAR* NPCLONG;
+typedef const long FAR* LPCLONG;
+
+typedef BYTE DEF* PBYTE;
+typedef BYTE NEAR* NPBYTE;
+typedef BYTE FAR* LPBYTE;
+typedef const BYTE DEF* PCBYTE;
+typedef const BYTE NEAR* NPCBYTE;
+typedef const BYTE FAR* LPCBYTE;
+
+typedef WORD DEF* PWORD;
+typedef WORD NEAR* NPWORD;
+typedef WORD FAR* LPWORD;
+typedef const WORD DEF* PCWORD;
+typedef const WORD NEAR* NPCWORD;
+typedef const WORD FAR* LPCWORD;
+
+typedef DWORD DEF* PDWORD;
+typedef DWORD NEAR* NPDWORD;
+typedef DWORD FAR* LPDWORD;
+typedef const DWORD DEF* PCDWORD;
+typedef const DWORD NEAR* NPCDWORD;
+typedef const DWORD FAR* LPCDWORD;
+
+typedef QWORD DEF* PQWORD;
+typedef QWORD NEAR* NPQWORD;
+typedef QWORD FAR* LPQWORD;
+typedef const QWORD DEF* PCQWORD;
+typedef const QWORD NEAR* NPCQWORD;
+typedef const QWORD FAR* LPCQWORD;
+
+typedef void DEF* PVOID;
+typedef void NEAR* NPVOID;
+typedef void FAR* LPVOID;
+
+// handle declaration
+#ifdef STRICT
+typedef void *HANDLE;
+#else
+typedef PVOID HANDLE;
+#endif
+
+//
+// ANSI (Single-byte Character) types
+//
+typedef char DEF* PCH;
+typedef char NEAR* NPCH;
+typedef char FAR* LPCH;
+typedef const char DEF* PCCH;
+typedef const char NEAR* NPCCH;
+typedef const char FAR* LPCCH;
+
+typedef char DEF* PSTR;
+typedef char NEAR* NPSTR;
+typedef char FAR* LPSTR;
+typedef const char DEF* PCSTR;
+typedef const char NEAR* NPCSTR;
+typedef const char FAR* LPCSTR;
+
+#endif // !__CPU8051
+
+
+
+
+/****** Misc definitions, types ********************************************/
+
+// parameter prefix
+#ifndef IN
+#define IN
+#endif
+
+#ifndef OUT
+#define OUT
+#endif
+
+
+// unreferenced parameter macro to avoid warning message in MS C
+#if defined(__TURBOC__)
+
+//you should use "#pragma argsused" to avoid warning message in Borland C
+#ifndef UNREFERENCED_PARAMETER
+#define UNREFERENCED_PARAMETER(x)
+#endif
+
+#else
+
+#ifndef UNREFERENCED_PARAMETER
+//#define UNREFERENCED_PARAMETER(x) x
+#define UNREFERENCED_PARAMETER(x)
+#endif
+
+#endif
+
+
+// in-line assembly prefix
+#if defined(__TURBOC__)
+#define ASM asm
+#else // !__TURBOC__
+#define ASM _asm
+#endif // !__TURBOC__
+
+
+
+
+#endif // __TTYPE_H__
+
+
--
1.5.4.3
--
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
Hi,
> > I hope rt2800pci/usb to be included *ASAP*, because rt2800usb supports
> > more than 1oo USB devices and rt2800pci is included in a lot of
> > laptops(ask Torvalds [1] [2])
> >
> > [1] http://marc.info/?l=linux-netdev&m=121799144422863&w=2
> > [2] http://marc.info/?l=linux-kernel&m=123187052023831&w=2
>
> That would be great to have in, what's keeping it from happening?
In short: A stable workable driver.
The rt2800usb driver is pretty far (at least on my testsetup), but
still has problems with transmitting frames immediately after
association.
As for rt2800pci that card still refuses to anything. The MCU registers
simply refuses the initialize, the TX and RX refuse to do anything.
I have some help from Ralink on this, as well as some patches from
others which have been merged. But I lack the time to really dive
into these issues. I don't get much further then a guick glance every
few days.
Ivo
Hi Johannes,
> > > Can we also please add files here saying to not bother the
> > > linux-wireless list about this crap?
> >
> > I would assume this is somewhat implied for any code in drivers/staging. Is
> > that not the case?
>
> It seems to be on a per case basis -- and there's one driver at least
> (agnx) that we actually do care about because it is there only because
> it's incomplete not because the code is in some way problematic (like
> using its own 802.11 stack)
just to document the irony here. Two or three years ago at OLS, Kyle and
Greg were making fun of Ubuntu merging its 5th wireless stack into their
kernel. Now the staging crap is doing exactly the same.
Not to mention the regulatory database I found in this specific driver.
At some point I like to see some proper future development/cleanup
planning for drivers in the staging area. Dumping stuff in there doesn't
help at all and personally I don't see anybody cleaning up this mess.
Do we have an option to taint the kernel when a staging driver is used.
Similar to what we do with binary drivers or ndiswrapper?
Regards
Marcel
On Tue, Apr 21, 2009 at 12:30 PM, Ivo Van Doorn <[email protected]> wro=
te:
> On Mon, Apr 20, 2009 at 3:59 PM, John W. Linville
> <[email protected]> wrote:
>> On Sat, Apr 18, 2009 at 11:18:56PM +0200, Ivo van Doorn wrote:
>>> Hi,
>>>
>>> > > I hope rt2800pci/usb to be included *ASAP*, because rt2800usb s=
upports
>>> > > more than 1oo USB devices and rt2800pci is included in a lot of
>>> > > laptops(ask Torvalds [1] [2])
>>> > >
>>> > > [1] http://marc.info/?l=3Dlinux-netdev&m=3D121799144422863&w=3D=
2
>>> > > [2] http://marc.info/?l=3Dlinux-kernel&m=3D123187052023831&w=3D=
2
>>> >
>>> > That would be great to have in, what's keeping it from happening?
>>>
>>> In short: A stable workable driver.
>>>
>>> The rt2800usb driver is pretty far (at least on my testsetup), but
>>> still has problems with transmitting frames immediately after
>>> association.
>>
>> I read this as "it works, but some frames are lost immediately after
>> association" -- is that right?
>
> It is not "Some frames" it is "All frames" you can't get a DHCP lease=
,
> or use a static IP and try to do anything.
To clarify a bit, this behavior summarizes the first minute after assoc=
iation,
after that all frames queued in the past minute are bursted out in a si=
ngle shot
and normal traffic is possible again.
> Also 11n APs are not detected at all, which for a 11n client sounds
> very problematic.
>
>> FWIW, this sounds good enough to me
>> to get it into the mainline kernel. =A0_Please_ submit the rt2800usb
>> driver for wireless-testing/linux-next ASAP!
>
> If the above 2 problems aren't critical for merge, then I'll send the
> patches as soon as possible.
Ivo
On Tue, 2009-04-14 at 18:10 -0700, Greg KH wrote:
> On Tue, Apr 14, 2009 at 10:19:06AM -0400, Forest Bond wrote:
> > Hi,
> >
> > On Tue, Apr 14, 2009 at 09:02:48AM -0400, John W. Linville wrote:
> > > On Tue, Apr 14, 2009 at 02:43:54PM +0200, Johannes Berg wrote:
> > > > Hi Marcel,
> > > >
> > > > > just to document the irony here. Two or three years ago at OLS, Kyle and
> > > > > Greg were making fun of Ubuntu merging its 5th wireless stack into their
> > > > > kernel. Now the staging crap is doing exactly the same.
>
> Yes we are. But we are doing it correctly :)
>
> Turns out that people actually want to use their hardware, and no one
> else was working on merging these drivers, so that is what staging is
> for.
If nobody else was working on merging them, then adding them to staging
isn't magically going to make people step up and rewrite the drivers
into a state where they *can* actually be merged.
The solution isn't to drag crap drivers that have no hope of getting
merged without a major rewrite into the kernel, the solution is to get
manufacturers to write drivers that don't suck. And staging doesn't
help that at all; it doesn't encourage manufacturers to stop pushing out
crap.
The only fixes that drivers are getting in staging now are netdev_ops,
whitespace cleanups, and trivial fixes. Nobody is actually rewriting
the Ralink or Via staging drivers to use mac80211, which is what's
needed for them to be merged. Given that they are going nowhere, are
you going to drop them after 6 months of no substantial contributions
that advance their mergability? Or are they going to sit around in
staging forever, sapping away focus and resources that could be better
spent moving wireless forward instead of fixing up a dead-end?
(yes, some wireless drivers in staging are getting attention, but they
are 95% NOT vendor drivers; they are community-originated drivers like
at76_usb or stlc45xx that were written to use mac80211 in the first
place)
Dan
> > Well, gosh, I understand the criticism here and if I were a kernel developer I
> > imagine my perspective would be much the same. But I can't help but feel that
> > there's some amount of hypocrisy when we hammer on a manufacturer to properly
> > license their driver and then let it drop dead when they do.
>
> I agree.
>
> > I understand that the problem would be solved if they manufacturers would
> > suddenly "get it," but the scale of social problem preventing that is likely too
> > large to change anytime soon.
>
> Agreed.
>
> > If kernel developers are too busy to support the hardware, why do the
> > manufacturers take so much criticism for releasing binary-only drivers or badly
> > licensed drivers, or for neglecting to release technical specifications? If
> > what I'm sensing is correct and there's no practical likelihood of these devices
> > getting in-kernel support even with those issues resolved, the criticism almost
> > seems unjustified.
> >
> > I appreciate what the kernel developers do, of course, and my intention is not
> > to ruffle feathers. But when a manufacturer that has taken a lot of criticism
> > for its approach to the Linux community shows some good will, it seems like we
> > ought to be able to turn that into something productive. If we can't, what have
> > we been complaining about?
> >
> > My apologies if I'm way off on this. I haven't been around all that long so it
> > is certainly possible.
>
> You aren't way off at all.
>
> Thanks for the patches, I'll get to them in a few days when my "real
> job" calms down a bit. They're now in my queue, and will not get lost.
>
> thanks,
>
> greg k-h
On Tue, Apr 21, 2009 at 12:30:16PM +0200, Ivo Van Doorn wrote:
> On Mon, Apr 20, 2009 at 3:59 PM, John W. Linville
> <[email protected]> wrote:
> > On Sat, Apr 18, 2009 at 11:18:56PM +0200, Ivo van Doorn wrote:
> >> Hi,
> >>
> >> > > I hope rt2800pci/usb to be included *ASAP*, because rt2800usb =
supports
> >> > > more than 1oo USB devices and rt2800pci is included in a lot o=
f
> >> > > laptops(ask Torvalds [1] [2])
> >> > >
> >> > > [1] http://marc.info/?l=3Dlinux-netdev&m=3D121799144422863&w=3D=
2
> >> > > [2] http://marc.info/?l=3Dlinux-kernel&m=3D123187052023831&w=3D=
2
> >> >
> >> > That would be great to have in, what's keeping it from happening=
?
> >>
> >> In short: A stable workable driver.
> >>
> >> The rt2800usb driver is pretty far (at least on my testsetup), but
> >> still has problems with transmitting frames immediately after
> >> association.
> >
> > I read this as "it works, but some frames are lost immediately afte=
r
> > association" -- is that right?
>=20
> It is not "Some frames" it is "All frames" you can't get a DHCP lease=
,
> or use a static IP and try to do anything.
Is this permanent? Or does it start working at some point?
> Also 11n APs are not detected at all, which for a 11n client sounds
> very problematic.
If 11g works then I think that is good enough to merge.
> > FWIW, this sounds good enough to me
> > to get it into the mainline kernel. =A0_Please_ submit the rt2800us=
b
> > driver for wireless-testing/linux-next ASAP!
>=20
> If the above 2 problems aren't critical for merge, then I'll send the
> patches as soon as possible.
If there is no traffic at all then I guess it can still wait -- ping
seems like a reasonable requirement. But 11n is not a requirement
for merge.
John
--=20
John W. Linville Someday the world will need a hero, and you
[email protected] might be all we have. Be ready.
Max Filippov <[email protected]> writes:
>> I have received a report that at76_usb has worked better than
>> at76c50x-usb. Also p54spi implementation is quite new and not that much
>> tested.
>>
>> If it's ok for you, I would like to have both at76_usb and stlc45xx in
>> the staging area for some time still. I will let you know when they can
>> be removed.
>
> Kalle, what is the primary location for stlc45xx sources then?
I have been thinking about using staging the primary location. What do
you think?
> I see that version in staging is pretty old.
Yeah, I have been planning to patch bomb Greg at some point with all the
patches from the stlc45xx git tree. It's just that n800 support is
currently broken in 2.6.30-rc1 from linux-omap tree :(
--
Kalle Valo
Hi,
On Tue, Apr 14, 2009 at 06:10:20PM -0700, Greg KH wrote:
> On Tue, Apr 14, 2009 at 10:19:06AM -0400, Forest Bond wrote:
> > Hi,
> >
> > On Tue, Apr 14, 2009 at 09:02:48AM -0400, John W. Linville wrote:
> > > On Tue, Apr 14, 2009 at 02:43:54PM +0200, Johannes Berg wrote:
> > > > Hi Marcel,
> > > >
> > > > > just to document the irony here. Two or three years ago at OLS, Kyle and
> > > > > Greg were making fun of Ubuntu merging its 5th wireless stack into their
> > > > > kernel. Now the staging crap is doing exactly the same.
>
> Yes we are. But we are doing it correctly :)
>
> Turns out that people actually want to use their hardware, and no one
> else was working on merging these drivers, so that is what staging is
> for.
>
> > Well, gosh, I understand the criticism here and if I were a kernel developer I
> > imagine my perspective would be much the same. But I can't help but feel that
> > there's some amount of hypocrisy when we hammer on a manufacturer to properly
> > license their driver and then let it drop dead when they do.
>
> I agree.
>
> > I understand that the problem would be solved if they manufacturers would
> > suddenly "get it," but the scale of social problem preventing that is likely too
> > large to change anytime soon.
>
> Agreed.
>
> > If kernel developers are too busy to support the hardware, why do the
> > manufacturers take so much criticism for releasing binary-only drivers or badly
> > licensed drivers, or for neglecting to release technical specifications? If
> > what I'm sensing is correct and there's no practical likelihood of these devices
> > getting in-kernel support even with those issues resolved, the criticism almost
> > seems unjustified.
> >
> > I appreciate what the kernel developers do, of course, and my intention is not
> > to ruffle feathers. But when a manufacturer that has taken a lot of criticism
> > for its approach to the Linux community shows some good will, it seems like we
> > ought to be able to turn that into something productive. If we can't, what have
> > we been complaining about?
> >
> > My apologies if I'm way off on this. I haven't been around all that long so it
> > is certainly possible.
>
> You aren't way off at all.
>
> Thanks for the patches, I'll get to them in a few days when my "real
> job" calms down a bit. They're now in my queue, and will not get lost.
Thanks, Greg. Your reputation is well-deserved, to say the least.
I need to get you some new patches, anyway, as the upstream sources depend on
header files that I failed to provide as they sit in a separate includes
directory. I'll get this sent as soon as time permits (probably today or
tomorrow).
-Forest
--
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
Hi,
On Tue, Apr 14, 2009 at 01:07:38PM +0200, Johannes Berg wrote:
> On Tue, 2009-04-14 at 06:52 -0400, Forest Bond wrote:
> > This patch adds the vt6656 driver to drivers/staging. This code was literally
> > copied from the upstream source archive, available here:
> >
> > http://www.viaarena.com/Driver/VT6656_Linux_src_v1.19_12_x86.zip
> >
> > Copyright: VIA Networking Technologies, Inc.
> > License: GPL
> > Authors: Jerry Chen, Kyle Hsu, Lucas Lin, Lyndon Chen, Tevin Chen, Warren Hsu,
> > Yiching Chen
> > Signed-off-by: Forest Bond <[email protected]>
> >
> > Patch: http://www.alittletooquiet.net/media/code/0002-Add-vt6656-driver-to-drivers-staging.patch.gz
> > Signature: http://www.alittletooquiet.net/media/code/0002-Add-vt6656-driver-to-drivers-staging.patch.gz.sig
>
> Can we also please add files here saying to not bother the
> linux-wireless list about this crap?
I would assume this is somewhat implied for any code in drivers/staging. Is
that not the case?
Thanks,
Forest
--
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
On Tue, Apr 21, 2009 at 02:42:46PM +0200, Ivo Van Doorn wrote:
> On Tue, Apr 21, 2009 at 12:30 PM, Ivo Van Doorn <[email protected]> wrote:
> > On Mon, Apr 20, 2009 at 3:59 PM, John W. Linville
> > <[email protected]> wrote:
> >> On Sat, Apr 18, 2009 at 11:18:56PM +0200, Ivo van Doorn wrote:
> >>> Hi,
> >>>
> >>> > > I hope rt2800pci/usb to be included *ASAP*, because rt2800usb supports
> >>> > > more than 1oo USB devices and rt2800pci is included in a lot of
> >>> > > laptops(ask Torvalds [1] [2])
> >>> > >
> >>> > > [1] http://marc.info/?l=linux-netdev&m=121799144422863&w=2
> >>> > > [2] http://marc.info/?l=linux-kernel&m=123187052023831&w=2
> >>> >
> >>> > That would be great to have in, what's keeping it from happening?
> >>>
> >>> In short: A stable workable driver.
> >>>
> >>> The rt2800usb driver is pretty far (at least on my testsetup), but
> >>> still has problems with transmitting frames immediately after
> >>> association.
> >>
> >> I read this as "it works, but some frames are lost immediately after
> >> association" -- is that right?
> >
> > It is not "Some frames" it is "All frames" you can't get a DHCP lease,
> > or use a static IP and try to do anything.
>
> To clarify a bit, this behavior summarizes the first minute after association,
> after that all frames queued in the past minute are bursted out in a single shot
> and normal traffic is possible again.
Ah, well in that case I'd say let's get it into at least wireless-testing.
John
--
John W. Linville Someday the world will need a hero, and you
[email protected] might be all we have. Be ready.
Hi,
On Tue, Apr 14, 2009 at 09:51:16PM -0400, Forest Bond wrote:
> I need to get you some new patches, anyway, as the upstream sources depend on
> header files that I failed to provide as they sit in a separate includes
> directory. I'll get this sent as soon as time permits (probably today or
> tomorrow).
I have some new patches almost ready, including Kconfig files and Makefiles. I
am in the process of resolving a few build failures.
However, I did have a question:
The vt6655 driver builds viawget.ko, and the vt6656 driver builds vntwusb.ko.
Should the directories be named "viawget" and "vntwusb," respectively, or is it
appropriate for them to be named "vt6655" and "vt6656"?
Thanks,
Forest
--
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
Hi,
I haven't had a chance to test this on real hardware yet. Sorry, I will try to
do this soon.
On Sat, Apr 25, 2009 at 10:32:35AM -0400, Forest Bond wrote:
> @@ -1226,11 +1227,6 @@ static BOOL device_init_info(struct pci_dev* pcid, PSDevice* ppDevice,
>
> PSDevice p;
>
> - *ppDevice = kmalloc(sizeof(DEVICE_INFO),GFP_ATOMIC);
> -
> - if (*ppDevice == NULL)
> - return FALSE;
> -
> memset(*ppDevice,0,sizeof(DEVICE_INFO));
>
> if (pDevice_Infos == NULL) {
I realized that I did not remove the corresponding kfree calls for this removed
kmalloc. Should I resend, or is it better to send an additional patch to be
applied on top of the original patches?
Thanks,
Forest
--
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
Forest Bond <[email protected]> writes:
> Hi Olivier,
>
> On Mon, Jun 08, 2009 at 07:08:14PM +0200, Olivier Blin wrote:
>> By the way, are you sure about the hook below about wpactl.c in commit
>> 8f2c32b86b3ac16ba4c93bf0c2b766089644d9d1 ?
>>
>> If I do the same in vt6656, it is freezing the kernel, or causing random
>> crashes. Removing the netdev priv assignation makes the driver ok.
>> I don't think the wpa priv was really useful, but I fail to see where it
>> was used, and why it caused the hang.
>>
>> Don't you have the same issue with vt6655?
>
> I'm embarrassed to say that I haven't actually tested this change on real
> hardware yet. I've been trying to make changes that do not introduce any
> difference in functionality, but that fix the compile errors resulting from
> changing kernel APIs.
>
> Let me restate that I'm not really a kernel hacker, so much of my work is
> best-effort material. TBH, I don't really understand the wpadev stuff, so it's
> not clear to me why wpadev->priv can be removed. If you have insight here that
> I lack, I'd love to hear it.
Well, same here. My only insight is that I have tested the code on
vt6656 hardware, and that duplicating the device in netdev_priv of
wpadev makes the driver crash the system randomly.
> I should be able to get some real hardware to test on sometime this week.
>
>> BTW, I have some patches to send for vt6656, what is the proper place to
>> submit them since vt6656 is not in staging for now?
>
> I have a similar set of patches for vt6656 mostly prepared that I was going to
> submit to Greg. Hopefully I can do that soon. I suspect your patches are
> roughly the same; if they look anything like the vt6655 patches, they probably
> are.
My first patches are the same, and I ended up reusing your tree.
But I have a few more cleanups.
--
Olivier Blin (blino) - Mandriva
On Tue, Apr 14, 2009 at 12:52 PM, Forest Bond
<[email protected]> wrote:
> This patch adds the vt6656 driver to drivers/staging. ?This code was literally
> copied from the upstream source archive, available here:
>
> ?http://www.viaarena.com/Driver/VT6656_Linux_src_v1.19_12_x86.zip
>
> Copyright: VIA Networking Technologies, Inc.
> License: GPL
> Authors: Jerry Chen, Kyle Hsu, Lucas Lin, Lyndon Chen, Tevin Chen, Warren Hsu,
> ? ? ? ? Yiching Chen
> Signed-off-by: Forest Bond <[email protected]>
>
> Patch: http://www.alittletooquiet.net/media/code/0002-Add-vt6656-driver-to-drivers-staging.patch.gz
> Signature: http://www.alittletooquiet.net/media/code/0002-Add-vt6656-driver-to-drivers-staging.patch.gz.sig
>
> Thanks,
> Forest
> --
> Forest Bond
> http://www.alittletooquiet.net
> http://www.pytagsfs.org
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
>
> iD8DBQFJ5GrQRO4fQQdv5AwRAjRIAKDb73oGJyViwov/yvUomOTKCeQC7wCeJ1Tr
> Sq8Nqu8rIJI/wL7AlIyyRv0=
> =cloX
> -----END PGP SIGNATURE-----
>
>
Did this patch (along with the vt6655 one) somehow get lost? I can't
see it in drivers/staging.
--
Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-)
Forest Bond <[email protected]> writes:
> Hi,
>
> On Mon, Jun 01, 2009 at 06:35:35PM +0200, G?bor Stefanik wrote:
>> On Tue, Apr 14, 2009 at 12:52 PM, Forest Bond
>> <[email protected]> wrote:
>> > This patch adds the vt6656 driver to drivers/staging. ?This code was literally
>> > copied from the upstream source archive, available here:
>> >
>> > ?http://www.viaarena.com/Driver/VT6656_Linux_src_v1.19_12_x86.zip
>> >
>> > Copyright: VIA Networking Technologies, Inc.
>> > License: GPL
>> > Authors: Jerry Chen, Kyle Hsu, Lucas Lin, Lyndon Chen, Tevin Chen, Warren Hsu,
>> > ? ? ? ? Yiching Chen
>> > Signed-off-by: Forest Bond <[email protected]>
>> >
>> > Patch: http://www.alittletooquiet.net/media/code/0002-Add-vt6656-driver-to-drivers-staging.patch.gz
>> > Signature: http://www.alittletooquiet.net/media/code/0002-Add-vt6656-driver-to-drivers-staging.patch.gz.sig
>>
>> Did this patch (along with the vt6655 one) somehow get lost? I can't
>> see it in drivers/staging.
>
> vt6655 is in drivers/staging on linux-next, although I have three more patches
> that I'll be sending to Greg sometime tonight. He has been applying them for
> me.
>
> vt6656 is currently delayed a bit. I may be able to get a start on that
> tonight, as well, but there is likelihood of further delay.
By the way, are you sure about the hook below about wpactl.c in commit
8f2c32b86b3ac16ba4c93bf0c2b766089644d9d1 ?
If I do the same in vt6656, it is freezing the kernel, or causing random
crashes. Removing the netdev priv assignation makes the driver ok.
I don't think the wpa priv was really useful, but I fail to see where it
was used, and why it caused the hang.
Don't you have the same issue with vt6655?
BTW, I have some patches to send for vt6656, what is the proper place to
submit them since vt6656 is not in staging for now?
diff --git a/drivers/staging/vt6655/wpactl.c b/drivers/staging/vt6655/wpactl.c
index ee7109d..cc4f0ad 100644 (file)
--- a/drivers/staging/vt6655/wpactl.c
+++ b/drivers/staging/vt6655/wpactl.c
@@ -112,14 +112,17 @@ static void wpadev_setup(struct net_device *dev)
static int wpa_init_wpadev(PSDevice pDevice)
{
+ PSDevice wpadev_priv;
struct net_device *dev = pDevice->dev;
int ret=0;
- pDevice->wpadev = alloc_netdev(0, "vntwpa", wpadev_setup);
+ pDevice->wpadev = alloc_netdev(sizeof(PSDevice), "vntwpa", wpadev_setup);
if (pDevice->wpadev == NULL)
return -ENOMEM;
- pDevice->wpadev->priv = pDevice;
+ wpadev_priv = netdev_priv(pDevice->wpadev);
+ *wpadev_priv = *pDevice;
+
memcpy(pDevice->wpadev->dev_addr, dev->dev_addr, U_ETHER_ADDR_LEN);
pDevice->wpadev->base_addr = dev->base_addr;
pDevice->wpadev->irq = dev->irq;
--
Olivier Blin (blino) - Mandriva
Hi,
On Mon, Jun 01, 2009 at 06:35:35PM +0200, G?bor Stefanik wrote:
> On Tue, Apr 14, 2009 at 12:52 PM, Forest Bond
> <[email protected]> wrote:
> > This patch adds the vt6656 driver to drivers/staging. ?This code was literally
> > copied from the upstream source archive, available here:
> >
> > ?http://www.viaarena.com/Driver/VT6656_Linux_src_v1.19_12_x86.zip
> >
> > Copyright: VIA Networking Technologies, Inc.
> > License: GPL
> > Authors: Jerry Chen, Kyle Hsu, Lucas Lin, Lyndon Chen, Tevin Chen, Warren Hsu,
> > ? ? ? ? Yiching Chen
> > Signed-off-by: Forest Bond <[email protected]>
> >
> > Patch: http://www.alittletooquiet.net/media/code/0002-Add-vt6656-driver-to-drivers-staging.patch.gz
> > Signature: http://www.alittletooquiet.net/media/code/0002-Add-vt6656-driver-to-drivers-staging.patch.gz.sig
>
> Did this patch (along with the vt6655 one) somehow get lost? I can't
> see it in drivers/staging.
vt6655 is in drivers/staging on linux-next, although I have three more patches
that I'll be sending to Greg sometime tonight. He has been applying them for
me.
vt6656 is currently delayed a bit. I may be able to get a start on that
tonight, as well, but there is likelihood of further delay.
Hope this is helpful.
Thanks,
Forest
--
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
Hi Olivier,
On Mon, Jun 08, 2009 at 07:08:14PM +0200, Olivier Blin wrote:
> By the way, are you sure about the hook below about wpactl.c in commit
> 8f2c32b86b3ac16ba4c93bf0c2b766089644d9d1 ?
>
> If I do the same in vt6656, it is freezing the kernel, or causing random
> crashes. Removing the netdev priv assignation makes the driver ok.
> I don't think the wpa priv was really useful, but I fail to see where it
> was used, and why it caused the hang.
>
> Don't you have the same issue with vt6655?
I'm embarrassed to say that I haven't actually tested this change on real
hardware yet. I've been trying to make changes that do not introduce any
difference in functionality, but that fix the compile errors resulting from
changing kernel APIs.
Let me restate that I'm not really a kernel hacker, so much of my work is
best-effort material. TBH, I don't really understand the wpadev stuff, so it's
not clear to me why wpadev->priv can be removed. If you have insight here that
I lack, I'd love to hear it.
I should be able to get some real hardware to test on sometime this week.
> BTW, I have some patches to send for vt6656, what is the proper place to
> submit them since vt6656 is not in staging for now?
I have a similar set of patches for vt6656 mostly prepared that I was going to
submit to Greg. Hopefully I can do that soon. I suspect your patches are
roughly the same; if they look anything like the vt6655 patches, they probably
are.
Thanks,
Forest
--
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org