Skip to contentSkip to conversation

acxsm: Make acx mdoular again

RFC Applied Denis Vlasenko 3 participants 6 messages Feb 27, 2006 – Mar 21, 2006 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 18 lines · Carlos Martín

Hi,

Well, here it is. I've not been able to run-test it yet, but it at least compiles and loads without problems. This is on x86_64 compiled against Linville's wireless-2.6 git tree. (I don't have any x86 boxes running Linux right now, but it should be alright).

I've added a struct acx_ops with function pointers and deleted the functions that just call the PCI/USB version depending on what we're using at the moment. A few functions I've just made empty to simplify and not having to check every time wether we do have it or not. These are only called on load/unload and error conditions. Normal operation shouldn't suffer any speed decrease it may be faster at times because we dereference a few pointers instead of calling a couple of functions (just guessing, though).

The patch is 38K uncompressed. I've compressed and attached it and uploaded to
http://www.cmartin.tk/acx/acxsm-modularise.patch

Quoted 6 lines

text data bss dec hex filename

  55491     588       4   56083    db13 acx-common.ko
  33523    1040       4   34567    8707 acx-pci.ko
  17109    1008       0   18117    46c5 acx-usb.ko

Comments are welcome and I'll split the patch if needed.

usb.c
=====
#define BOGUS_SAFETY_PADDING 0x40

int
acxusb_s_issue_cmd_timeo(
acx_device_t *adev,
unsigned cmd,
void *buffer,
unsigned buflen,
unsigned timeout)
{

#if ACX_DEBUG
        return acx_s_issue_cmd_timeo_debug(adev, cmd, buffer, buflen, timeout, __stringify(cmd));
#else
        return acx_s_issue_cmd_timeo_debug(adev, cmd, buffer, buflen, timeout);

#endif
}

stringify what? We want symbolic command name, not it's numeric value. stringifying must occur in .h file.

acx_func.h
==========
#if ACX_DEBUG

/* We want to log cmd names */
int acxpci_s_issue_cmd_timeo_debug(acx_device_t *adev, unsigned cmd, void *param, unsigned len, unsigned timeout, const char* cmdstr); int acxusb_s_issue_cmd_timeo_debug(acx_device_t *adev, unsigned cmd, void *param, unsigned len, unsigned timeout, const char* cmdstr); static inline int
acx_s_issue_cmd_timeo_debug(acx_device_t *adev, unsigned cmd, void *param, unsigned len, unsigned timeout, const char* cmdstr)

{
        if (IS_PCI(adev))
                return acxpci_s_issue_cmd_timeo_debug(adev, cmd, param, len, timeout, cmdstr);
        return acxusb_s_issue_cmd_timeo_debug(adev, cmd, param, len, timeout, cmdstr);
}

int acx_s_issue_cmd(acx_device_t *adev, unsigned cmd, void *param, unsigned len);

It will recurse: acx_s_issue_cmd_timeo_debug -> acxusb_s_issue_cmd_timeo_debug -> acx_s_issue_cmd_timeo_debug ->.... Why do you need if (IS_PCI(adev)) at all?

Please apply the attached style fixes on top of your patches.

Patch is not applied. Sorry.
--
vda

acx_func.h +1 -1
diff -urpN current_sm.1/acx_func.h current_sm.2/acx_func.h
@@ -444,7 +444,7 @@ int acx_s_interrogate_debug(acx_device_t
 #else
 
 
-/* We can't make this a #define or inline because we need to referece it. */
+/* We can't make this a #define or inline because we need to reference it. */
 int acx_s_issue_cmd(acx_device_t *adev, unsigned cmd, void *param, unsigned len);
 
 int acxpci_s_issue_cmd_timeo(acx_device_t *adev, unsigned cmd, void *param, unsigned len, unsigned timeout);
common.c +6 -5
diff -urpN current_sm.1/common.c current_sm.2/common.c
@@ -331,10 +331,11 @@ acx_log_fn_exit_v(const char *funcname, 
 EXPORT_SYMBOL_GPL(acx_log_fn_exit_v);
 #endif /* ACX_DEBUG > 1 */
 
-int acx_s_issue_cmd(acx_device_t *adev, unsigned cmd, void *param, unsigned len)
+int
+acx_s_issue_cmd(acx_device_t *adev, unsigned cmd, void *param, unsigned len)
 {
-  return adev->ops.issue_cmd_timeo(adev, cmd, param, len,
-				   ACX_CMD_TIMEOUT_DEFAULT);
+	return adev->ops.issue_cmd_timeo(adev, cmd, param, len,
+				ACX_CMD_TIMEOUT_DEFAULT);
 }
 
 EXPORT_SYMBOL_GPL(acx_s_issue_cmd);
@@ -1940,7 +1941,7 @@ acx_s_scan_chan(acx_device_t *adev)
 	FN_EXIT0;
 }
 
- EXPORT_SYMBOL_GPL(acx_s_scan_chan);
+EXPORT_SYMBOL_GPL(acx_s_scan_chan);
 
 void
 acx_s_cmd_start_scan(acx_device_t *adev)
@@ -2059,7 +2060,7 @@ acx111_s_feature_set(acx_device_t *adev,
 /***********************************************************************
 ** acx100_s_init_memory_pools
 */
-int
+static int
 acx100_s_init_memory_pools(acx_device_t *adev, const acx_ie_memmap_t *mmt)
 {
 	acx100_ie_memblocksize_t MemoryBlockSize;
pci.c +5 -1
diff -urpN current_sm.1/pci.c current_sm.2/pci.c
@@ -3089,7 +3089,11 @@ end:
 	return (tx_t*)txdesc;
 }
 
-void acxpci_l_dealloc_tx(tx_t *tx_opaque){}
+void
+acxpci_l_dealloc_tx(tx_t *tx_opaque)
+{
+}
+
 
 /***********************************************************************
 */
#2 lore raw
Quoted 6 lines · Denis Vlasenko
Quoted 1 line

Comments are welcome and I'll split the patch if needed.

usb.c
=====
#define BOGUS_SAFETY_PADDING 0x40

Quoted 10 lines

int
acxusb_s_issue_cmd_timeo(
acx_device_t *adev,
unsigned cmd,
void *buffer,
unsigned buflen,
unsigned timeout)
{
#if ACX_DEBUG
return acx_s_issue_cmd_timeo_debug(adev, cmd, buffer, buflen,

timeout, __stringify(cmd));

Quoted 2 lines

#else
return acx_s_issue_cmd_timeo_debug(adev, cmd, buffer, buflen,

timeout);

Quoted 5 lines

#endif
}

stringify what? We want symbolic command name, not it's numeric value. stringifying must occur in .h file.

Missed that. The problem is that right now we need to reference the function. There's no real need for it, so I'll change it.

Quoted 8 lines

acx_func.h
==========
#if ACX_DEBUG

/* We want to log cmd names */
int acxpci_s_issue_cmd_timeo_debug(acx_device_t *adev, unsigned cmd, void

*param, unsigned len, unsigned timeout, const char* cmdstr);

Quoted 1 line

int acxusb_s_issue_cmd_timeo_debug(acx_device_t *adev, unsigned cmd, void

*param, unsigned len, unsigned timeout, const char* cmdstr);

Quoted 2 lines

static inline int
acx_s_issue_cmd_timeo_debug(acx_device_t *adev, unsigned cmd, void *param,

unsigned len, unsigned timeout, const char* cmdstr)

Quoted 3 lines

{
if (IS_PCI(adev))
return acxpci_s_issue_cmd_timeo_debug(adev, cmd, param, len,

timeout, cmdstr);

Quoted 1 line

return acxusb_s_issue_cmd_timeo_debug(adev, cmd, param, len,

timeout, cmdstr);

Quoted 2 lines

}
int acx_s_issue_cmd(acx_device_t *adev, unsigned cmd, void *param, unsigned

len);

Quoted 2 lines

It will recurse: acx_s_issue_cmd_timeo_debug ->

acxusb_s_issue_cmd_timeo_debug -> acx_s_issue_cmd_timeo_debug ->....

I forgot to remove that function. In acxusb_s_issue_timeo, it should call acxusb_s_issue_cmd_timeo_{debug,nodebug}, not the generic function.

Quoted 3 lines

Why do you need if (IS_PCI(adev)) at all?

Please apply the attached style fixes on top of your patches.

Will do.

cmn

Signature · 9 lines
Carlos Martín Nieto    |   http://www.cmartin.tk
Hobbyist programmer    |


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
#3 lore raw
Quoted 2 lines · Carlos Martín
Quoted 1 line · Denis Vlasenko
Quoted 1 line

Comments are welcome and I'll split the patch if needed.

Denis are you applying this patch to your tree? If so, I'll rely on you to push it to me when you are ready.

If not, then I will need Carlos to generate the diffs so that they can be applied to the top of the tree with -p1.

http://linux.yyz.us/patch-format.html

Thanks,

John

Signature · 9 lines
John W. Linville
[email protected]


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
#4 lore raw
Quoted 6 lines · John W. Linville
Quoted 2 lines · Carlos Martín
Quoted 1 line · Denis Vlasenko
Quoted 1 line

Comments are welcome and I'll split the patch if needed.

Denis are you applying this patch to your tree? If so, I'll rely on you to push it to me when you are ready.

Not yet, patch needs some fixes.
--
vda

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642

#5 lore raw

PATCH 1/1 wireless.git: update acxsm to 0.4.7

In reply to John W. Linville
Quoted 11 lines · John W. Linville
Quoted 2 lines · Carlos Martín
Quoted 1 line · Denis Vlasenko
Quoted 1 line

Comments are welcome and I'll split the patch if needed.

Denis are you applying this patch to your tree? If so, I'll rely on you to push it to me when you are ready.

If not, then I will need Carlos to generate the diffs so that they can be applied to the top of the tree with -p1.

http://linux.yyz.us/patch-format.html

Changelog:

[20060301] 0.4.7
* Carlos Martin <[email protected]>
- splitted monolithic module into acx-common + acx-pci + acx-usb modules

[20060212] 0.4.6
* Carlos Martin <[email protected]>
- Fix breakage of "Get rid of circular list of adev's"
- Remove .owner = THIS_MODULE

[20060209] 0.4.5
* Get rid of circular list of adev's

[20060208]
* Change the acx_ioctl_{get,set}_encode functions to use the 80211 stack in the kernel, so they become mere wrappers.

[20060206]
* Register driver device ids to usb device table

[20060205] 0.4.4
* Andreas Mohr <[email protected]>
- implement much more flexible firmware statistics parsing (for /proc/driver/acx_wlanX_diag)
This has the nice effect that we now get output for both the older TNETW1100 USB and TNETW1450.
Since firmware statistics information has non-stable layout depending on firmware version, please report if you suspect any parsing mismatch! This improved version now uses 2kB more driver space, unfortunately.
- use "% 8" modulo instead of more complicated "% 5" calculation

--
vda

drivers/net/wireless/Makefile +2 -1
diff -urpN wireless-2.6.git/drivers/net/wireless/Makefile wireless-2.6.git.acx/drivers/net/wireless/Makefile
@@ -37,7 +37,8 @@ obj-$(CONFIG_PRISM54_USB)	+= prism54usb/
 
 obj-$(CONFIG_HOSTAP)		+= hostap/
 obj-$(CONFIG_BCM43XX)		+= bcm43xx/
-obj-$(CONFIG_ACX)		+= tiacx/
+obj-$(CONFIG_ACX_PCI)		+= tiacx/
+obj-$(CONFIG_ACX_USB)		+= tiacx/
 
 # 16-bit wireless PCMCIA client drivers
 obj-$(CONFIG_PCMCIA_RAYCS)	+= ray_cs.o
drivers/net/wireless/tiacx/Changelog +31 -0
diff -urpN wireless-2.6.git/drivers/net/wireless/tiacx/Changelog wireless-2.6.git.acx/drivers/net/wireless/tiacx/Changelog
@@ -70,6 +70,37 @@ TODO: from Efthym <[email protected]>:
 13:13:32 wlan0: tx error 0x20, buf 05!
 13:13:32 wlan0: tx error 0x20, buf 06!
 
+[20060301] 0.4.7
+* Carlos Martin <[email protected]>
+  - splitted monolithic module into acx-common + acx-pci + acx-usb
+    modules
+
+[20060212] 0.4.6
+* Carlos Martin <[email protected]>
+  - Fix breakage of "Get rid of circular list of adev's"
+  - Remove .owner = THIS_MODULE
+
+[20060209] 0.4.5
+* Get rid of circular list of adev's
+
+[20060208]
+* Change the acx_ioctl_{get,set}_encode functions to use
+  the 80211 stack in the kernel, so they become mere wrappers.
+
+[20060206]
+* Register driver device ids to usb device table
+
+[20060205] 0.4.4
+* Andreas Mohr <[email protected]>
+  - implement much more flexible firmware statistics parsing
+    (for /proc/driver/acx_wlanX_diag)
+    This has the nice effect that we now get output for both the older
+    TNETW1100 USB and TNETW1450.
+    Since firmware statistics information has non-stable layout depending on
+    firmware version, please report if you suspect any parsing mismatch!
+    This improved version now uses 2kB more driver space, unfortunately.
+  - use "% 8" modulo instead of more complicated "% 5" calculation
+
 [20060203] 0.4.3
 * merge from acx 0.3.32
 
drivers/net/wireless/tiacx/Kconfig +18 -23

63 lines not on this page · raw message

drivers/net/wireless/tiacx/Makefile +5 -5
diff -urpN wireless-2.6.git/drivers/net/wireless/tiacx/Makefile wireless-2.6.git.acx/drivers/net/wireless/tiacx/Makefile
@@ -1,6 +1,6 @@
-obj-$(CONFIG_ACX) += acx.o
+acx-common-y := wlan.o ioctl.o common.o
+acx-usb-y := usb.o
+acx-pci-y := pci.o
 
-acx-obj-$(CONFIG_ACX_PCI_BOOL) += pci.o
-acx-obj-$(CONFIG_ACX_USB_BOOL) += usb.o
-
-acx-objs := wlan.o ioctl.o common.o $(acx-obj-y)
+obj-$(CONFIG_ACX_PCI) += acx-common.o acx-pci.o
+obj-$(CONFIG_ACX_USB) += acx-common.o acx-usb.o
drivers/net/wireless/tiacx/README +21 -8
diff -urpN wireless-2.6.git/drivers/net/wireless/tiacx/README wireless-2.6.git.acx/drivers/net/wireless/tiacx/README
@@ -1,21 +1,16 @@
-*** Not run tested. Almost certainly won't work. Lots of things are TODO. ***
+*** Barely works. Lots of things are TODO. ***
 
 This tarball contains a port of acx driver to ieee80211softmac
 stack. Broadcom 43xx driver was used as an example.
 See http://bcm43xx.berlios.de/,
 ftp://ftp.berlios.de/pub/bcm43xx/snapshots/
 
-Latest softmac source is in softmac-snapshot/ and net/
-is a symlink to softmac-snapshot/include/net/.
-softmac-snapshot/ is to be replaced regularly with newer
-snapshots from http://softmac.sipsolutions.net/SoftMAC.
-
 grep for '//SM' to see the code added to standalone acx driver code.
 
 Contact:
 [email protected]
 [email protected]
[email protected] 
[email protected]
 
 Bug reports:
 
@@ -45,4 +40,22 @@ radio module). For example, my firmware 
 Alternatively, I may remove it and use pair of files 'tiacx111' and
 'tiacx111r16' instead.
 USB driver:
-image is named 'tiacx100usb'
+image is named 'tiacxNNNusbcMM'
+
+Build instructions:
+
+You need to have git and cogito installed.
+
+# Get initial wireless-2.6.git tree (large download - >300MB)
+cg-clone rsync://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git wireless-2.6.git
+cd wireless-2.6.git
+# Get a branch
+cg-branch-add r-softmac 'rsync://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git#softmac'
+cg-fetch r-softmac
+# Switch to it (make it current)
+git-checkout r-softmac
+# Pull updates from remote master tree
+cg-update r-softmac
+
+You will have a complete Linux kernel in wireless-2.6.git/.
+Replace drivers/net/wireless/tiacx/* by files from this tarball.
drivers/net/wireless/tiacx/acx_config.h +1 -1
diff -urpN wireless-2.6.git/drivers/net/wireless/tiacx/acx_config.h wireless-2.6.git.acx/drivers/net/wireless/tiacx/acx_config.h
@@ -1,4 +1,4 @@
-#define ACX_RELEASE "v0.4.3"
+#define ACX_RELEASE "v0.4.7"
 
 /* set to 0 if you don't want any debugging code to be compiled in */
 /* set to 1 if you want some debugging */
drivers/net/wireless/tiacx/acx_func.h +36 -89

184 lines not on this page · raw message

drivers/net/wireless/tiacx/acx_struct.h +107 -15

187 lines not on this page · raw message

drivers/net/wireless/tiacx/common.c +450 -187

973 lines not on this page · raw message

drivers/net/wireless/tiacx/ioctl.c +41 -108

175 lines not on this page · raw message

drivers/net/wireless/tiacx/pci.c +121 -165

467 lines not on this page · raw message

drivers/net/wireless/tiacx/usb.c +51 -12

157 lines not on this page · raw message

#6 lore raw

Re: [PATCH] wireless.git: update acxsm to 0.4.7

Quoted 8 lines · Denis Vlasenko
Quoted 7 lines · John W. Linville
Quoted 2 lines · Carlos Martín
Quoted 1 line · Denis Vlasenko
Quoted 1 line

Comments are welcome and I'll split the patch if needed.

Denis are you applying this patch to your tree? If so, I'll rely on you to push it to me when you are ready.

Quoted 6 lines
Quoted 4 lines

If not, then I will need Carlos to generate the diffs so that they can be applied to the top of the tree with -p1.

http://linux.yyz.us/patch-format.html

Changelog:

Merged to softmac branch of wireless-2.6...thanks!

John

Signature · 9 lines
John W. Linville
[email protected]


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642