Skip to contentSkip to conversation

Staging: vt6656 ?

PATCH New Alexander Beregalov 4 participants 20 messages Jun 9, 2009 – Jul 6, 2009 Staging

lore
Share & tools
lore
#1 lore raw
Quoted 3 lines · Alexander Beregalov

Hi Greg, Forest

Are you going to merge driver for VT6656 also?

If someone sends me some patches for it, sure, I will.

thanks,

greg k-h

#2 lore raw

Hi,

Quoted 6 lines · Greg KH
Quoted 3 lines · Alexander Beregalov

Hi Greg, Forest

Are you going to merge driver for VT6656 also?

If someone sends me some patches for it, sure, I will.

I have patches almost ready. I'll send them by the end of next week at the latest. Busy week here.

-Forest

Signature · 3 lines
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
#3 lore raw

Hi,

Quoted 4 lines · On Tuesday 09 June 2009 13:33:43 Forest Bond wrote:

Hi,

Quoted 1 line · Greg KH

On Tue, Jun 09, 2009 at 02:31:30PM +0400, Alexander Beregalov wrote:

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

Hi Greg, Forest

Are you going to merge driver for VT6656 also?

If someone sends me some patches for it, sure, I will.

I have patches almost ready. I'll send them by the end of next week at the latest. Busy week here.

Did I miss the patch? There are people already doing cleanups for VT6655 driver (which seems to share a great deal of code with VT6656 driver) so it would greatly help to get VT6656 merged ASAP and merge the shared code first to not duplicate efforts.

Also if you need some help with integrating the driver or hosting patches in git tree at kernel.org before Greg picks them up [ he seems to be buried alive by patches at the moment :) ] I'll be happy to help..

Thanks,
Bart

#4 lore raw

Hi,

Quoted 17 lines · Bartlomiej Zolnierkiewicz

Hi,

Quoted 4 lines · On Tuesday 09 June 2009 13:33:43 Forest Bond wrote:

Hi,

Quoted 1 line · Greg KH

On Tue, Jun 09, 2009 at 02:31:30PM +0400, Alexander Beregalov wrote:

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

Hi Greg, Forest

Are you going to merge driver for VT6656 also?

If someone sends me some patches for it, sure, I will.

I have patches almost ready. I'll send them by the end of next week at the latest. Busy week here.

Quoted 8 lines

Did I miss the patch? There are people already doing cleanups for VT6655 driver (which seems to share a great deal of code with VT6656 driver) so it would greatly help to get VT6656 merged ASAP and merge the shared code first to not duplicate efforts.

Also if you need some help with integrating the driver or hosting patches in git tree at kernel.org before Greg picks them up [ he seems to be buried alive by patches at the moment :) ] I'll be happy to help..

I sent it to Greg about two weeks ago. I assume it is in his queue somewhere.

Let me know if you think I ought to do something else with them.

Thanks,
Forest

Signature · 3 lines
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
#5 lore raw
Quoted 25 lines · On Sunday 28 June 2009 15:57:31 Forest Bond wrote:

Hi,

Quoted 22 lines · Bartlomiej Zolnierkiewicz

Hi,

Quoted 4 lines · On Tuesday 09 June 2009 13:33:43 Forest Bond wrote:

Hi,

Quoted 1 line · Greg KH

On Tue, Jun 09, 2009 at 02:31:30PM +0400, Alexander Beregalov wrote:

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

Hi Greg, Forest

Are you going to merge driver for VT6656 also?

If someone sends me some patches for it, sure, I will.

I have patches almost ready. I'll send them by the end of next week at the latest. Busy week here.

Did I miss the patch? There are people already doing cleanups for VT6655 driver (which seems to share a great deal of code with VT6656 driver) so it would greatly help to get VT6656 merged ASAP and merge the shared code first to not duplicate efforts.

Quoted 5 lines
Quoted 3 lines

Also if you need some help with integrating the driver or hosting patches in git tree at kernel.org before Greg picks them up [ he seems to be buried alive by patches at the moment :) ] I'll be happy to help..

I sent it to Greg about two weeks ago. I assume it is in his queue somewhere.

There seems to be a lot of stuff in his queue.. ;)

Quoted 1 line

Let me know if you think I ought to do something else with them.

Please re-post with cc:ing linux-kernel so people looking for them (i.e. me) can pick them up from the list if needed (please also cc: lkml on all patches in the future, thanks!).

[ I'll later setup vt665x branch of my misc.git tree, merge your patches,
merge all outstanding vt6655 patches from Alexander and investigate a bit more whether merge of vt665x drivers is feasible and what needs to be done if so.. ]

Thanks.
Bart

#6 lore raw

Hi,

Quoted 32 lines · Bartlomiej Zolnierkiewicz
Quoted 25 lines · On Sunday 28 June 2009 15:57:31 Forest Bond wrote:

Hi,

Quoted 22 lines · Bartlomiej Zolnierkiewicz

Hi,

Quoted 4 lines · On Tuesday 09 June 2009 13:33:43 Forest Bond wrote:

Hi,

Quoted 1 line · Greg KH

On Tue, Jun 09, 2009 at 02:31:30PM +0400, Alexander Beregalov wrote:

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

Hi Greg, Forest

Are you going to merge driver for VT6656 also?

If someone sends me some patches for it, sure, I will.

I have patches almost ready. I'll send them by the end of next week at the latest. Busy week here.

Did I miss the patch? There are people already doing cleanups for VT6655 driver (which seems to share a great deal of code with VT6656 driver) so it would greatly help to get VT6656 merged ASAP and merge the shared code first to not duplicate efforts.

Quoted 5 lines
Quoted 3 lines

Also if you need some help with integrating the driver or hosting patches in git tree at kernel.org before Greg picks them up [ he seems to be buried alive by patches at the moment :) ] I'll be happy to help..

I sent it to Greg about two weeks ago. I assume it is in his queue somewhere.

Quoted 7 lines

There seems to be a lot of stuff in his queue.. ;)

Quoted 1 line

Let me know if you think I ought to do something else with them.

Please re-post with cc:ing linux-kernel so people looking for them (i.e. me) can pick them up from the list if needed (please also cc: lkml on all patches in the future, thanks!).

Okay. The first patch is quite large, so I will compress it.

Quoted 4 lines

[ I'll later setup vt665x branch of my misc.git tree, merge your patches,
merge all outstanding vt6655 patches from Alexander and investigate a bit more whether merge of vt665x drivers is feasible and what needs to be done if so.. ]

Good.

FYI, there is a known issue with the drivers as I've submitted them that causes lock-ups. Please see the attached message for a suggested fix.

Thanks,
Forest

Signature · 3 lines
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org

From: Olivier Blin <[email protected]>
To: Forest Bond <[email protected]>
Cc: Gábor Stefanik <[email protected]>, Greg KH <[email protected]>,
Larry Finger <[email protected]>,
"John W. Linville" <[email protected]>, [email protected], Dan Williams <[email protected]>
Bcc:
Subject: Re: [PATCH] Add vt6656 driver to drivers/staging. Reply-To:
In-Reply-To: <[email protected]>
X-Spam-Status: No, score=-4.6 required=4.8 tests=AWL,BAYES_00 autolearn=ham

	version=3.2.5
Quoted 22 lines · Forest Bond

Hi,

Quoted 13 lines · Gábor Stefanik
Quoted 11 lines · Forest Bond

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

Quoted 5 lines
Quoted 2 lines

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.

Quoted 6 lines

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?

drivers/staging/vt6655/wpactl.c +5 -2
index ee7109d..cc4f0ad 100644 (file)
@@ -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;
Signature · 1 line
Olivier Blin (blino) - Mandriva
#7 lore raw

Hi,

Quoted 43 lines · On Sunday 28 June 2009 18:47:16 Forest Bond wrote:

Hi,

Quoted 32 lines · Bartlomiej Zolnierkiewicz
Quoted 25 lines · On Sunday 28 June 2009 15:57:31 Forest Bond wrote:

Hi,

Quoted 22 lines · Bartlomiej Zolnierkiewicz

Hi,

Quoted 4 lines · On Tuesday 09 June 2009 13:33:43 Forest Bond wrote:

Hi,

Quoted 1 line · Greg KH

On Tue, Jun 09, 2009 at 02:31:30PM +0400, Alexander Beregalov wrote:

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

Hi Greg, Forest

Are you going to merge driver for VT6656 also?

If someone sends me some patches for it, sure, I will.

I have patches almost ready. I'll send them by the end of next week at the latest. Busy week here.

Did I miss the patch? There are people already doing cleanups for VT6655 driver (which seems to share a great deal of code with VT6656 driver) so it would greatly help to get VT6656 merged ASAP and merge the shared code first to not duplicate efforts.

Quoted 5 lines
Quoted 3 lines

Also if you need some help with integrating the driver or hosting patches in git tree at kernel.org before Greg picks them up [ he seems to be buried alive by patches at the moment :) ] I'll be happy to help..

I sent it to Greg about two weeks ago. I assume it is in his queue somewhere.

Quoted 7 lines

There seems to be a lot of stuff in his queue.. ;)

Quoted 1 line

Let me know if you think I ought to do something else with them.

Please re-post with cc:ing linux-kernel so people looking for them (i.e. me) can pick them up from the list if needed (please also cc: lkml on all patches in the future, thanks!).

Quoted 8 lines

Okay. The first patch is quite large, so I will compress it.

Quoted 4 lines

[ I'll later setup vt665x branch of my misc.git tree, merge your patches,
merge all outstanding vt6655 patches from Alexander and investigate a bit more whether merge of vt665x drivers is feasible and what needs to be done if so.. ]

Good.

The temporary tree is here:

git://git.kernel.org:/pub/scm/linux/kernel/git/bart/misc.git vt665x

and I'll happily apply patches to it till Greg digs out from under the overdue patch queues.. :)

I also took a look at both drivers and unification is certainly possible and desirable, though not as easy as I had hoped initially.. here is the sketch of preliminary TODO for vt6655:

From: Bartlomiej Zolnierkiewicz <[email protected]>
Subject: [PATCH] vt6655: add TODO

---
 drivers/staging/vt6655/TODO |   21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
drivers/staging/vt6655/TODO new file +21 -0
Index: b/drivers/staging/vt6655/TODO
===================================================================
@@ -0,0 +1,21 @@
+TODO:
+- remove __cplusplus ifdefs
+- prepare for merge with vt6656 driver:
+  - rename DEVICE_PRT() to DBG_PRT()
+  - share 80211*.h includes
+  - move code for channel mapping from card.c to channel.c
+  - split rf.c
+  - remove dead code
+  - abstract VT3253 chipset specific code
+- add common vt665x infrastructure
+- kill ttype.h
+- switch to use LIB80211
+- switch to use MAC80211
+- use kernel coding style
+- checkpatch.pl fixes
+- sparse fixes
+- integrate with drivers/net/wireless
+
+Please send any patches to Greg Kroah-Hartman <[email protected]>,
+Forest Bond <[email protected]> and Bartlomiej Zolnierkiewicz
+<[email protected]>.

and the corresponding one for vt6656:

From: Bartlomiej Zolnierkiewicz <[email protected]>
Subject: [PATCH] vt6656: add TODO

---
 drivers/staging/vt6656/TODO |   20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
drivers/staging/vt6656/TODO new file +20 -0
Index: b/drivers/staging/vt6656/TODO
===================================================================
@@ -0,0 +1,20 @@
+TODO:
+- remove __cplusplus ifdefs
+- remove kernel version compatibility wrappers
+- remove support for older wireless extensions
+- prepare for merge with vt6655 driver:
+  - remove PRINT_K() macro
+  - split rf.c
+  - abstract VT3184 chipset specific code
+- add common vt665x infrastructure
+- kill ttype.h
+- switch to use LIB80211
+- switch to use MAC80211
+- use kernel coding style
+- checkpatch.pl fixes
+- sparse fixes
+- integrate with drivers/net/wireless
+
+Please send any patches to Greg Kroah-Hartman <[email protected]>,
+Forest Bond <[email protected]> and Bartlomiej Zolnierkiewicz
+<[email protected]>.
Quoted 2 lines

FYI, there is a known issue with the drivers as I've submitted them that causes lock-ups. Please see the attached message for a suggested fix.

I think that all netdev_priv() changes should be reverted for now:

drivers/staging/vt6655/hostap.c +4 -2
@@ -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;
 

We don't use alloc_netdev() for apdev allocation so by using netdev_priv() later we are potentially accessing unrelated memory part.

drivers/staging/vt6655/wpactl.c +5 -2
@@ -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;

This will copy the current state of pDevice to newly allocated private part of ->apdev but later modifications to the original pDevice won't be seen if we access it through netdev_priv(pDevice->apdev) instead of apdev->priv.

[ I don't know whether this is a problem currently but it looks suspicious. ]

#8 lore raw

Hi,

Quoted 7 lines · Bartlomiej Zolnierkiewicz
Quoted 6 lines · On Sunday 28 June 2009 18:47:16 Forest Bond wrote:
Quoted 4 lines · Bartlomiej Zolnierkiewicz

[ I'll later setup vt665x branch of my misc.git tree, merge your patches,
merge all outstanding vt6655 patches from Alexander and investigate a bit more whether merge of vt665x drivers is feasible and what needs to be done if so.. ]

Quoted 8 lines
Quoted 1 line

Good.

The temporary tree is here:

git://git.kernel.org:/pub/scm/linux/kernel/git/bart/misc.git vt665x

and I'll happily apply patches to it till Greg digs out from under the overdue patch queues.. :)

Thanks for doing this, Bartlomiej.

Quoted 4 lines
Quoted 2 lines

FYI, there is a known issue with the drivers as I've submitted them that causes lock-ups. Please see the attached message for a suggested fix.

I think that all netdev_priv() changes should be reverted for now:

I'm happy to defer to you on this. I don't really understand the code, to be frank. However, if those changes are simply reverted, the driver will not compile. I assume that you mean those areas should be removed?

Quoted 23 lines
drivers/staging/vt6655/wpactl.c +5 -2
@@ -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;
Quoted 5 lines

This will copy the current state of pDevice to newly allocated private part of ->apdev but later modifications to the original pDevice won't be seen if we access it through netdev_priv(pDevice->apdev) instead of apdev->priv.

[ I don't know whether this is a problem currently but it looks suspicious. ]

Agreed. I gave this a best effort, but was not very confident about the result.

Feel free to aggressively rework my changes if it seems appropriate.

Thanks,
Forest

Signature · 3 lines
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
#9 lore raw
Quoted 21 lines · On Thursday 02 July 2009 20:22:08 Forest Bond wrote:

Hi,

Quoted 7 lines · Bartlomiej Zolnierkiewicz
Quoted 6 lines · On Sunday 28 June 2009 18:47:16 Forest Bond wrote:
Quoted 4 lines · Bartlomiej Zolnierkiewicz

[ I'll later setup vt665x branch of my misc.git tree, merge your patches,
merge all outstanding vt6655 patches from Alexander and investigate a bit more whether merge of vt665x drivers is feasible and what needs to be done if so.. ]

Quoted 8 lines
Quoted 1 line

Good.

The temporary tree is here:

git://git.kernel.org:/pub/scm/linux/kernel/git/bart/misc.git vt665x

and I'll happily apply patches to it till Greg digs out from under the overdue patch queues.. :)

Thanks for doing this, Bartlomiej.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

FYI, there is a known issue with the drivers as I've submitted them that causes lock-ups. Please see the attached message for a suggested fix.

I think that all netdev_priv() changes should be reverted for now:

I'm happy to defer to you on this. I don't really understand the code, to be frank. However, if those changes are simply reverted, the driver will not compile. I assume that you mean those areas should be removed?

Uh, you're right.. we need to use netdev_priv().

Quoted 23 lines
Quoted 23 lines
drivers/staging/vt6655/wpactl.c +5 -2
@@ -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;
Quoted 3 lines
Quoted 3 lines

This will copy the current state of pDevice to newly allocated private part of ->apdev but later modifications to the original pDevice won't be seen if we access it through netdev_priv(pDevice->apdev) instead of apdev->priv.

[ it should be wpadev not apdev in the above description ]

Quoted 3 lines
Quoted 1 line

[ I don't know whether this is a problem currently but it looks suspicious. ]

Agreed. I gave this a best effort, but was not very confident about the result.

The code is puzzling (at best) -- I still don't know why do we need separate netdev structure for hostap or wpactl functionality..

Quoted 1 line

Feel free to aggressively rework my changes if it seems appropriate.

I don't think there is a need for it and I would like to avoid that since I'm also involved in other drivers/staging/ drivers (besides you and Alexander are doing just fine :).

Seems like all we need to do to fix the problem is:

* fix code in hostap to also use alloc_netdev()

* bring back "manual" allocation of PSDevice structure

* use private netdev areas only to store the pointer to the single PSDevice structure that we allocate "manually" (requires converting all netdev_priv() instances to *netdev_priv() etc but the change should be straightforward).

#10 lore raw

PATCH 1/8 Add pristine upstream vt6656 driver sources to drivers/staging/vt6656.

In reply to Bartlomiej Zolnierkiewicz

[Greg: This patch series does not differ from that which you already have.]

Add pristine upstream vt6656 driver sources to drivers/staging/vt6656. These files were copied from the driver directory in the upstream source archive, available here:

http://www.viaarena.com/Driver/VT6656_Linux_src_v1.19_12_x86.zip

After copying, trailing whitespace was stripped. This is GPL-licensed code.

[Patch compressed and attached due to large size.]

#11 lore raw

PATCH 2/8 Add includes to drivers/staging/vt6656.

In reply to Bartlomiej Zolnierkiewicz

[Greg: This patch series does not differ from that which you already have.]

Add includes to drivers/staging/vt6656. These came from the includes directory in the upstream source archive. Trailing whitespace was stripped. This is GPL-licensed code.

---
 drivers/staging/vt6656/device_cfg.h |  146 +++++++++++
 drivers/staging/vt6656/iocmd.h      |  478 +++++++++++++++++++++++++++++++++++
 drivers/staging/vt6656/iowpa.h      |  159 ++++++++++++
 drivers/staging/vt6656/ttype.h      |   11 +-
 4 files changed, 791 insertions(+), 3 deletions(-)
 create mode 100644 drivers/staging/vt6656/device_cfg.h
 create mode 100644 drivers/staging/vt6656/iocmd.h
 create mode 100644 drivers/staging/vt6656/iowpa.h
drivers/staging/vt6656/device_cfg.h new file +146 -0
new file mode 100644
index 0000000..c0492bd
@@ -0,0 +1,146 @@
+/*
+ * Copyright (c) 1996, 2003 VIA Networking Technologies, 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 9, 2005
+ *
+ */
+#ifndef __DEVICE_CONFIG_H
+#define __DEVICE_CONFIG_H
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
+#include <linux/config.h>
+#endif
+
+#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         "vntwusb"
+#define DEVICE_FULL_DRV_NAM "VIA Networking Wireless LAN USB Driver"
+
+#ifndef MAJOR_VERSION
+#define MAJOR_VERSION       1
+#endif
+
+#ifndef MINOR_VERSION
+#define MINOR_VERSION       13
+#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{
+    VT3184=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
drivers/staging/vt6656/iocmd.h new file +478 -0

478 lines not on this page · raw message

drivers/staging/vt6656/iowpa.h new file +159 -0

159 lines not on this page · raw message

drivers/staging/vt6656/ttype.h +8 -3
index c91a273..1e72f11 100644
@@ -1,5 +1,6 @@
 /*
- * File: ttype.h
+ * Copyright (c) 1996, 2003 VIA Networking Technologies, 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
@@ -15,6 +16,8 @@
  * with this program; if not, write to the Free Software Foundation, Inc.,
  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  *
+ * File: ttype.h
+ *
  * Purpose: define basic common types and macros
  *
  * Author: Tevin Chen
@@ -50,18 +53,20 @@
 #define OUT
 #endif
 
-//2007-0115-04<Add>by MikeLiu
+//2007-0115-05<Add>by MikeLiu
 #ifndef TxInSleep
 #define TxInSleep
 #endif
 
+//DavidWang
+
 
 //2007-0814-01<Add>by MikeLiu
 #ifndef Safe_Close
 #define Safe_Close
 #endif
 
-//2008-0131-01<Add>by MikeLiu
+//2008-0131-02<Add>by MikeLiu
 #ifndef Adhoc_STA
 #define Adhoc_STA
 #endif
Signature · 7 lines
1.5.6.3


-- 
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
#12 lore raw

PATCH 3/8 Build vt6656.ko, not vntwusb.ko.

In reply to Bartlomiej Zolnierkiewicz

[Greg: This patch series does not differ from that which you already have.]

Build vt6656.ko, not vntwusb.ko.

---
 drivers/staging/vt6656/device_cfg.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/staging/vt6656/device_cfg.h +1 -1
index c0492bd..f272c98 100644
@@ -89,7 +89,7 @@ struct _version {
 #define VCAM_SIZE           32
 #define TX_QUEUE_NO         8
 
-#define DEVICE_NAME         "vntwusb"
+#define DEVICE_NAME         "vt6656"
 #define DEVICE_FULL_DRV_NAM "VIA Networking Wireless LAN USB Driver"
 
 #ifndef MAJOR_VERSION
Signature · 7 lines
1.5.6.3


-- 
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
#13 lore raw

PATCH 4/8 drivers/staging/vt6656/main_usb.c: Drop obsolete fsuid/fsgid accesses.

In reply to Bartlomiej Zolnierkiewicz

[Greg: This patch series does not differ from that which you already have.]

drivers/staging/vt6656/main_usb.c: Drop obsolete fsuid/fsgid accesses.

---
 drivers/staging/vt6656/main_usb.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)
drivers/staging/vt6656/main_usb.c +9 -4
index 3368e83..f181d23 100644
@@ -1655,15 +1655,17 @@ static UCHAR *Config_FileOperation(PSDevice pDevice) {
     UCHAR    *buffer=NULL;
     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;
+    /* 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->fsuid;
+    oldfsgid=current->fsgid;
     current->fsuid = 0;
     current->fsgid = 0;
+    */
 
     //open file
       filp = filp_open(config_path, O_RDWR, 0);
@@ -1697,8 +1699,11 @@ error1:
 
 error2:
   set_fs (old_fs);
+
+  /*
   current->fsuid=oldfsuid;
   current->fsgid=oldfsgid;
+  */
 
 if(result!=0) {
     if(buffer)
Signature · 7 lines
1.5.6.3


-- 
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
#14 lore raw

PATCH 5/8 vt6656: Replace net_device->priv accesses with netdev_priv calls.

In reply to Bartlomiej Zolnierkiewicz

[Greg: This patch series does not differ from that which you already have.]

vt6656: Replace net_device->priv accesses with netdev_priv calls.

---
 drivers/staging/vt6656/hostap.c   |    4 ++-
 drivers/staging/vt6656/iwctl.c    |   66 ++++++++++++++++++------------------
 drivers/staging/vt6656/main_usb.c |   28 +++++++---------
 drivers/staging/vt6656/wpactl.c   |    6 ++-
 4 files changed, 52 insertions(+), 52 deletions(-)
drivers/staging/vt6656/hostap.c +3 -1
index 78312f8..b6ca36a 100644
@@ -103,6 +103,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;
 
@@ -113,7 +114,8 @@ static int hostap_enable_hostapd(PSDevice pDevice, int rtnl_locked)
 		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;
drivers/staging/vt6656/iwctl.c +33 -33

264 lines not on this page · raw message

drivers/staging/vt6656/main_usb.c +12 -16
index f181d23..12a9ae0 100644
@@ -866,15 +866,8 @@ vntwusb_found1(struct usb_device *udev, UINT interface, const struct usb_device_
   udev = usb_get_dev(udev);
 #endif
 
-	pDevice = kmalloc(sizeof(DEVICE_INFO), GFP_KERNEL);
-	if (pDevice == NULL) {
-	    printk(KERN_ERR DEVICE_NAME ": allocate usb device failed \n");
-	    goto err_nomem;
-	}
-    memset(pDevice, 0, sizeof(DEVICE_INFO));
-
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
-    netdev = alloc_etherdev(0);
+    netdev = alloc_etherdev(sizeof(DEVICE_INFO));
 #else
     netdev = init_etherdev(netdev, 0);
 #endif
@@ -884,6 +877,10 @@ vntwusb_found1(struct usb_device *udev, UINT interface, const struct usb_device_
         kfree(pDevice);
 	    goto err_nomem;
     }
+
+    pDevice = netdev_priv(netdev);
+    memset(pDevice, 0, sizeof(DEVICE_INFO));
+
     pDevice->dev = netdev;
     pDevice->usb = udev;
 
@@ -899,7 +896,6 @@ vntwusb_found1(struct usb_device *udev, UINT interface, const struct usb_device_
     pDevice->tx_80211 = device_dma0_tx_80211;
     pDevice->sMgmtObj.pAdapter = (PVOID)pDevice;
 
-	netdev->priv               = pDevice;
     netdev->open               = device_open;
     netdev->hard_start_xmit    = device_xmit;
     netdev->stop               = device_close;
@@ -1205,7 +1201,7 @@ BOOL device_alloc_frag_buf(PSDevice pDevice, PSDeFragControlBlock pDeF) {
 /*-----------------------------------------------------------------*/
 
 static int  device_open(struct net_device *dev) {
-    PSDevice    pDevice=(PSDevice) dev->priv;
+    PSDevice    pDevice=(PSDevice) netdev_priv(dev);
 
 #ifdef WPA_SM_Transtatus
      extern SWPAResult wpa_Result;
@@ -1348,7 +1344,7 @@ free_rx_tx:
 
 
 static int  device_close(struct net_device *dev) {
-    PSDevice    pDevice=(PSDevice) dev->priv;
+    PSDevice    pDevice=(PSDevice) netdev_priv(dev);
     PSMgmtObject     pMgmt = &(pDevice->sMgmtObj);
 
    #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,21)
@@ -1507,7 +1503,7 @@ device_release_WPADEV(pDevice);
 
 
 static int device_dma0_tx_80211(struct sk_buff *skb, struct net_device *dev) {
-    PSDevice        pDevice=dev->priv;
+    PSDevice        pDevice=netdev_priv(dev);
     PBYTE           pbMPDU;
     UINT            cbMPDULen = 0;
 
@@ -1535,7 +1531,7 @@ static int device_dma0_tx_80211(struct sk_buff *skb, struct net_device *dev) {
 
 
 static int  device_xmit(struct sk_buff *skb, struct net_device *dev) {
-    PSDevice    pDevice=dev->priv;
+    PSDevice    pDevice=netdev_priv(dev);
     struct net_device_stats* pStats = &pDevice->stats;
 
 
@@ -1768,7 +1764,7 @@ static int Read_config_file(PSDevice pDevice) {
 }
 
 static void device_set_multi(struct net_device *dev) {
-    PSDevice         pDevice = (PSDevice) dev->priv;
+    PSDevice         pDevice = (PSDevice) netdev_priv(dev);
     PSMgmtObject     pMgmt = &(pDevice->sMgmtObj);
     u32              mc_filter[2];
     int              ii;
@@ -1833,14 +1829,14 @@ static void device_set_multi(struct net_device *dev) {
 
 
 static struct net_device_stats *device_get_stats(struct net_device *dev) {
-    PSDevice pDevice=(PSDevice) dev->priv;
+    PSDevice pDevice=(PSDevice) netdev_priv(dev);
 
     return &pDevice->stats;
 }
 
 
 static int  device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) {
-	PSDevice	        pDevice = (PSDevice)dev->priv;
+	PSDevice	        pDevice = (PSDevice)netdev_priv(dev);
     PSMgmtObject        pMgmt = &(pDevice->sMgmtObj);
     PSCmdRequest        pReq;
     //BOOL                bCommit = FALSE;
drivers/staging/vt6656/wpactl.c +4 -2
index 9345459..37c2900 100644
@@ -115,14 +115,16 @@ 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;
Signature · 7 lines
1.5.6.3


-- 
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
#15 lore raw

PATCH 6/8 vt6656: use net_device_ops for management functions

In reply to Bartlomiej Zolnierkiewicz

[Greg: This patch series does not differ from that which you already have.]

vt6656: use net_device_ops for management functions

---
 drivers/staging/vt6656/hostap.c   |    7 ++++++-
 drivers/staging/vt6656/main_usb.c |   19 +++++++++++++------
 2 files changed, 19 insertions(+), 7 deletions(-)
drivers/staging/vt6656/hostap.c +6 -1
index b6ca36a..223604d 100644
@@ -117,7 +117,12 @@ static int hostap_enable_hostapd(PSDevice pDevice, int rtnl_locked)
     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;
+
+	const struct net_device_ops apdev_netdev_ops = {
+		.ndo_start_xmit         = pDevice->tx_80211,
+	};
+	pDevice->apdev->netdev_ops = &apdev_netdev_ops;
+
 	pDevice->apdev->type = ARPHRD_IEEE80211;
 
 	pDevice->apdev->base_addr = dev->base_addr;
drivers/staging/vt6656/main_usb.c +13 -6
index 12a9ae0..228b3ec 100644
@@ -837,6 +837,17 @@ static int vntwusb_resume(struct usb_interface *intf)
 }
 #endif
 
+
+static const struct net_device_ops device_netdev_ops = {
+    .ndo_open               = device_open,
+    .ndo_stop               = device_close,
+    .ndo_do_ioctl           = device_ioctl,
+    .ndo_get_stats          = device_get_stats,
+    .ndo_start_xmit         = device_xmit,
+    .ndo_set_multicast_list = device_set_multi,
+};
+
+
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
 
 static int
@@ -896,12 +907,8 @@ vntwusb_found1(struct usb_device *udev, UINT interface, const struct usb_device_
     pDevice->tx_80211 = device_dma0_tx_80211;
     pDevice->sMgmtObj.pAdapter = (PVOID)pDevice;
 
-    netdev->open               = device_open;
-    netdev->hard_start_xmit    = device_xmit;
-    netdev->stop               = device_close;
-    netdev->get_stats          = device_get_stats;
-    netdev->set_multicast_list = device_set_multi;
-    netdev->do_ioctl           = device_ioctl;
+    netdev->netdev_ops         = &device_netdev_ops;
+
 #ifdef WIRELESS_EXT
 
 //2007-0508-01<Add>by MikeLiu
Signature · 7 lines
1.5.6.3


-- 
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
#16 lore raw

PATCH 7/8 vt6656: replace call to info with printk call.

In reply to Bartlomiej Zolnierkiewicz

[Greg: This patch series does not differ from that which you already have.]

vt6656: replace call to info with printk call.

---
 drivers/staging/vt6656/main_usb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/staging/vt6656/main_usb.c +1 -1
index 228b3ec..722b739 100644
@@ -2392,7 +2392,7 @@ static struct usb_driver vntwusb_driver = {
 
 static int __init vntwusb_init_module(void)
 {
-	info(DEVICE_FULL_DRV_NAM " " DEVICE_VERSION);
+    printk(KERN_NOTICE DEVICE_FULL_DRV_NAM " " DEVICE_VERSION);
     return usb_register(&vntwusb_driver);
 }
 
Signature · 7 lines
1.5.6.3


-- 
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
#17 lore raw

PATCH 8/8 Integrate drivers/staging/vt6656 into build system.

In reply to Bartlomiej Zolnierkiewicz

[Greg: This patch series does not differ from that which you already have.]

Integrate drivers/staging/vt6656 into build system.

---
 drivers/staging/Kconfig         |    2 +
 drivers/staging/Makefile        |    1 +
 drivers/staging/vt6656/Kconfig  |    5 +
 drivers/staging/vt6656/Makefile |  243 ++++++--------------------------------
 4 files changed, 47 insertions(+), 204 deletions(-)
 create mode 100644 drivers/staging/vt6656/Kconfig
drivers/staging/Kconfig +2 -0
index cefb74f..53fafc0 100644
@@ -127,5 +127,7 @@ source "drivers/staging/udlfb/Kconfig"
 
 source "drivers/staging/octeon/Kconfig"
 
+source "drivers/staging/vt6656/Kconfig"
+
 endif # !STAGING_EXCLUDE_BUILD
 endif # STAGING
drivers/staging/Makefile +1 -0
index d110f6f..a1ce926 100644
@@ -46,3 +46,4 @@ obj-$(CONFIG_USB_CPC)		+= cpc-usb/
 obj-$(CONFIG_RDC_17F3101X)	+= pata_rdc/
 obj-$(CONFIG_FB_UDL)		+= udlfb/
 obj-$(CONFIG_OCTEON_ETHERNET)	+= octeon/
+obj-$(CONFIG_VT6656)		+= vt6656/
drivers/staging/vt6656/Kconfig new file +5 -0
new file mode 100644
index 0000000..f823a74
@@ -0,0 +1,5 @@
+config VT6656
+	tristate "VIA Technologies VT6656 support"
+	---help---
+	This is a vendor-written driver for VIA VT6656.
+
drivers/staging/vt6656/Makefile +39 -204

243 lines not on this page · raw message

Signature · 7 lines
1.5.6.3


-- 
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org
#18 lore raw
In reply to Forest Bond
Quoted 25 lines · Forest Bond

Hi,

Quoted 22 lines · Bartlomiej Zolnierkiewicz

Hi,

Quoted 4 lines · On Tuesday 09 June 2009 13:33:43 Forest Bond wrote:

Hi,

Quoted 1 line · Greg KH

On Tue, Jun 09, 2009 at 02:31:30PM +0400, Alexander Beregalov wrote:

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

Hi Greg, Forest

Are you going to merge driver for VT6656 also?

If someone sends me some patches for it, sure, I will.

I have patches almost ready. I'll send them by the end of next week at the latest. Busy week here.

Did I miss the patch? There are people already doing cleanups for VT6655 driver (which seems to share a great deal of code with VT6656 driver) so it would greatly help to get VT6656 merged ASAP and merge the shared code first to not duplicate efforts.

Quoted 7 lines
Quoted 3 lines

Also if you need some help with integrating the driver or hosting patches in git tree at kernel.org before Greg picks them up [ he seems to be buried alive by patches at the moment :) ] I'll be happy to help..

I sent it to Greg about two weeks ago. I assume it is in his queue somewhere.

Let me know if you think I ought to do something else with them.

Yes, sorry, I am burried in patches right now. I hope to dig out this week...

All them are not lost, don't worry.

thanks,

greg k-h

#19 lore raw

Howdie,

Quoted 7 lines · Greg KH
Quoted 3 lines · Forest Bond

I sent it to Greg about two weeks ago. I assume it is in his queue somewhere.

Let me know if you think I ought to do something else with them.

Yes, sorry, I am burried in patches right now. I hope to dig out this week...

No need to apologize. Your work is appreciated!

-Forest

Signature · 3 lines
Forest Bond
http://www.alittletooquiet.net
http://www.pytagsfs.org