Netdev List
 help / color / mirror / Atom feed
* [2.6 patch] make UNIX a bool
From: Adrian Bunk @ 2006-03-25 19:47 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Andrew Morton, netdev, linux-kernel
In-Reply-To: <20060225224631.GA4085@suse.de>

On Sat, Feb 25, 2006 at 11:46:31PM +0100, Olaf Hering wrote:
>  On Sat, Feb 25, Adrian Bunk wrote:
> 
> > CONFIG_UNIX=m doesn't make much sense.
> 
> There is likely more code to support a modular unix.ko, this has to go
> as well.

Sounds resonable, updated patch below.

cu
Adrian


<--  snip  -->


CONFIG_UNIX=m doesn't make that much sense and requires us to export 
things we don't want to export to modules.

Signed-off-by: Adrian Bunk <bunk@stusta.de>

---

 fs/file_table.c            |    1 -
 include/net/af_unix.h      |    2 --
 net/unix/Kconfig           |    2 +-
 net/unix/af_unix.c         |   18 ------------------
 net/unix/sysctl_net_unix.c |    9 +--------
 5 files changed, 2 insertions(+), 30 deletions(-)

--- linux-2.6.16-mm1-full/net/unix/Kconfig.old	2006-03-25 20:10:47.000000000 +0100
+++ linux-2.6.16-mm1-full/net/unix/Kconfig	2006-03-25 20:10:54.000000000 +0100
@@ -3,7 +3,7 @@
 #
 
 config UNIX
-	tristate "Unix domain sockets"
+	bool "Unix domain sockets"
 	---help---
 	  If you say Y here, you will include support for Unix domain sockets;
 	  sockets are the standard Unix mechanism for establishing and
--- linux-2.6.16-mm1-full/include/net/af_unix.h.old	2006-03-25 20:13:33.000000000 +0100
+++ linux-2.6.16-mm1-full/include/net/af_unix.h	2006-03-25 20:13:40.000000000 +0100
@@ -85,10 +85,8 @@
 #ifdef CONFIG_SYSCTL
 extern int sysctl_unix_max_dgram_qlen;
 extern void unix_sysctl_register(void);
-extern void unix_sysctl_unregister(void);
 #else
 static inline void unix_sysctl_register(void) {}
-static inline void unix_sysctl_unregister(void) {}
 #endif
 #endif
 #endif
--- linux-2.6.16-mm1-full/net/unix/af_unix.c.old	2006-03-25 20:11:07.000000000 +0100
+++ linux-2.6.16-mm1-full/net/unix/af_unix.c	2006-03-25 20:14:05.000000000 +0100
@@ -475,7 +475,6 @@
 
 static const struct proto_ops unix_stream_ops = {
 	.family =	PF_UNIX,
-	.owner =	THIS_MODULE,
 	.release =	unix_release,
 	.bind =		unix_bind,
 	.connect =	unix_stream_connect,
@@ -496,7 +495,6 @@
 
 static const struct proto_ops unix_dgram_ops = {
 	.family =	PF_UNIX,
-	.owner =	THIS_MODULE,
 	.release =	unix_release,
 	.bind =		unix_bind,
 	.connect =	unix_dgram_connect,
@@ -517,7 +515,6 @@
 
 static const struct proto_ops unix_seqpacket_ops = {
 	.family =	PF_UNIX,
-	.owner =	THIS_MODULE,
 	.release =	unix_release,
 	.bind =		unix_bind,
 	.connect =	unix_stream_connect,
@@ -538,7 +535,6 @@
 
 static struct proto unix_proto = {
 	.name	  = "UNIX",
-	.owner	  = THIS_MODULE,
 	.obj_size = sizeof(struct unix_sock),
 };
 
@@ -2012,7 +2008,6 @@
 }
 
 static struct file_operations unix_seq_fops = {
-	.owner		= THIS_MODULE,
 	.open		= unix_seq_open,
 	.read		= seq_read,
 	.llseek		= seq_lseek,
@@ -2024,7 +2019,6 @@
 static struct net_proto_family unix_family_ops = {
 	.family = PF_UNIX,
 	.create = unix_create,
-	.owner	= THIS_MODULE,
 };
 
 static int __init af_unix_init(void)
@@ -2053,16 +2047,4 @@
 	return rc;
 }
 
-static void __exit af_unix_exit(void)
-{
-	sock_unregister(PF_UNIX);
-	unix_sysctl_unregister();
-	proc_net_remove("unix");
-	proto_unregister(&unix_proto);
-}
-
 module_init(af_unix_init);
-module_exit(af_unix_exit);
-
-MODULE_LICENSE("GPL");
-MODULE_ALIAS_NETPROTO(PF_UNIX);
--- linux-2.6.16-mm1-full/net/unix/sysctl_net_unix.c.old	2006-03-25 20:14:10.000000000 +0100
+++ linux-2.6.16-mm1-full/net/unix/sysctl_net_unix.c	2006-03-25 20:15:21.000000000 +0100
@@ -46,15 +46,8 @@
 	{ .ctl_name = 0 }
 };
 
-static struct ctl_table_header * unix_sysctl_header;
-
 void unix_sysctl_register(void)
 {
-	unix_sysctl_header = register_sysctl_table(unix_root_table, 0);
-}
-
-void unix_sysctl_unregister(void)
-{
-	unregister_sysctl_table(unix_sysctl_header);
+	register_sysctl_table(unix_root_table, 0);
 }
 
--- linux-2.6.16-mm1-full/fs/file_table.c.old	2006-03-25 20:39:30.000000000 +0100
+++ linux-2.6.16-mm1-full/fs/file_table.c	2006-03-25 20:39:44.000000000 +0100
@@ -62,7 +62,6 @@
 {
 	return files_stat.max_files;
 }
-EXPORT_SYMBOL_GPL(get_max_files);
 
 /*
  * Handle nr_files sysctl

^ permalink raw reply

* [PATCH] acxsm: Reduce the number of ACX_PACKED instructions
From: Carlos Martin @ 2006-03-25 20:01 UTC (permalink / raw)
  To: netdev; +Cc: Denis Vlasenko, acx100-devel, Carlos Martin

Up to now, we were using ACX_PACKED after every field. I've finally
found out how to use only one at the end of each struct whilst
maintaining the typedef where it is now.

This should also apply to acx with a bit of fuzz, but I consider it to
be in maintenance mode, so this doesn't qualify for it.

Signed-off-by: Carlos Martin <carlos@cmartin.tk>

---

 acx_struct.h |  874 +++++++++++++++++++++++++++++-----------------------------
 common.c     |   26 +-
 ioctl.c      |   10 -
 usb.c        |    8 -
 4 files changed, 457 insertions(+), 461 deletions(-)

5fb2fdfd8c028a40921bbf9ef7ec4c53c03fcab4
diff --git a/acx_struct.h b/acx_struct.h
index 227b6e3..8c92302 100644
--- a/acx_struct.h
+++ b/acx_struct.h
@@ -522,9 +522,9 @@ DEF_IE(111_IE_DOT11_INVAL_1013,			0x1013
  * --vda
  */
 typedef struct phy_hdr {
-	u8	unknown[4] ACX_PACKED;
-	u8	acx111_unknown[4] ACX_PACKED;
-} phy_hdr_t;
+	u8	unknown[4];
+	u8	acx111_unknown[4];
+} ACX_PACKED phy_hdr_t;
 
 /* seems to be a bit similar to hfa384x_rx_frame.
  * These fields are still not quite obvious, though.
@@ -584,22 +584,22 @@ time: 4 bytes:
 */
 
 typedef struct rxbuffer {
-	u16	mac_cnt_rcvd ACX_PACKED;	/* only 12 bits are len! (0xfff) */
-	u8	mac_cnt_mblks ACX_PACKED;
-	u8	mac_status ACX_PACKED;
-	u8	phy_stat_baseband ACX_PACKED;	/* bit 0x80: used LNA (Low-Noise Amplifier) */
-	u8	phy_plcp_signal ACX_PACKED;
-	u8	phy_level ACX_PACKED;		/* PHY stat */
-	u8	phy_snr ACX_PACKED;		/* PHY stat */
-	u32	time ACX_PACKED;		/* timestamp upon MAC rcv first byte */
+	u16	mac_cnt_rcvd;	/* only 12 bits are len! (0xfff) */
+	u8	mac_cnt_mblks;
+	u8	mac_status;
+	u8	phy_stat_baseband;	/* bit 0x80: used LNA (Low-Noise Amplifier) */
+	u8	phy_plcp_signal;
+	u8	phy_level;		/* PHY stat */
+	u8	phy_snr;		/* PHY stat */
+	u32	time;		/* timestamp upon MAC rcv first byte */
 /* 4-byte (acx100) or 8-byte (acx111) phy header will be here
 ** if RX_CFG1_INCLUDE_PHY_HDR is in effect:
 **	phy_hdr_t phy			*/
-	wlan_hdr_a3_t hdr_a3 ACX_PACKED;
+	wlan_hdr_a3_t hdr_a3;
 	/* maximally sized data part of wlan packet */
-	u8	data_a3[WLAN_A4FR_MAXLEN_WEP_FCS - WLAN_HDR_A3_LEN] ACX_PACKED;
+	u8	data_a3[WLAN_A4FR_MAXLEN_WEP_FCS - WLAN_HDR_A3_LEN];
 	/* can add hdr/data_a4 if needed */
-} rxbuffer_t;
+} ACX_PACKED rxbuffer_t;
 
 
 /*--- Firmware statistics ----------------------------------------------------*/
@@ -609,93 +609,93 @@ typedef struct rxbuffer {
 #define FW_STATS_FUTURE_EXTENSION	100
 
 typedef struct fw_stats_tx {
-	u32	tx_desc_of ACX_PACKED;
-} fw_stats_tx_t;
+	u32	tx_desc_of;
+} ACX_PACKED fw_stats_tx_t;
 
 typedef struct fw_stats_rx {
-	u32	rx_oom ACX_PACKED;
-	u32	rx_hdr_of ACX_PACKED;
-	u32	rx_hw_stuck ACX_PACKED; /* old: u32	rx_hdr_use_next */
-	u32	rx_dropped_frame ACX_PACKED;
-	u32	rx_frame_ptr_err ACX_PACKED;
-	u32	rx_xfr_hint_trig ACX_PACKED;
-	u32	rx_aci_events ACX_PACKED; /* later versions only */
-	u32	rx_aci_resets ACX_PACKED; /* later versions only */
-} fw_stats_rx_t;
+	u32	rx_oom;
+	u32	rx_hdr_of;
+	u32	rx_hw_stuck; /* old: u32	rx_hdr_use_next */
+	u32	rx_dropped_frame;
+	u32	rx_frame_ptr_err;
+	u32	rx_xfr_hint_trig;
+	u32	rx_aci_events; /* later versions only */
+	u32	rx_aci_resets; /* later versions only */
+} ACX_PACKED fw_stats_rx_t;
 
 typedef struct fw_stats_dma {
-	u32	rx_dma_req ACX_PACKED;
-	u32	rx_dma_err ACX_PACKED;
-	u32	tx_dma_req ACX_PACKED;
-	u32	tx_dma_err ACX_PACKED;
-} fw_stats_dma_t;
+	u32	rx_dma_req;
+	u32	rx_dma_err;
+	u32	tx_dma_req;
+	u32	tx_dma_err;
+} ACX_PACKED fw_stats_dma_t;
 
 typedef struct fw_stats_irq {
-	u32	cmd_cplt ACX_PACKED;
-	u32	fiq ACX_PACKED;
-	u32	rx_hdrs ACX_PACKED;
-	u32	rx_cmplt ACX_PACKED;
-	u32	rx_mem_of ACX_PACKED;
-	u32	rx_rdys ACX_PACKED;
-	u32	irqs ACX_PACKED;
-	u32	tx_procs ACX_PACKED;
-	u32	decrypt_done ACX_PACKED;
-	u32	dma_0_done ACX_PACKED;
-	u32	dma_1_done ACX_PACKED;
-	u32	tx_exch_complet ACX_PACKED;
-	u32	commands ACX_PACKED;
-	u32	rx_procs ACX_PACKED;
-	u32	hw_pm_mode_changes ACX_PACKED;
-	u32	host_acks ACX_PACKED;
-	u32	pci_pm ACX_PACKED;
-	u32	acm_wakeups ACX_PACKED;
-} fw_stats_irq_t;
+	u32	cmd_cplt;
+	u32	fiq;
+	u32	rx_hdrs;
+	u32	rx_cmplt;
+	u32	rx_mem_of;
+	u32	rx_rdys;
+	u32	irqs;
+	u32	tx_procs;
+	u32	decrypt_done;
+	u32	dma_0_done;
+	u32	dma_1_done;
+	u32	tx_exch_complet;
+	u32	commands;
+	u32	rx_procs;
+	u32	hw_pm_mode_changes;
+	u32	host_acks;
+	u32	pci_pm;
+	u32	acm_wakeups;
+} ACX_PACKED fw_stats_irq_t;
 
 typedef struct fw_stats_wep {
-	u32	wep_key_count ACX_PACKED;
-	u32	wep_default_key_count ACX_PACKED;
-	u32	dot11_def_key_mib ACX_PACKED;
-	u32	wep_key_not_found ACX_PACKED;
-	u32	wep_decrypt_fail ACX_PACKED;
-	u32	wep_pkt_decrypt ACX_PACKED;
-	u32	wep_decrypt_irqs ACX_PACKED;
-} fw_stats_wep_t;
+	u32	wep_key_count;
+	u32	wep_default_key_count;
+	u32	dot11_def_key_mib;
+	u32	wep_key_not_found;
+	u32	wep_decrypt_fail;
+	u32	wep_pkt_decrypt;
+	u32	wep_decrypt_irqs;
+} ACX_PACKED fw_stats_wep_t;
 
 typedef struct fw_stats_pwr {
-	u32	tx_start_ctr ACX_PACKED;
-	u32	no_ps_tx_too_short ACX_PACKED;
-	u32	rx_start_ctr ACX_PACKED;
-	u32	no_ps_rx_too_short ACX_PACKED;
-	u32	lppd_started ACX_PACKED;
-	u32	no_lppd_too_noisy ACX_PACKED;
-	u32	no_lppd_too_short ACX_PACKED;
-	u32	no_lppd_matching_frame ACX_PACKED;
-} fw_stats_pwr_t;
+	u32	tx_start_ctr;
+	u32	no_ps_tx_too_short;
+	u32	rx_start_ctr;
+	u32	no_ps_rx_too_short;
+	u32	lppd_started;
+	u32	no_lppd_too_noisy;
+	u32	no_lppd_too_short;
+	u32	no_lppd_matching_frame;
+} ACX_PACKED fw_stats_pwr_t;
 
 typedef struct fw_stats_mic {
-	u32 mic_rx_pkts ACX_PACKED;
-	u32 mic_calc_fail ACX_PACKED;
-} fw_stats_mic_t;
+	u32 mic_rx_pkts;
+	u32 mic_calc_fail;
+} ACX_PACKED fw_stats_mic_t;
 
 typedef struct fw_stats_aes {
-	u32 aes_enc_fail ACX_PACKED;
-	u32 aes_dec_fail ACX_PACKED;
-	u32 aes_enc_pkts ACX_PACKED;
-	u32 aes_dec_pkts ACX_PACKED;
-	u32 aes_enc_irq ACX_PACKED;
-	u32 aes_dec_irq ACX_PACKED;
-} fw_stats_aes_t;
+	u32 aes_enc_fail;
+	u32 aes_dec_fail;
+	u32 aes_enc_pkts;
+	u32 aes_dec_pkts;
+	u32 aes_enc_irq;
+	u32 aes_dec_irq;
+} ACX_PACKED fw_stats_aes_t;
 
 typedef struct fw_stats_event {
-	u32 heartbeat ACX_PACKED;
-	u32 calibration ACX_PACKED;
-	u32 rx_mismatch ACX_PACKED;
-	u32 rx_mem_empty ACX_PACKED;
-	u32 rx_pool ACX_PACKED;
-	u32 oom_late ACX_PACKED;
-	u32 phy_tx_err ACX_PACKED;
-	u32 tx_stuck ACX_PACKED;
-} fw_stats_event_t;
+	u32 heartbeat;
+	u32 calibration;
+	u32 rx_mismatch;
+	u32 rx_mem_empty;
+	u32 rx_pool;
+	u32 oom_late;
+	u32 phy_tx_err;
+	u32 tx_stuck;
+} ACX_PACKED fw_stats_event_t;
 
 /* mainly for size calculation only */
 typedef struct fw_stats {
@@ -716,11 +716,11 @@ typedef struct fw_stats {
 /* Firmware version struct */
 
 typedef struct fw_ver {
-	u16	cmd ACX_PACKED;
-	u16	size ACX_PACKED;
-	char	fw_id[20] ACX_PACKED;
-	u32	hw_id ACX_PACKED;
-} fw_ver_t;
+	u16	cmd;
+	u16	size;
+	char	fw_id[20];
+	u32	hw_id;
+} ACX_PACKED fw_ver_t;
 
 #define FW_ID_SIZE 20
 
@@ -789,8 +789,8 @@ struct client {
  * Attempts to use acx_ptr without macros result in compile-time errors */
 
 typedef struct {
-	u32	v ACX_PACKED;
-} acx_ptr;
+	u32	v;
+} ACX_PACKED acx_ptr;
 
 #if ACX_DEBUG
 #define CHECK32(n) BUG_ON(sizeof(n)>4 && (long)(n)>0xffffff00)
@@ -892,59 +892,59 @@ typedef struct {
 /* Outside of "#ifdef PCI" because USB needs to know sizeof()
 ** of txdesc and rxdesc: */
 struct txdesc {
-	acx_ptr	pNextDesc ACX_PACKED;	/* pointer to next txdesc */
-	acx_ptr	HostMemPtr ACX_PACKED;			/* 0x04 */
-	acx_ptr	AcxMemPtr ACX_PACKED;			/* 0x08 */
-	u32	tx_time ACX_PACKED;			/* 0x0c */
-	u16	total_length ACX_PACKED;		/* 0x10 */
-	u16	Reserved ACX_PACKED;			/* 0x12 */
+	acx_ptr	pNextDesc;	/* pointer to next txdesc */
+	acx_ptr	HostMemPtr;			/* 0x04 */
+	acx_ptr	AcxMemPtr;			/* 0x08 */
+	u32	tx_time;			/* 0x0c */
+	u16	total_length;		/* 0x10 */
+	u16	Reserved;			/* 0x12 */
 
 /* The following 16 bytes do not change when acx100 owns the descriptor */
 /* BUG: fw clears last byte of this area which is supposedly reserved
 ** for driver use. amd64 blew up. We dare not use it now */
-	u32	dummy[4] ACX_PACKED;
+	u32	dummy[4];
 
-	u8	Ctl_8 ACX_PACKED;			/* 0x24, 8bit value */
-	u8	Ctl2_8 ACX_PACKED;			/* 0x25, 8bit value */
-	u8	error ACX_PACKED;			/* 0x26 */
-	u8	ack_failures ACX_PACKED;		/* 0x27 */
-	u8	rts_failures ACX_PACKED;		/* 0x28 */
-	u8	rts_ok ACX_PACKED;			/* 0x29 */
+	u8	Ctl_8;			/* 0x24, 8bit value */
+	u8	Ctl2_8;			/* 0x25, 8bit value */
+	u8	error;			/* 0x26 */
+	u8	ack_failures;		/* 0x27 */
+	u8	rts_failures;		/* 0x28 */
+	u8	rts_ok;			/* 0x29 */
 	union {
 		struct {
-			u8	rate ACX_PACKED;	/* 0x2a */
-			u8	queue_ctrl ACX_PACKED;	/* 0x2b */
-		} r1 ACX_PACKED;
+			u8	rate;	/* 0x2a */
+			u8	queue_ctrl;	/* 0x2b */
+		} ACX_PACKED r1;
 		struct {
-			u16	rate111 ACX_PACKED;	/* 0x2a */
-		} r2 ACX_PACKED;
-	} u ACX_PACKED;
-	u32	queue_info ACX_PACKED;			/* 0x2c (acx100, reserved on acx111) */
-};		/* size : 48 = 0x30 */
+			u16	rate111;	/* 0x2a */
+		} ACX_PACKED r2;
+	} u;
+	u32	queue_info;			/* 0x2c (acx100, reserved on acx111) */
+} ACX_PACKED;		/* size : 48 = 0x30 */
 /* NB: acx111 txdesc structure is 4 byte larger */
 /* All these 4 extra bytes are reserved. tx alloc code takes them into account */
 
 struct rxdesc {
-	acx_ptr	pNextDesc ACX_PACKED;			/* 0x00 */
-	acx_ptr	HostMemPtr ACX_PACKED;			/* 0x04 */
-	acx_ptr	ACXMemPtr ACX_PACKED;			/* 0x08 */
-	u32	rx_time ACX_PACKED;			/* 0x0c */
-	u16	total_length ACX_PACKED;		/* 0x10 */
-	u16	WEP_length ACX_PACKED;			/* 0x12 */
-	u32	WEP_ofs ACX_PACKED;			/* 0x14 */
+	acx_ptr	pNextDesc;			/* 0x00 */
+	acx_ptr	HostMemPtr;			/* 0x04 */
+	acx_ptr	ACXMemPtr;			/* 0x08 */
+	u32	rx_time;			/* 0x0c */
+	u16	total_length;		/* 0x10 */
+	u16	WEP_length;			/* 0x12 */
+	u32	WEP_ofs;			/* 0x14 */
 
 /* the following 16 bytes do not change when acx100 owns the descriptor */
-	u8	driverWorkspace[16] ACX_PACKED;		/* 0x18 */
+	u8	driverWorkspace[16];		/* 0x18 */
 
-	u8	Ctl_8 ACX_PACKED;
-	u8	rate ACX_PACKED;
-	u8	error ACX_PACKED;
-	u8	SNR ACX_PACKED;				/* Signal-to-Noise Ratio */
-	u8	RxLevel ACX_PACKED;
-	u8	queue_ctrl ACX_PACKED;
-	u16	unknown ACX_PACKED;
-	u32	unknown2 ACX_PACKED;
-};		/* size 52 = 0x34 */
+	u8	Ctl_8;
+	u8	rate;
+	u8	error;
+	u8	SNR;				/* Signal-to-Noise Ratio */
+	u8	RxLevel;
+	u8	queue_ctrl;
+	u16	unknown;
+	u32	unknown2;
+} ACX_PACKED;		/* size 52 = 0x34 */
 
 #ifdef ACX_PCI
 
@@ -1013,30 +1013,30 @@ enum {
 #define INT_TRIG_CMD		0x01
 
 struct txhostdesc {
-	acx_ptr	data_phy ACX_PACKED;			/* 0x00 [u8 *] */
-	u16	data_offset ACX_PACKED;			/* 0x04 */
-	u16	reserved ACX_PACKED;			/* 0x06 */
-	u16	Ctl_16 ACX_PACKED;	/* 16bit value, endianness!! */
-	u16	length ACX_PACKED;			/* 0x0a */
-	acx_ptr	desc_phy_next ACX_PACKED;		/* 0x0c [txhostdesc *] */
-	acx_ptr	pNext ACX_PACKED;			/* 0x10 [txhostdesc *] */
-	u32	Status ACX_PACKED;			/* 0x14, unused on Tx */
+	acx_ptr	data_phy;			/* 0x00 [u8 *] */
+	u16	data_offset;			/* 0x04 */
+	u16	reserved;			/* 0x06 */
+	u16	Ctl_16;	/* 16bit value, endianness!! */
+	u16	length;			/* 0x0a */
+	acx_ptr	desc_phy_next;		/* 0x0c [txhostdesc *] */
+	acx_ptr	pNext;			/* 0x10 [txhostdesc *] */
+	u32	Status;			/* 0x14, unused on Tx */
 /* From here on you can use this area as you want (variable length, too!) */
-	u8	*data ACX_PACKED;
-};
+	u8	*data;
+} ACX_PACKED;
 
 struct rxhostdesc {
-	acx_ptr	data_phy ACX_PACKED;			/* 0x00 [rxbuffer_t *] */
-	u16	data_offset ACX_PACKED;			/* 0x04 */
-	u16	reserved ACX_PACKED;			/* 0x06 */
-	u16	Ctl_16 ACX_PACKED;			/* 0x08; 16bit value, endianness!! */
-	u16	length ACX_PACKED;			/* 0x0a */
-	acx_ptr	desc_phy_next ACX_PACKED;		/* 0x0c [rxhostdesc_t *] */
-	acx_ptr	pNext ACX_PACKED;			/* 0x10 [rxhostdesc_t *] */
-	u32	Status ACX_PACKED;			/* 0x14 */
+	acx_ptr	data_phy;			/* 0x00 [rxbuffer_t *] */
+	u16	data_offset;			/* 0x04 */
+	u16	reserved;			/* 0x06 */
+	u16	Ctl_16;			/* 0x08; 16bit value, endianness!! */
+	u16	length;			/* 0x0a */
+	acx_ptr	desc_phy_next;		/* 0x0c [rxhostdesc_t *] */
+	acx_ptr	pNext;			/* 0x10 [rxhostdesc_t *] */
+	u32	Status;			/* 0x14 */
 /* From here on you can use this area as you want (variable length, too!) */
-	rxbuffer_t *data ACX_PACKED;
-};
+	rxbuffer_t *data;
+} ACX_PACKED;
 
 #endif /* ACX_PCI */
 
@@ -1050,30 +1050,30 @@ struct rxhostdesc {
 /* Size of header (everything up to data[]) */
 #define USB_TXBUF_HDRSIZE	14
 typedef struct usb_txbuffer {
-	u16	desc ACX_PACKED;
-	u16	mpdu_len ACX_PACKED;
-	u8	queue_index ACX_PACKED;
-	u8	rate ACX_PACKED;
-	u32	hostdata ACX_PACKED;
-	u8	ctrl1 ACX_PACKED;
-	u8	ctrl2 ACX_PACKED;
-	u16	data_len ACX_PACKED;
+	u16	desc;
+	u16	mpdu_len;
+	u8	queue_index;
+	u8	rate;
+	u32	hostdata;
+	u8	ctrl1;
+	u8	ctrl2;
+	u16	data_len;
 	/* wlan packet content is placed here: */
-	u8	data[WLAN_A4FR_MAXLEN_WEP_FCS] ACX_PACKED;
-} usb_txbuffer_t;
+	u8	data[WLAN_A4FR_MAXLEN_WEP_FCS];
+} ACX_PACKED usb_txbuffer_t;
 
 /* USB returns either rx packets (see rxbuffer) or
 ** these "tx status" structs: */
 typedef struct usb_txstatus {
-	u16	mac_cnt_rcvd ACX_PACKED;	/* only 12 bits are len! (0xfff) */
-	u8	queue_index ACX_PACKED;
-	u8	mac_status ACX_PACKED;		/* seen 0x20 on tx failure */
-	u32	hostdata ACX_PACKED;
-	u8	rate ACX_PACKED;
-	u8	ack_failures ACX_PACKED;
-	u8	rts_failures ACX_PACKED;
-	u8	rts_ok ACX_PACKED;
-} usb_txstatus_t;
+	u16	mac_cnt_rcvd;	/* only 12 bits are len! (0xfff) */
+	u8	queue_index;
+	u8	mac_status;		/* seen 0x20 on tx failure */
+	u32	hostdata;
+	u8	rate;
+	u8	ack_failures;
+	u8	rts_failures;
+	u8	rts_ok;
+} ACX_PACKED usb_txstatus_t;
 
 typedef struct usb_tx {
 	unsigned	busy:1;
@@ -1104,72 +1104,71 @@ typedef struct usb_rx {
 /* Config Option structs */
 
 typedef struct co_antennas {
-	u8	type ACX_PACKED;
-	u8	len ACX_PACKED;
-	u8	list[2] ACX_PACKED;
-} co_antennas_t;
+	u8	type;
+	u8	len;
+	u8	list[2];
+} ACX_PACKED co_antennas_t;
 
 typedef struct co_powerlevels {
-	u8	type ACX_PACKED;
-	u8	len ACX_PACKED;
-	u16	list[8] ACX_PACKED;
-} co_powerlevels_t;
+	u8	type;
+	u8	len;
+	u16	list[8];
+} ACX_PACKED co_powerlevels_t;
 
 typedef struct co_datarates {
-	u8	type ACX_PACKED;
-	u8	len ACX_PACKED;
-	u8	list[8] ACX_PACKED;
-} co_datarates_t;
+	u8	type;
+	u8	len;
+	u8	list[8];
+} ACX_PACKED co_datarates_t;
 
 typedef struct co_domains {
-	u8	type ACX_PACKED;
-	u8	len ACX_PACKED;
-	u8	list[6] ACX_PACKED;
-} co_domains_t;
+	u8	type;
+	u8	len;
+	u8	list[6];
+} ACX_PACKED co_domains_t;
 
 typedef struct co_product_id {
-	u8	type ACX_PACKED;
-	u8	len ACX_PACKED;
-	u8	list[128] ACX_PACKED;
-} co_product_id_t;
+	u8	type;
+	u8	len;
+	u8	list[128];
+} ACX_PACKED co_product_id_t;
 
 typedef struct co_manuf_id {
-	u8	type ACX_PACKED;
-	u8	len ACX_PACKED;
-	u8	list[128] ACX_PACKED;
-} co_manuf_t;
+	u8	type;
+	u8	len;
+	u8	list[128];
+} ACX_PACKED co_manuf_t;
 
 typedef struct co_fixed {
-	char	NVSv[8] ACX_PACKED;
+	char	NVSv[8];
 /*	u16	NVS_vendor_offs;	ACX111-only */
 /*	u16	unknown;		ACX111-only */
-	u8	MAC[6] ACX_PACKED;	/* ACX100-only */
-	u16	probe_delay ACX_PACKED;	/* ACX100-only */
-	u32	eof_memory ACX_PACKED;
-	u8	dot11CCAModes ACX_PACKED;
-	u8	dot11Diversity ACX_PACKED;
-	u8	dot11ShortPreambleOption ACX_PACKED;
-	u8	dot11PBCCOption ACX_PACKED;
-	u8	dot11ChannelAgility ACX_PACKED;
-	u8	dot11PhyType ACX_PACKED; /* FIXME: does 802.11 call it "dot11PHYType"? */
-	u8	dot11TempType ACX_PACKED;
-	u8	table_count ACX_PACKED;
-} co_fixed_t;
+	u8	MAC[6];	/* ACX100-only */
+	u16	probe_delay;	/* ACX100-only */
+	u32	eof_memory;
+	u8	dot11CCAModes;
+	u8	dot11Diversity;
+	u8	dot11ShortPreambleOption;
+	u8	dot11PBCCOption;
+	u8	dot11ChannelAgility;
+	u8	dot11PhyType; /* FIXME: does 802.11 call it "dot11PHYType"? */
+	u8	dot11TempType;
+	u8	table_count;
+} ACX_PACKED co_fixed_t;
 
 typedef struct acx111_ie_configoption {
-	u16			type ACX_PACKED;
-	u16			len ACX_PACKED;
+	u16			type;
+	u16			len;
 /* Do not access below members directly, they are in fact variable length */
-	co_fixed_t		fixed ACX_PACKED;
-	co_antennas_t		antennas ACX_PACKED;
-	co_powerlevels_t	power_levels ACX_PACKED;
-	co_datarates_t		data_rates ACX_PACKED;
-	co_domains_t		domains ACX_PACKED;
-	co_product_id_t		product_id ACX_PACKED;
-	co_manuf_t		manufacturer ACX_PACKED;
+	co_fixed_t		fixed;
+	co_antennas_t		antennas;
+	co_powerlevels_t	power_levels;
+	co_datarates_t		data_rates;
+	co_domains_t		domains;
+	co_product_id_t		product_id;
+	co_manuf_t		manufacturer;
 	u8			_padding[4];
-} acx111_ie_configoption_t;
-
+} ACX_PACKED acx111_ie_configoption_t;
 
 /***********************************************************************
 ** Main acx per-device data structure
@@ -1601,108 +1600,108 @@ ndev2adev(struct net_device *ndev)
 /***********************************************************************
 */
 typedef struct acx100_ie_memblocksize {
-	u16	type ACX_PACKED;
-	u16	len ACX_PACKED;
-	u16	size ACX_PACKED;
-} acx100_ie_memblocksize_t;
+	u16	type;
+	u16	len;
+	u16	size;
+} ACX_PACKED acx100_ie_memblocksize_t;
 
 typedef struct acx100_ie_queueconfig {
-	u16	type ACX_PACKED;
-	u16	len ACX_PACKED;
-	u32	AreaSize ACX_PACKED;
-	u32	RxQueueStart ACX_PACKED;
-	u8	QueueOptions ACX_PACKED;
-	u8	NumTxQueues ACX_PACKED;
-	u8	NumRxDesc ACX_PACKED;	 /* for USB only */
-	u8	pad1 ACX_PACKED;
-	u32	QueueEnd ACX_PACKED;
-	u32	HostQueueEnd ACX_PACKED; /* QueueEnd2 */
-	u32	TxQueueStart ACX_PACKED;
-	u8	TxQueuePri ACX_PACKED;
-	u8	NumTxDesc ACX_PACKED;
-	u16	pad2 ACX_PACKED;
-} acx100_ie_queueconfig_t;
+	u16	type;
+	u16	len;
+	u32	AreaSize;
+	u32	RxQueueStart;
+	u8	QueueOptions;
+	u8	NumTxQueues;
+	u8	NumRxDesc;	 /* for USB only */
+	u8	pad1;
+	u32	QueueEnd;
+	u32	HostQueueEnd; /* QueueEnd2 */
+	u32	TxQueueStart;
+	u8	TxQueuePri;
+	u8	NumTxDesc;
+	u16	pad2;
+} ACX_PACKED acx100_ie_queueconfig_t;
 
 typedef struct acx111_ie_queueconfig {
-	u16	type ACX_PACKED;
-	u16	len ACX_PACKED;
-	u32	tx_memory_block_address ACX_PACKED;
-	u32	rx_memory_block_address ACX_PACKED;
-	u32	rx1_queue_address ACX_PACKED;
-	u32	reserved1 ACX_PACKED;
-	u32	tx1_queue_address ACX_PACKED;
-	u8	tx1_attributes ACX_PACKED;
-	u16	reserved2 ACX_PACKED;
-	u8	reserved3 ACX_PACKED;
-} acx111_ie_queueconfig_t;
+	u16	type;
+	u16	len;
+	u32	tx_memory_block_address;
+	u32	rx_memory_block_address;
+	u32	rx1_queue_address;
+	u32	reserved1;
+	u32	tx1_queue_address;
+	u8	tx1_attributes;
+	u16	reserved2;
+	u8	reserved3;
+} ACX_PACKED acx111_ie_queueconfig_t;
 
 typedef struct acx100_ie_memconfigoption {
-	u16	type ACX_PACKED;
-	u16	len ACX_PACKED;
-	u32	DMA_config ACX_PACKED;
-	acx_ptr	pRxHostDesc ACX_PACKED;
-	u32	rx_mem ACX_PACKED;
-	u32	tx_mem ACX_PACKED;
-	u16	RxBlockNum ACX_PACKED;
-	u16	TxBlockNum ACX_PACKED;
-} acx100_ie_memconfigoption_t;
+	u16	type;
+	u16	len;
+	u32	DMA_config;
+	acx_ptr	pRxHostDesc;
+	u32	rx_mem;
+	u32	tx_mem;
+	u16	RxBlockNum;
+	u16	TxBlockNum;
+} ACX_PACKED acx100_ie_memconfigoption_t;
 
 typedef struct acx111_ie_memoryconfig {
-	u16	type ACX_PACKED;
-	u16	len ACX_PACKED;
-	u16	no_of_stations ACX_PACKED;
-	u16	memory_block_size ACX_PACKED;
-	u8	tx_rx_memory_block_allocation ACX_PACKED;
-	u8	count_rx_queues ACX_PACKED;
-	u8	count_tx_queues ACX_PACKED;
-	u8	options ACX_PACKED;
-	u8	fragmentation ACX_PACKED;
-	u16	reserved1 ACX_PACKED;
-	u8	reserved2 ACX_PACKED;
+	u16	type;
+	u16	len;
+	u16	no_of_stations;
+	u16	memory_block_size;
+	u8	tx_rx_memory_block_allocation;
+	u8	count_rx_queues;
+	u8	count_tx_queues;
+	u8	options;
+	u8	fragmentation;
+	u16	reserved1;
+	u8	reserved2;
 
 	/* start of rx1 block */
-	u8	rx_queue1_count_descs ACX_PACKED;
-	u8	rx_queue1_reserved1 ACX_PACKED;
-	u8	rx_queue1_type ACX_PACKED; /* must be set to 7 */
-	u8	rx_queue1_prio ACX_PACKED; /* must be set to 0 */
-	acx_ptr	rx_queue1_host_rx_start ACX_PACKED;
+	u8	rx_queue1_count_descs;
+	u8	rx_queue1_reserved1;
+	u8	rx_queue1_type; /* must be set to 7 */
+	u8	rx_queue1_prio; /* must be set to 0 */
+	acx_ptr	rx_queue1_host_rx_start;
 	/* end of rx1 block */
 
 	/* start of tx1 block */
-	u8	tx_queue1_count_descs ACX_PACKED;
-	u8	tx_queue1_reserved1 ACX_PACKED;
-	u8	tx_queue1_reserved2 ACX_PACKED;
-	u8	tx_queue1_attributes ACX_PACKED;
+	u8	tx_queue1_count_descs;
+	u8	tx_queue1_reserved1;
+	u8	tx_queue1_reserved2;
+	u8	tx_queue1_attributes;
 	/* end of tx1 block */
-} acx111_ie_memoryconfig_t;
+} ACX_PACKED acx111_ie_memoryconfig_t;
 
 typedef struct acx_ie_memmap {
-	u16	type ACX_PACKED;
-	u16	len ACX_PACKED;
-	u32	CodeStart ACX_PACKED;
-	u32	CodeEnd ACX_PACKED;
-	u32	WEPCacheStart ACX_PACKED;
-	u32	WEPCacheEnd ACX_PACKED;
-	u32	PacketTemplateStart ACX_PACKED;
-	u32	PacketTemplateEnd ACX_PACKED;
-	u32	QueueStart ACX_PACKED;
-	u32	QueueEnd ACX_PACKED;
-	u32	PoolStart ACX_PACKED;
-	u32	PoolEnd ACX_PACKED;
-} acx_ie_memmap_t;
+	u16	type;
+	u16	len;
+	u32	CodeStart;
+	u32	CodeEnd;
+	u32	WEPCacheStart;
+	u32	WEPCacheEnd;
+	u32	PacketTemplateStart;
+	u32	PacketTemplateEnd;
+	u32	QueueStart;
+	u32	QueueEnd;
+	u32	PoolStart;
+	u32	PoolEnd;
+} ACX_PACKED acx_ie_memmap_t;
 
 typedef struct acx111_ie_feature_config {
-	u16	type ACX_PACKED;
-	u16	len ACX_PACKED;
-	u32	feature_options ACX_PACKED;
-	u32	data_flow_options ACX_PACKED;
-} acx111_ie_feature_config_t;
+	u16	type;
+	u16	len;
+	u32	feature_options;
+	u32	data_flow_options;
+} ACX_PACKED acx111_ie_feature_config_t;
 
 typedef struct acx111_ie_tx_level {
-	u16	type ACX_PACKED;
-	u16	len ACX_PACKED;
-	u8	level ACX_PACKED;
-} acx111_ie_tx_level_t;
+	u16	type;
+	u16	len;
+	u8	level;
+} ACX_PACKED acx111_ie_tx_level_t;
 
 #define PS_CFG_ENABLE		0x80
 #define PS_CFG_PENDING		0x40 /* status flag when entering PS */
@@ -1719,25 +1718,25 @@ typedef struct acx111_ie_tx_level {
 #define PS_OPT_STILL_RCV_BCASTS	0x01
 
 typedef struct acx100_ie_powersave {
-	u16	type ACX_PACKED;
-	u16	len ACX_PACKED;
-	u8	wakeup_cfg ACX_PACKED;
-	u8	listen_interval ACX_PACKED; /* for EACH_ITVL: wake up every "beacon units" interval */
-	u8	options ACX_PACKED;
-	u8	hangover_period ACX_PACKED; /* remaining wake time after Tx MPDU w/ PS bit, in values of 1/1024 seconds */
-	u16	enhanced_ps_transition_time ACX_PACKED; /* rem. wake time for Enh. PS */
-} acx100_ie_powersave_t;
+	u16	type;
+	u16	len;
+	u8	wakeup_cfg;
+	u8	listen_interval; /* for EACH_ITVL: wake up every "beacon units" interval */
+	u8	options;
+	u8	hangover_period; /* remaining wake time after Tx MPDU w/ PS bit, in values of 1/1024 seconds */
+	u16	enhanced_ps_transition_time; /* rem. wake time for Enh. PS */
+} ACX_PACKED acx100_ie_powersave_t;
 
 typedef struct acx111_ie_powersave {
-	u16	type ACX_PACKED;
-	u16	len ACX_PACKED;
-	u8	wakeup_cfg ACX_PACKED;
-	u8	listen_interval ACX_PACKED; /* for EACH_ITVL: wake up every "beacon units" interval */
-	u8	options ACX_PACKED;
-	u8	hangover_period ACX_PACKED; /* remaining wake time after Tx MPDU w/ PS bit, in values of 1/1024 seconds */
-	u32	beacon_rx_time ACX_PACKED;
-	u32	enhanced_ps_transition_time ACX_PACKED; /* rem. wake time for Enh. PS */
-} acx111_ie_powersave_t;
+	u16	type;
+	u16	len;
+	u8	wakeup_cfg;
+	u8	listen_interval; /* for EACH_ITVL: wake up every "beacon units" interval */
+	u8	options;
+	u8	hangover_period; /* remaining wake time after Tx MPDU w/ PS bit, in values of 1/1024 seconds */
+	u32	beacon_rx_time;
+	u32	enhanced_ps_transition_time; /* rem. wake time for Enh. PS */
+} ACX_PACKED acx111_ie_powersave_t;
 
 
 /***********************************************************************
@@ -1764,14 +1763,14 @@ typedef struct acx111_ie_powersave {
 ** Background scan can be active or passive, just like normal one */
 #define ACX_SCAN_OPT_BACKGROUND	0x02
 typedef struct acx100_scan {
-	u16	count ACX_PACKED;	/* number of scans to do, 0xffff == continuous */
-	u16	start_chan ACX_PACKED;
-	u16	flags ACX_PACKED;	/* channel list mask; 0x8000 == all channels? */
-	u8	max_rate ACX_PACKED;	/* max. probe rate */
-	u8	options ACX_PACKED;	/* bit mask, see defines above */
-	u16	chan_duration ACX_PACKED;
-	u16	max_probe_delay ACX_PACKED;
-} acx100_scan_t;			/* length 0xc */
+	u16	count;	/* number of scans to do, 0xffff == continuous */
+	u16	start_chan;
+	u16	flags;	/* channel list mask; 0x8000 == all channels? */
+	u8	max_rate;	/* max. probe rate */
+	u8	options;	/* bit mask, see defines above */
+	u16	chan_duration;
+	u16	max_probe_delay;
+} ACX_PACKED acx100_scan_t; 			/* length 0xc */
 
 #define ACX111_SCAN_RATE_6	0x0B
 #define ACX111_SCAN_RATE_9	0x0F
@@ -1786,22 +1785,21 @@ typedef struct acx100_scan {
 #define ACX111_SCAN_MOD_PBCC	0x80
 #define ACX111_SCAN_MOD_OFDM	0x40
 typedef struct acx111_scan {
-	u16	count ACX_PACKED;		/* number of scans to do */
-	u8	channel_list_select ACX_PACKED; /* 0: scan all channels, 1: from chan_list only */
-	u16	reserved1 ACX_PACKED;
-	u8	reserved2 ACX_PACKED;
-	u8	rate ACX_PACKED;		/* rate for probe requests (if active scan) */
-	u8	options ACX_PACKED;		/* bit mask, see defines above */
-	u16	chan_duration ACX_PACKED;	/* min time to wait for reply on one channel (in TU) */
+	u16	count;		/* number of scans to do */
+	u8	channel_list_select; /* 0: scan all channels, 1: from chan_list only */
+	u16	reserved1;
+	u8	reserved2;
+	u8	rate;		/* rate for probe requests (if active scan) */
+	u8	options;		/* bit mask, see defines above */
+	u16	chan_duration;	/* min time to wait for reply on one channel (in TU) */
 						/* (active scan only) (802.11 section 11.1.3.2.2) */
-	u16	max_probe_delay ACX_PACKED;	/* max time to wait for reply on one channel (active scan) */
+	u16	max_probe_delay;	/* max time to wait for reply on one channel (active scan) */
 						/* time to listen on a channel (passive scan) */
-	u8	modulation ACX_PACKED;
-	u8	channel_list[26] ACX_PACKED;	/* bits 7:0 first byte: channels 8:1 */
+	u8	modulation;
+	u8	channel_list[26];	/* bits 7:0 first byte: channels 8:1 */
 						/* bits 7:0 second byte: channels 16:9 */
 						/* 26 bytes is enough to cover 802.11a */
-} acx111_scan_t;
-
+} ACX_PACKED acx111_scan_t;
 
 /*
 ** Radio calibration command structure
@@ -1810,10 +1808,9 @@ typedef struct acx111_cmd_radiocalib {
 /* 0x80000000 == automatic calibration by firmware, according to interval;
  * bits 0..3: select calibration methods to go through:
  * calib based on DC, AfeDC, Tx mismatch, Tx equilization */
-	u32	methods ACX_PACKED;
-	u32	interval ACX_PACKED;
-} acx111_cmd_radiocalib_t;
-
+	u32	methods;
+	u32	interval;
+} ACX_PACKED acx111_cmd_radiocalib_t;
 
 /*
 ** Packet template structures
@@ -1836,53 +1833,52 @@ typedef struct acx111_cmd_radiocalib {
 **   rest must be zero filled.
 ** - variable length fields shown only in comments */
 typedef struct acx_template_tim {
-	u16	size ACX_PACKED;
-	u8	tim_eid ACX_PACKED;	/* 00 1 TIM IE ID * */
-	u8	len ACX_PACKED;		/* 01 1 Length * */
-	u8	dtim_cnt ACX_PACKED;	/* 02 1 DTIM Count */
-	u8	dtim_period ACX_PACKED;	/* 03 1 DTIM Period */
-	u8	bitmap_ctrl ACX_PACKED;	/* 04 1 Bitmap Control * (except bit0) */
+	u16	size;
+	u8	tim_eid;	/* 00 1 TIM IE ID * */
+	u8	len;		/* 01 1 Length * */
+	u8	dtim_cnt;	/* 02 1 DTIM Count */
+	u8	dtim_period;	/* 03 1 DTIM Period */
+	u8	bitmap_ctrl;	/* 04 1 Bitmap Control * (except bit0) */
 					/* 05 n Partial Virtual Bitmap * */
-	u8	variable[0x100 - 1-1-1-1-1] ACX_PACKED;
-} acx_template_tim_t;
+	u8	variable[0x100 - 1-1-1-1-1];
+} ACX_PACKED acx_template_tim_t;
 
 typedef struct acx_template_probereq {
-	u16	size ACX_PACKED;
-	u16	fc ACX_PACKED;		/* 00 2 fc * */
-	u16	dur ACX_PACKED;		/* 02 2 Duration */
-	u8	da[6] ACX_PACKED;	/* 04 6 Destination Address * */
-	u8	sa[6] ACX_PACKED;	/* 0A 6 Source Address * */
-	u8	bssid[6] ACX_PACKED;	/* 10 6 BSSID * */
-	u16	seq ACX_PACKED;		/* 16 2 Sequence Control */
+	u16	size;
+	u16	fc;		/* 00 2 fc * */
+	u16	dur;		/* 02 2 Duration */
+	u8	da[6];	/* 04 6 Destination Address * */
+	u8	sa[6];	/* 0A 6 Source Address * */
+	u8	bssid[6];	/* 10 6 BSSID * */
+	u16	seq;		/* 16 2 Sequence Control */
 					/* 18 n SSID * */
 					/* nn n Supported Rates * */
-	u8	variable[0x44 - 2-2-6-6-6-2] ACX_PACKED;
-} acx_template_probereq_t;
+	u8	variable[0x44 - 2-2-6-6-6-2];
+} ACX_PACKED acx_template_probereq_t;
 
 typedef struct acx_template_proberesp {
-	u16	size ACX_PACKED;
-	u16	fc ACX_PACKED;		/* 00 2 fc * (bits [15:12] and [10:8] per 802.11 section 7.1.3.1) */
-	u16	dur ACX_PACKED;		/* 02 2 Duration */
-	u8	da[6] ACX_PACKED;	/* 04 6 Destination Address */
-	u8	sa[6] ACX_PACKED;	/* 0A 6 Source Address */
-	u8	bssid[6] ACX_PACKED;	/* 10 6 BSSID */
-	u16	seq ACX_PACKED;		/* 16 2 Sequence Control */
-	u8	timestamp[8] ACX_PACKED;/* 18 8 Timestamp */
-	u16	beacon_interval ACX_PACKED; /* 20 2 Beacon Interval * */
-	u16	cap ACX_PACKED;		/* 22 2 Capability Information * */
+	u16	size;
+	u16	fc;		/* 00 2 fc * (bits [15:12] and [10:8] per 802.11 section 7.1.3.1) */
+	u16	dur;		/* 02 2 Duration */
+	u8	da[6];	/* 04 6 Destination Address */
+	u8	sa[6];	/* 0A 6 Source Address */
+	u8	bssid[6];	/* 10 6 BSSID */
+	u16	seq;		/* 16 2 Sequence Control */
+	u8	timestamp[8];/* 18 8 Timestamp */
+	u16	beacon_interval; /* 20 2 Beacon Interval * */
+	u16	cap;		/* 22 2 Capability Information * */
 					/* 24 n SSID * */
 					/* nn n Supported Rates * */
 					/* nn 1 DS Parameter Set * */
-	u8	variable[0x54 - 2-2-6-6-6-2-8-2-2] ACX_PACKED;
-} acx_template_proberesp_t;
+	u8	variable[0x54 - 2-2-6-6-6-2-8-2-2];
+} ACX_PACKED acx_template_proberesp_t;
 #define acx_template_beacon_t acx_template_proberesp_t
 #define acx_template_beacon acx_template_proberesp
 
 typedef struct acx_template_nullframe {
-	u16	size ACX_PACKED;
-	struct wlan_hdr_a3 hdr ACX_PACKED;
-} acx_template_nullframe_t;
-
+	u16	size;
+	struct wlan_hdr_a3 hdr;
+} ACX_PACKED acx_template_nullframe_t;
 
 /*
 ** JOIN command structure
@@ -1890,28 +1886,28 @@ typedef struct acx_template_nullframe {
 ** as opposed to acx100, acx111 dtim interval is AFTER rates_basic111.
 ** NOTE: took me about an hour to get !@#$%^& packing right --> struct packing is eeeeevil... */
 typedef struct acx_joinbss {
-	u8	bssid[ETH_ALEN] ACX_PACKED;
-	u16	beacon_interval ACX_PACKED;
+	u8	bssid[ETH_ALEN];
+	u16	beacon_interval;
 	union {
 		struct {
-			u8	dtim_interval ACX_PACKED;
-			u8	rates_basic ACX_PACKED;
-			u8	rates_supported ACX_PACKED;
-		} acx100 ACX_PACKED;
+			u8	dtim_interval;
+			u8	rates_basic;
+			u8	rates_supported;
+		} ACX_PACKED acx100;
 		struct {
-			u16	rates_basic ACX_PACKED;
-			u8	dtim_interval ACX_PACKED;
-		} acx111 ACX_PACKED;
-	} u ACX_PACKED;
-	u8	genfrm_txrate ACX_PACKED;	/* generated frame (bcn, proberesp, RTS, PSpoll) tx rate */
-	u8	genfrm_mod_pre ACX_PACKED;	/* generated frame modulation/preamble:
+			u16	rates_basic;
+			u8	dtim_interval;
+		} ACX_PACKED acx111;
+	} u;
+	u8	genfrm_txrate;	/* generated frame (bcn, proberesp, RTS, PSpoll) tx rate */
+	u8	genfrm_mod_pre;	/* generated frame modulation/preamble:
 						** bit7: PBCC, bit6: OFDM (else CCK/DQPSK/DBPSK)
 						** bit5: short pre */
-	u8	macmode ACX_PACKED;	/* BSS Type, must be one of ACX_MODE_xxx */
-	u8	channel ACX_PACKED;
-	u8	essid_len ACX_PACKED;
-	char	essid[IW_ESSID_MAX_SIZE] ACX_PACKED;
-} acx_joinbss_t;
+	u8	macmode;	/* BSS Type, must be one of ACX_MODE_xxx */
+	u8	channel;
+	u8	essid_len;
+	char	essid[IW_ESSID_MAX_SIZE];
+} ACX_PACKED acx_joinbss_t;
 
 #define JOINBSS_RATES_1		0x01
 #define JOINBSS_RATES_2		0x02
@@ -1942,64 +1938,64 @@ typedef struct acx_joinbss {
 /***********************************************************************
 */
 typedef struct mem_read_write {
-	u16	addr ACX_PACKED;
-	u16	type ACX_PACKED; /* 0x0 int. RAM / 0xffff MAC reg. / 0x81 PHY RAM / 0x82 PHY reg.; or maybe it's actually 0x30 for MAC? Better verify it by writing and reading back and checking whether the value holds! */
-	u32	len ACX_PACKED;
-	u32	data ACX_PACKED;
-} mem_read_write_t;
+	u16	addr;
+	u16	type; /* 0x0 int. RAM / 0xffff MAC reg. / 0x81 PHY RAM / 0x82 PHY reg.; or maybe it's actually 0x30 for MAC? Better verify it by writing and reading back and checking whether the value holds! */
+	u32	len;
+	u32	data;
+} ACX_PACKED mem_read_write_t;
 
 typedef struct firmware_image {
-	u32	chksum ACX_PACKED;
-	u32	size ACX_PACKED;
-	u8	data[1] ACX_PACKED; /* the byte array of the actual firmware... */
-} firmware_image_t;
+	u32	chksum;
+	u32	size;
+	u8	data[1]; /* the byte array of the actual firmware... */
+} ACX_PACKED firmware_image_t;
 
 typedef struct acx_cmd_radioinit {
-	u32	offset ACX_PACKED;
-	u32	len ACX_PACKED;
-} acx_cmd_radioinit_t;
+	u32	offset;
+	u32	len;
+} ACX_PACKED acx_cmd_radioinit_t;
 
 typedef struct acx100_ie_wep_options {
-	u16	type ACX_PACKED;
-	u16	len ACX_PACKED;
-	u16	NumKeys ACX_PACKED;	/* max # of keys */
-	u8	WEPOption ACX_PACKED;	/* 0 == decrypt default key only, 1 == override decrypt */
-	u8	Pad ACX_PACKED;		/* used only for acx111 */
-} acx100_ie_wep_options_t;
+	u16	type;
+	u16	len;
+	u16	NumKeys;	/* max # of keys */
+	u8	WEPOption;	/* 0 == decrypt default key only, 1 == override decrypt */
+	u8	Pad;		/* used only for acx111 */
+} ACX_PACKED acx100_ie_wep_options_t;
 
 typedef struct ie_dot11WEPDefaultKey {
-	u16	type ACX_PACKED;
-	u16	len ACX_PACKED;
-	u8	action ACX_PACKED;
-	u8	keySize ACX_PACKED;
-	u8	defaultKeyNum ACX_PACKED;
-	u8	key[29] ACX_PACKED;	/* check this! was Key[19] */
-} ie_dot11WEPDefaultKey_t;
+	u16	type;
+	u16	len;
+	u8	action;
+	u8	keySize;
+	u8	defaultKeyNum;
+	u8	key[29];	/* check this! was Key[19] */
+} ACX_PACKED ie_dot11WEPDefaultKey_t;
 
 typedef struct acx111WEPDefaultKey {
-	u8	MacAddr[ETH_ALEN] ACX_PACKED;
-	u16	action ACX_PACKED;	/* NOTE: this is a u16, NOT a u8!! */
-	u16	reserved ACX_PACKED;
-	u8	keySize ACX_PACKED;
-	u8	type ACX_PACKED;
-	u8	index ACX_PACKED;
-	u8	defaultKeyNum ACX_PACKED;
-	u8	counter[6] ACX_PACKED;
-	u8	key[32] ACX_PACKED;	/* up to 32 bytes (for TKIP!) */
-} acx111WEPDefaultKey_t;
+	u8	MacAddr[ETH_ALEN];
+	u16	action;	/* NOTE: this is a u16, NOT a u8!! */
+	u16	reserved;
+	u8	keySize;
+	u8	type;
+	u8	index;
+	u8	defaultKeyNum;
+	u8	counter[6];
+	u8	key[32];	/* up to 32 bytes (for TKIP!) */
+} ACX_PACKED acx111WEPDefaultKey_t;
 
 typedef struct ie_dot11WEPDefaultKeyID {
-	u16	type ACX_PACKED;
-	u16	len ACX_PACKED;
-	u8	KeyID ACX_PACKED;
-} ie_dot11WEPDefaultKeyID_t;
+	u16	type;
+	u16	len;
+	u8	KeyID;
+} ACX_PACKED ie_dot11WEPDefaultKeyID_t;
 
 typedef struct acx100_cmd_wep_mgmt {
-	u8	MacAddr[ETH_ALEN] ACX_PACKED;
-	u16	Action ACX_PACKED;
-	u16	KeySize ACX_PACKED;
-	u8	Key[29] ACX_PACKED; /* 29*8 == 232bits == WEP256 */
-} acx100_cmd_wep_mgmt_t;
+	u8	MacAddr[ETH_ALEN];
+	u16	Action;
+	u16	KeySize;
+	u8	Key[29]; /* 29*8 == 232bits == WEP256 */
+} ACX_PACKED acx100_cmd_wep_mgmt_t;
 
 /* UNUSED?
 typedef struct defaultkey {
@@ -2008,17 +2004,17 @@ typedef struct defaultkey {
 */
 
 typedef struct acx_ie_generic {
-	u16	type ACX_PACKED;
-	u16	len ACX_PACKED;
+	u16	type;
+	u16	len;
 	union {
 		/* struct wep wp ACX_PACKED; */
 		/* Association ID IE: just a 16bit value: */
 		u16	aid;
 		/* UNUSED? struct defaultkey dkey ACX_PACKED; */
 		/* generic member for quick implementation of commands */
-		u8	bytes[32] ACX_PACKED;
-	} m ACX_PACKED;
-} acx_ie_generic_t;
+		u8	bytes[32];
+	} m;
+} ACX_PACKED acx_ie_generic_t;
 
 /***********************************************************************
 */
diff --git a/common.c b/common.c
index 623e70d..ff6152d 100644
--- a/common.c
+++ b/common.c
@@ -1097,11 +1097,11 @@ void
 great_inquisitor(acx_device_t *adev)
 {
 	static struct {
-		u16	type ACX_PACKED;
-		u16	len ACX_PACKED;
+		u16	type;
+		u16	len;
 		/* 0x200 was too large here: */
-		u8	data[0x100 - 4] ACX_PACKED;
-	} ie;
+		u8	data[0x100 - 4];
+	} ACX_PACKED ie;
 	u16 type;
 
 	FN_ENTER;
@@ -2341,11 +2341,11 @@ static void
 acx_s_initialize_rx_config(acx_device_t *adev)
 {
 	struct {
-		u16	id ACX_PACKED;
-		u16	len ACX_PACKED;
-		u16	rx_cfg1 ACX_PACKED;
-		u16	rx_cfg2 ACX_PACKED;
-	} cfg;
+		u16	id;
+		u16	len;
+		u16	rx_cfg1;
+		u16	rx_cfg2;
+	} ACX_PACKED cfg;
 
 	switch (adev->mode) {
 	case ACX_MODE_OFF:
@@ -6941,10 +6941,10 @@ acx_s_update_card_settings(acx_device_t 
 		ie_dot11WEPDefaultKeyID_t dkey;
 #ifdef DEBUG_WEP
 		struct {
-			u16 type ACX_PACKED;
-			u16 len ACX_PACKED;
-			u8  val ACX_PACKED;
-		} keyindic;
+			u16 type;
+			u16 len;
+			u8  val;
+		} ACX_PACKED keyindic;
 #endif
 		log(L_INIT, "updating WEP key settings\n");
 
diff --git a/ioctl.c b/ioctl.c
index 6c548ca..ca3c42e 100644
--- a/ioctl.c
+++ b/ioctl.c
@@ -2168,11 +2168,11 @@ acx_ioctl_get_phy_chan_busy_percentage(
 {
 	acx_device_t *adev = ndev2adev(ndev);
 	struct { /* added ACX_PACKED, not tested --vda */
-		u16 type ACX_PACKED;
-		u16 len ACX_PACKED;
-		u32 busytime ACX_PACKED;
-		u32 totaltime ACX_PACKED;
-	} usage;
+		u16 type;
+		u16 len;
+		u32 busytime;
+		u32 totaltime;
+	} ACX_PACKED usage;
 	int result;
 
 	acx_sem_lock(adev);
diff --git a/usb.c b/usb.c
index 5833d04..51290ed 100644
--- a/usb.c
+++ b/usb.c
@@ -305,10 +305,10 @@ acxusb_s_issue_cmd_timeo_debug(
 
 	struct usb_device *usbdev;
 	struct {
-		u16	cmd ACX_PACKED;
-		u16	status ACX_PACKED;
-		u8	data[1] ACX_PACKED;
-	} *loc;
+		u16	cmd;
+		u16	status;
+		u8	data[1];
+	} ACX_PACKED *loc;
 	const char *devname;
 	int acklen, blocklen, inpipe, outpipe;
 	int cmd_status;
-- 
1.2.4.g3103




-------------------------------------------------------
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&kid\x110944&bid$1720&dat\x121642

^ permalink raw reply related

* Re: [2.6.16-gitX] heavy performance regression in ipw2200 wireless driver
From: Alessandro Suardi @ 2006-03-25 22:48 UTC (permalink / raw)
  To: Zhu Yi; +Cc: Andrew Morton, linux-kernel, James Ketrenos, netdev
In-Reply-To: <1143171674.17270.195.camel@debian.sh.intel.com>

On 3/24/06, Zhu Yi <yi.zhu@intel.com> wrote:
> On Thu, 2006-03-23 at 15:02 +0100, Alessandro Suardi wrote:
> > That scp test shows 50%ish - but that was a quickie. The VNC
> >  client even reported a 719Kbps throughput down from the more
> >  usual 11500Kbps it starts off with. The first scp I tried when the
> >  sluggishness was intolerable was going at 200KB/s - which
> >  shows the problem can easily get in the neighborhood of an
> >  order of magnitude.
>
> What kind of wireless encryption do you use? We turned off hardware
> encryption by default recently as a workaround for a firmware restart
> bug. You might want to load module with "modprobe ipw2200 hwcrypto=1"
> and retest.

The issue seems to have vanished in more recent kernel snapshots
 (namely, 2.6.16-git3 and -git5 exhibited the problem; -git8 and -git9
 did not).

I will holler if the problem pops up again... thanks,

--alessandro

 "Dreamer ? Each one of us is a dreamer. We just push it down deep because
   we are repeatedly told that we are not allowed to dream in real life"
     (Reinhold Ziegler)

^ permalink raw reply

* [KJ][Patch] fix array overflows in de4x5.c
From: Darren Jenkins\ @ 2006-03-26  6:45 UTC (permalink / raw)
  To: kernel Janitors; +Cc: NetDev

[-- Attachment #1: Type: text/plain, Size: 1872 bytes --]

G'day list

Coverity found 3 'OVERRUN_STATIC' in de4x5.c, @ lines 4814, 5115 and
5125.

Looking at the code these look like very minor problems, but as they are
easy to fix I though I would do a patch.

The patch below just adds an explicit check for the array index in
type3_infoblock() and corrects a loop exit check, to eliminate an 
(array+1) error in mii_get_phy().

Note: A better solution in type3_infoblock() may be to change 
- #define MOTO_SROM_BUG    ((lp->active == 8) && (((le32_to_cpu(get_unaligned(((s32 *)dev->dev_addr))))&0x00ffffff)==0x3e0008))
+ #define MOTO_SROM_BUG    ((lp->active >= DE4X5_MAX_PHY) || (((le32_to_cpu(get_unaligned(((s32 *)dev->dev_addr))))&0x00ffffff)==0x3e0008

as this seems to make sense, but as i am not sure that this bug happens
when (lp->active < 8) I am reluctant to change this.



Signed-off-by: Darren Jenkins <darrenrjenkins@gmail.com>

--- linux-2.6.16-git8/drivers/net/tulip/de4x5.c.orig	2006-03-26 14:36:17.000000000 +1100
+++ linux-2.6.16-git8/drivers/net/tulip/de4x5.c	2006-03-26 17:06:06.000000000 +1100
@@ -4810,7 +4810,8 @@ type3_infoblock(struct net_device *dev, 
     if (lp->state == INITIALISED) {
         lp->ibn = 3;
         lp->active = *p++;
-	if (MOTO_SROM_BUG) lp->active = 0;
+	if (MOTO_SROM_BUG || lp->active >= DE4X5_MAX_PHY)
+		lp->active = 0;
 	lp->phy[lp->active].gep = (*p ? p : NULL); p += (2 * (*p) + 1);
 	lp->phy[lp->active].rst = (*p ? p : NULL); p += (2 * (*p) + 1);
 	lp->phy[lp->active].mc  = TWIDDLE(p); p += 2;
@@ -5111,7 +5112,7 @@ mii_get_phy(struct net_device *dev)
 	    break;
 	}
 	if ((j == limit) && (i < DE4X5_MAX_MII)) {
-	    for (k=0; lp->phy[k].id && (k < DE4X5_MAX_PHY); k++);
+	    for (k=0; lp->phy[k].id && (k < DE4X5_MAX_PHY - 1); k++);
 	    lp->phy[k].addr = i;
 	    lp->phy[k].id = id;
 	    lp->phy[k].spd.reg = GENERIC_REG;      /* ANLPA register         */



[-- Attachment #2: Type: text/plain, Size: 168 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

^ permalink raw reply

* [2.6 patch] net: drop duplicate assignment in request_sock
From: Adrian Bunk @ 2006-03-26 12:24 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Norbert Kiesel, acme, linux-kernel, netdev

From: Norbert Kiesel <nkiesel@tbdnetworks.com>

Just noticed that request_sock.[ch] contain a useless assignment of
rskq_accept_head to itself.  I assume this is a typo and the 2nd one
was supposed to be _tail.  However, setting _tail to NULL is not
needed, so the patch below just drops the 2nd assignment.

Signed-Off-By: Norbert Kiesel <nkiesel@tbdnetworks.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>

---

This patch was sent by Norbert Kiesel on:
-  5 Mar 2006

diff -ru a/include/net/request_sock.h b/include/net/request_sock.h
--- a/include/net/request_sock.h	2005-10-28 15:44:45.000000000 -0700
+++ b/include/net/request_sock.h	2006-03-05 15:22:33.000000000 -0800
@@ -145,7 +145,7 @@
 {
 	struct request_sock *req = queue->rskq_accept_head;
 
-	queue->rskq_accept_head = queue->rskq_accept_head = NULL;
+	queue->rskq_accept_head = NULL;
 	return req;
 }
 
diff -ru a/net/core/request_sock.c b/net/core/request_sock.c
--- a/net/core/request_sock.c	2006-03-05 14:40:50.000000000 -0800
+++ b/net/core/request_sock.c	2006-03-05 15:23:11.000000000 -0800
@@ -51,7 +51,7 @@
 
 	get_random_bytes(&lopt->hash_rnd, sizeof(lopt->hash_rnd));
 	rwlock_init(&queue->syn_wait_lock);
-	queue->rskq_accept_head = queue->rskq_accept_head = NULL;
+	queue->rskq_accept_head = NULL;
 	lopt->nr_table_entries = nr_table_entries;
 
 	write_lock_bh(&queue->syn_wait_lock);

^ permalink raw reply

* Re: [RFC][UPDATED PATCH 2.6.16] [Patch 9/9] Generic netlink interface for delay accounting
From: jamal @ 2006-03-26 14:05 UTC (permalink / raw)
  To: balbir; +Cc: Matt Helsley, Shailabh Nagar, linux-kernel, netdev
In-Reply-To: <661de9470603251022w7f8991e9g73d70a65f5d475ea@mail.gmail.com>

On Sat, 2006-25-03 at 23:52 +0530, Balbir Singh wrote:


> No, we cannot have both passed. If we pass both a PID and a TGID and
> then the code returns just the stats for the PID.
> 

ok, that clears it then; i think you are ready to go.

> >
> > Also in regards to the nesting, isnt there a need for nla_nest_cancel in
> > case of failures to add TLVs?
> >
> 
> I thought about it, but when I looked at the code of genlmsg_cancel()
> and nla_nest_cancel().  It seemed that genlmsg_cancel() should
> suffice.
> 

If your policy is to never send a message if anything fails, then you
are fine.

What would be really useful now that you understand this, is if you can
help extending/cleaning the document i sent you. Or send me a table of
contents of how it would have flowed better for you.

cheers,
jamal

^ permalink raw reply

* Re: [2.6 patch] make UNIX a bool
From: Jan-Benedict Glaw @ 2006-03-26 15:20 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: Olaf Hering, Andrew Morton, netdev, linux-kernel
In-Reply-To: <20060325194739.GS4053@stusta.de>

[-- Attachment #1: Type: text/plain, Size: 835 bytes --]

On Sat, 2006-03-25 20:47:39 +0100, Adrian Bunk <bunk@stusta.de> wrote:
> On Sat, Feb 25, 2006 at 11:46:31PM +0100, Olaf Hering wrote:
> >  On Sat, Feb 25, Adrian Bunk wrote:
> > > CONFIG_UNIX=m doesn't make much sense.
> > 
> > There is likely more code to support a modular unix.ko, this has to go
> > as well.
> 
> Sounds resonable, updated patch below.

Thanks for the patch. I'll save it somewhere to have it handy for
"patch -R" use IFF it makes its ways into Linus's repo.

MfG, JBG

-- 
Jan-Benedict Glaw       jbglaw@lug-owl.de    . +49-172-7608481             _ O _
"Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O
 für einen Freien Staat voll Freier Bürger"  | im Internet! |   im Irak!   O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply

* Re: [RFC][UPDATED PATCH 2.6.16] [Patch 9/9] Generic netlink interface for delay accounting
From: Balbir Singh @ 2006-03-26 16:40 UTC (permalink / raw)
  To: jamal; +Cc: Matt Helsley, Shailabh Nagar, linux-kernel, netdev
In-Reply-To: <1143381918.5184.52.camel@jzny2>

On Sun, Mar 26, 2006 at 09:05:18AM -0500, jamal wrote:
> On Sat, 2006-25-03 at 23:52 +0530, Balbir Singh wrote:
> 
> 
> > No, we cannot have both passed. If we pass both a PID and a TGID and
> > then the code returns just the stats for the PID.
> > 
> 
> ok, that clears it then; i think you are ready to go.

Cool! Thanks for all your help and review.

> 
> > >
> > > Also in regards to the nesting, isnt there a need for nla_nest_cancel in
> > > case of failures to add TLVs?
> > >
> > 
> > I thought about it, but when I looked at the code of genlmsg_cancel()
> > and nla_nest_cancel().  It seemed that genlmsg_cancel() should
> > suffice.
> > 
> 
> If your policy is to never send a message if anything fails, then you
> are fine.
> 
> What would be really useful now that you understand this, is if you can
> help extending/cleaning the document i sent you. Or send me a table of
> contents of how it would have flowed better for you.

I will start looking at the document and see what changes can be made.
I will try and update the document from a genetlink programmers perspective
i.e. things to know, avoid, etc.

> 
> cheers,
> jamal
> 
>

Thanks,
Balbir 

^ permalink raw reply

* Re: [Patch 8/9] generic netlink utility functions
From: Balbir Singh @ 2006-03-26 16:44 UTC (permalink / raw)
  To: Shailabh Nagar; +Cc: linux-kernel, netdev, Jamal
In-Reply-To: <1142297705.5858.28.camel@elinux04.optonline.net>

On Mon, Mar 13, 2006 at 07:55:05PM -0500, Shailabh Nagar wrote:
> genetlink-utils.patch
> 
> Two utilities for simplifying usage of NETLINK_GENERIC
> interface.
> 
> Signed-off-by: Balbir Singh <balbir@in.ibm.com>
> Signed-off-by: Shailabh Nagar <nagar@watson.ibm.com>
> 
>  include/net/genetlink.h |   20 ++++++++++++++++++++
>  1 files changed, 20 insertions(+)
> 
> Index: linux-2.6.16-rc5/include/net/genetlink.h
> ===================================================================
> --- linux-2.6.16-rc5.orig/include/net/genetlink.h	2006-03-11 07:41:32.000000000 -0500
> +++ linux-2.6.16-rc5/include/net/genetlink.h	2006-03-11 07:41:41.000000000 -0500
> @@ -150,4 +150,24 @@ static inline int genlmsg_unicast(struct
>  	return nlmsg_unicast(genl_sock, skb, pid);
>  }
>  
> +/**
> + * gennlmsg_data - head of message payload
> + * @gnlh: genetlink messsage header
> + */
> +static inline void *genlmsg_data(const struct genlmsghdr *gnlh)
> +{
> +       return ((unsigned char *) gnlh + GENL_HDRLEN);
> +}
> +
> +/**
> + * genlmsg_len - length of message payload
> + * @gnlh: genetlink message header
> + */
> +static inline int genlmsg_len(const struct genlmsghdr *gnlh)
> +{
> +       struct nlmsghdr *nlh = (struct nlmsghdr *)((unsigned char *)gnlh -
> +                                                   NLMSG_HDRLEN);
> +       return (nlh->nlmsg_len - GENL_HDRLEN - NLMSG_HDRLEN);
> +}
> +
>  #endif	/* __NET_GENERIC_NETLINK_H */
> 
>

Jamal,

Does the implementation of these utilities look ok? We use genlmsg_data()
in the delay accounting code but not genlmsg_len(), hence it might not
be very well tested (just reviewed).

Thanks,
Balbir 

^ permalink raw reply

* Re: [Patch 8/9] generic netlink utility functions
From: jamal @ 2006-03-26 17:06 UTC (permalink / raw)
  To: balbir; +Cc: Shailabh Nagar, linux-kernel, netdev
In-Reply-To: <20060326164434.GC13362@in.ibm.com>

On Sun, 2006-26-03 at 22:14 +0530, Balbir Singh wrote:

> Jamal,
> 
> Does the implementation of these utilities look ok? We use genlmsg_data()
> in the delay accounting code but not genlmsg_len(), hence it might not
> be very well tested (just reviewed).
> 

They look fine to me - please resubmit and CC Thomas Graf in case he
sees it different.

cheers,
jamal

^ permalink raw reply

* Re: [PATCH] powerpc: ibmveth: Harden driver initilisation for kexec
From: Michael Ellerman @ 2006-03-27  1:11 UTC (permalink / raw)
  To: jgarzik; +Cc: linuxppc64-dev, netdev
In-Reply-To: <44074A22.8060705@us.ibm.com>

On Thu, 2006-03-02 at 13:40 -0600, Santiago Leon wrote:
> From: Michael Ellerman <michael@ellerman.id.au>
> 
> After a kexec the veth driver will fail when trying to register with the
> Hypervisor because the previous kernel has not unregistered.
> 
> So if the registration fails, we unregister and then try again.
> 
> Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
> Acked-by: Anton Blanchard <anton@samba.org>
> Signed-off-by: Santiago Leon <santil@us.ibm.com>
> ---
> 
>   drivers/net/ibmveth.c |   32 ++++++++++++++++++++++++++------
>   1 files changed, 26 insertions(+), 6 deletions(-)

Looks like this hit the floor. Any chance of getting it into to 2.6.17
Jeff? AFAICT it should still apply cleanly.

cheers

-- 
Michael Ellerman
IBM OzLabs

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person

^ permalink raw reply

* Re: [2.6 patch] net: drop duplicate assignment in request_sock
From: David S. Miller @ 2006-03-27  1:39 UTC (permalink / raw)
  To: bunk; +Cc: akpm, nkiesel, acme, linux-kernel, netdev
In-Reply-To: <20060326122410.GG4053@stusta.de>

From: Adrian Bunk <bunk@stusta.de>
Date: Sun, 26 Mar 2006 14:24:10 +0200

> From: Norbert Kiesel <nkiesel@tbdnetworks.com>
> 
> Just noticed that request_sock.[ch] contain a useless assignment of
> rskq_accept_head to itself.  I assume this is a typo and the 2nd one
> was supposed to be _tail.  However, setting _tail to NULL is not
> needed, so the patch below just drops the 2nd assignment.
> 
> Signed-Off-By: Norbert Kiesel <nkiesel@tbdnetworks.com>
> Signed-off-by: Adrian Bunk <bunk@stusta.de>

Applied, thanks.

^ permalink raw reply

* Re: [PATCH, RESEND] Add MWI workaround for Tulip DC21143
From: Martin Michlmayr @ 2006-03-27  7:01 UTC (permalink / raw)
  To: P. Horton
  Cc: Geert Uytterhoeven, netdev, Linux/MIPS Development,
	Francois Romieu
In-Reply-To: <20060309224456.GB9103@electric-eye.fr.zoreil.com>

* Francois Romieu <romieu@fr.zoreil.com> [2006-03-09 23:44]:
> > So when compiling for Cobalt, we work around the hardware bug, while for other
> > platforms, we just disable MWI?
> > 
> > Wouldn't it be possible to always (I mean, when a rev 65 chip is detected)
> > work around the bug?
> 
> Of course it is possible but it is not the same semantic as the initial
> patch (not that I know if it is right or not).
> 
> So:
> - does the issue exist beyond Cobalt hosts ?
> - is the fix Cobalt-only ?

I don't think anyone has replied to this message yet.  My
understanding is that it's not Cobalt only but a problem in a specific
revision of the chip, which the Cobalt happens to use.  However, I'd
be glad if somone else could comment.  Peter, you read the errata
right?
-- 
Martin Michlmayr
http://www.cyrius.com/

^ permalink raw reply

* [PATCH] deinline 200+ byte inlines in sock.h
From: Denis Vlasenko @ 2006-03-27  7:21 UTC (permalink / raw)
  To: linux-kernel, netdev

[-- Attachment #1: Type: text/plain, Size: 2177 bytes --]

Sizes in bytes (allyesconfig, i386) and files where those inlines
are used:

238 sock_queue_rcv_skb 2.6.16/net/x25/x25_in.o
238 sock_queue_rcv_skb 2.6.16/net/rose/rose_in.o
238 sock_queue_rcv_skb 2.6.16/net/packet/af_packet.o
238 sock_queue_rcv_skb 2.6.16/net/netrom/nr_in.o
238 sock_queue_rcv_skb 2.6.16/net/llc/llc_sap.o
238 sock_queue_rcv_skb 2.6.16/net/llc/llc_conn.o
238 sock_queue_rcv_skb 2.6.16/net/irda/af_irda.o
238 sock_queue_rcv_skb 2.6.16/net/ipx/af_ipx.o
238 sock_queue_rcv_skb 2.6.16/net/ipv6/udp.o
238 sock_queue_rcv_skb 2.6.16/net/ipv6/raw.o
238 sock_queue_rcv_skb 2.6.16/net/ipv4/udp.o
238 sock_queue_rcv_skb 2.6.16/net/ipv4/raw.o
238 sock_queue_rcv_skb 2.6.16/net/ipv4/ipmr.o
238 sock_queue_rcv_skb 2.6.16/net/econet/econet.o
238 sock_queue_rcv_skb 2.6.16/net/econet/af_econet.o
238 sock_queue_rcv_skb 2.6.16/net/bluetooth/sco.o
238 sock_queue_rcv_skb 2.6.16/net/bluetooth/l2cap.o
238 sock_queue_rcv_skb 2.6.16/net/bluetooth/hci_sock.o
238 sock_queue_rcv_skb 2.6.16/net/ax25/ax25_in.o
238 sock_queue_rcv_skb 2.6.16/net/ax25/af_ax25.o
238 sock_queue_rcv_skb 2.6.16/net/appletalk/ddp.o
238 sock_queue_rcv_skb 2.6.16/drivers/net/pppoe.o

276 sk_receive_skb 2.6.16/net/decnet/dn_nsp_in.o
276 sk_receive_skb 2.6.16/net/dccp/ipv6.o
276 sk_receive_skb 2.6.16/net/dccp/ipv4.o
276 sk_receive_skb 2.6.16/net/dccp/dccp_ipv6.o
276 sk_receive_skb 2.6.16/drivers/net/pppoe.o

209 sk_dst_check 2.6.16/net/ipv6/ip6_output.o
209 sk_dst_check 2.6.16/net/ipv4/udp.o
209 sk_dst_check 2.6.16/net/decnet/dn_nsp_out.o

Should I also attack sock_recv_timestamp() etc?

Large inlines with multiple callers:
Size  Uses Wasted Name and definition
===== ==== ====== ================================================
  238   21   4360 sock_queue_rcv_skb    include/net/sock.h
  109   10    801 sock_recv_timestamp   include/net/sock.h
  276    4    768 sk_receive_skb        include/net/sock.h
   94    8    518 __sk_dst_check        include/net/sock.h
  209    3    378 sk_dst_check  include/net/sock.h
  131    4    333 sk_setup_caps include/net/sock.h
  152    2    132 sk_stream_alloc_pskb  include/net/sock.h
  125    2    105 sk_stream_writequeue_purge    include/net/sock.h
--
vda


[-- Attachment #2: sock.patch --]
[-- Type: text/x-diff, Size: 5483 bytes --]

diff -urpN linux-2.6.16.org/include/net/sock.h linux-2.6.16.deinline/include/net/sock.h
--- linux-2.6.16.org/include/net/sock.h	Mon Mar 20 07:53:29 2006
+++ linux-2.6.16.deinline/include/net/sock.h	Mon Mar 27 09:55:12 2006
@@ -926,28 +926,7 @@ static inline void sock_put(struct sock 
 		sk_free(sk);
 }
 
-static inline int sk_receive_skb(struct sock *sk, struct sk_buff *skb)
-{
-	int rc = NET_RX_SUCCESS;
-
-	if (sk_filter(sk, skb, 0))
-		goto discard_and_relse;
-
-	skb->dev = NULL;
-
-	bh_lock_sock(sk);
-	if (!sock_owned_by_user(sk))
-		rc = sk->sk_backlog_rcv(sk, skb);
-	else
-		sk_add_backlog(sk, skb);
-	bh_unlock_sock(sk);
-out:
-	sock_put(sk);
-	return rc;
-discard_and_relse:
-	kfree_skb(skb);
-	goto out;
-}
+extern int sk_receive_skb(struct sock *sk, struct sk_buff *skb);
 
 /* Detach socket from process context.
  * Announce socket dead, detach it from wait queue and inode.
@@ -1032,33 +1011,9 @@ sk_dst_reset(struct sock *sk)
 	write_unlock(&sk->sk_dst_lock);
 }
 
-static inline struct dst_entry *
-__sk_dst_check(struct sock *sk, u32 cookie)
-{
-	struct dst_entry *dst = sk->sk_dst_cache;
-
-	if (dst && dst->obsolete && dst->ops->check(dst, cookie) == NULL) {
-		sk->sk_dst_cache = NULL;
-		dst_release(dst);
-		return NULL;
-	}
-
-	return dst;
-}
-
-static inline struct dst_entry *
-sk_dst_check(struct sock *sk, u32 cookie)
-{
-	struct dst_entry *dst = sk_dst_get(sk);
-
-	if (dst && dst->obsolete && dst->ops->check(dst, cookie) == NULL) {
-		sk_dst_reset(sk);
-		dst_release(dst);
-		return NULL;
-	}
+extern struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie);
 
-	return dst;
-}
+extern struct dst_entry *sk_dst_check(struct sock *sk, u32 cookie);
 
 static inline void sk_setup_caps(struct sock *sk, struct dst_entry *dst)
 {
@@ -1128,45 +1083,7 @@ extern void sk_reset_timer(struct sock *
 
 extern void sk_stop_timer(struct sock *sk, struct timer_list* timer);
 
-static inline int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
-{
-	int err = 0;
-	int skb_len;
-
-	/* Cast skb->rcvbuf to unsigned... It's pointless, but reduces
-	   number of warnings when compiling with -W --ANK
-	 */
-	if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >=
-	    (unsigned)sk->sk_rcvbuf) {
-		err = -ENOMEM;
-		goto out;
-	}
-
-	/* It would be deadlock, if sock_queue_rcv_skb is used
-	   with socket lock! We assume that users of this
-	   function are lock free.
-	*/
-	err = sk_filter(sk, skb, 1);
-	if (err)
-		goto out;
-
-	skb->dev = NULL;
-	skb_set_owner_r(skb, sk);
-
-	/* Cache the SKB length before we tack it onto the receive
-	 * queue.  Once it is added it no longer belongs to us and
-	 * may be freed by other threads of control pulling packets
-	 * from the queue.
-	 */
-	skb_len = skb->len;
-
-	skb_queue_tail(&sk->sk_receive_queue, skb);
-
-	if (!sock_flag(sk, SOCK_DEAD))
-		sk->sk_data_ready(sk, skb_len);
-out:
-	return err;
-}
+extern int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb);
 
 static inline int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb)
 {
diff -urpN linux-2.6.16.org/net/core/sock.c linux-2.6.16.deinline/net/core/sock.c
--- linux-2.6.16.org/net/core/sock.c	Mon Mar 20 07:53:29 2006
+++ linux-2.6.16.deinline/net/core/sock.c	Mon Mar 27 09:45:09 2006
@@ -187,6 +187,99 @@ static void sock_disable_timestamp(struc
 }
 
 
+int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
+{
+	int err = 0;
+	int skb_len;
+
+	/* Cast skb->rcvbuf to unsigned... It's pointless, but reduces
+	   number of warnings when compiling with -W --ANK
+	 */
+	if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >=
+	    (unsigned)sk->sk_rcvbuf) {
+		err = -ENOMEM;
+		goto out;
+	}
+
+	/* It would be deadlock, if sock_queue_rcv_skb is used
+	   with socket lock! We assume that users of this
+	   function are lock free.
+	*/
+	err = sk_filter(sk, skb, 1);
+	if (err)
+		goto out;
+
+	skb->dev = NULL;
+	skb_set_owner_r(skb, sk);
+
+	/* Cache the SKB length before we tack it onto the receive
+	 * queue.  Once it is added it no longer belongs to us and
+	 * may be freed by other threads of control pulling packets
+	 * from the queue.
+	 */
+	skb_len = skb->len;
+
+	skb_queue_tail(&sk->sk_receive_queue, skb);
+
+	if (!sock_flag(sk, SOCK_DEAD))
+		sk->sk_data_ready(sk, skb_len);
+out:
+	return err;
+}
+EXPORT_SYMBOL(sock_queue_rcv_skb);
+
+int sk_receive_skb(struct sock *sk, struct sk_buff *skb)
+{
+	int rc = NET_RX_SUCCESS;
+
+	if (sk_filter(sk, skb, 0))
+		goto discard_and_relse;
+
+	skb->dev = NULL;
+
+	bh_lock_sock(sk);
+	if (!sock_owned_by_user(sk))
+		rc = sk->sk_backlog_rcv(sk, skb);
+	else
+		sk_add_backlog(sk, skb);
+	bh_unlock_sock(sk);
+out:
+	sock_put(sk);
+	return rc;
+discard_and_relse:
+	kfree_skb(skb);
+	goto out;
+}
+EXPORT_SYMBOL(sk_receive_skb);
+
+struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie)
+{
+	struct dst_entry *dst = sk->sk_dst_cache;
+
+	if (dst && dst->obsolete && dst->ops->check(dst, cookie) == NULL) {
+		sk->sk_dst_cache = NULL;
+		dst_release(dst);
+		return NULL;
+	}
+
+	return dst;
+}
+EXPORT_SYMBOL(__sk_dst_check);
+
+struct dst_entry *sk_dst_check(struct sock *sk, u32 cookie)
+{
+	struct dst_entry *dst = sk_dst_get(sk);
+
+	if (dst && dst->obsolete && dst->ops->check(dst, cookie) == NULL) {
+		sk_dst_reset(sk);
+		dst_release(dst);
+		return NULL;
+	}
+
+	return dst;
+}
+EXPORT_SYMBOL(sk_dst_check);
+
 /*
  *	This is meant for all protocols to use and covers goings on
  *	at the socket level. Everything here is generic.

^ permalink raw reply

* [PATCH] deinline some larger functions from netdevice.h
From: Denis Vlasenko @ 2006-03-27 11:19 UTC (permalink / raw)
  To: linux-kernel, netdev, David S. Miller

[-- Attachment #1: Type: text/plain, Size: 1919 bytes --]

On a allyesconfig'ured kernel:

Size  Uses Wasted Name and definition
===== ==== ====== ================================================
   95  162  12075 netif_wake_queue      include/linux/netdevice.h
  129   86   9265 dev_kfree_skb_any     include/linux/netdevice.h
  127   56   5885 netif_device_attach   include/linux/netdevice.h
   73   86   4505 dev_kfree_skb_irq     include/linux/netdevice.h
   46   60   1534 netif_device_detach   include/linux/netdevice.h
  119   16   1485 __netif_rx_schedule   include/linux/netdevice.h
  143    5    492 netif_rx_schedule     include/linux/netdevice.h
   81    7    366 netif_schedule        include/linux/netdevice.h

netif_wake_queue is big because __netif_schedule is a big inline:

static inline void __netif_schedule(struct net_device *dev)
{
        if (!test_and_set_bit(__LINK_STATE_SCHED, &dev->state)) {
                unsigned long flags;
                struct softnet_data *sd;

                local_irq_save(flags);
                sd = &__get_cpu_var(softnet_data);
                dev->next_sched = sd->output_queue;
                sd->output_queue = dev;
                raise_softirq_irqoff(NET_TX_SOFTIRQ);
                local_irq_restore(flags);
        }
}

static inline void netif_wake_queue(struct net_device *dev)
{
#ifdef CONFIG_NETPOLL_TRAP
        if (netpoll_trap())
                return;
#endif
        if (test_and_clear_bit(__LINK_STATE_XOFF, &dev->state))
                __netif_schedule(dev);
}

By de-inlining __netif_schedule we are saving a lot of text
at each callsite of netif_wake_queue and netif_schedule.
__netif_rx_schedule is also big, and it makes more sense to keep
both of them out of line.

Patch also deinlines dev_kfree_skb_any. We can deinline dev_kfree_skb_irq
instead... oh well.

netif_device_attach/detach are not hot paths, we can deinline them too.

Signed-off-by: Denis Vlasenko <vda@ilport.com.ua>
--
vda

[-- Attachment #2: netdevice.patch --]
[-- Type: text/x-diff, Size: 4491 bytes --]

diff -urpN linux-2.6.16.org/include/linux/netdevice.h linux-2.6.16.deinline2/include/linux/netdevice.h
--- linux-2.6.16.org/include/linux/netdevice.h	Mon Mar 20 07:53:29 2006
+++ linux-2.6.16.deinline2/include/linux/netdevice.h	Mon Mar 27 13:46:15 2006
@@ -594,20 +594,7 @@ DECLARE_PER_CPU(struct softnet_data,soft
 
 #define HAVE_NETIF_QUEUE
 
-static inline void __netif_schedule(struct net_device *dev)
-{
-	if (!test_and_set_bit(__LINK_STATE_SCHED, &dev->state)) {
-		unsigned long flags;
-		struct softnet_data *sd;
-
-		local_irq_save(flags);
-		sd = &__get_cpu_var(softnet_data);
-		dev->next_sched = sd->output_queue;
-		sd->output_queue = dev;
-		raise_softirq_irqoff(NET_TX_SOFTIRQ);
-		local_irq_restore(flags);
-	}
-}
+extern void __netif_schedule(struct net_device *dev);
 
 static inline void netif_schedule(struct net_device *dev)
 {
@@ -671,13 +658,7 @@ static inline void dev_kfree_skb_irq(str
 /* Use this variant in places where it could be invoked
  * either from interrupt or non-interrupt context.
  */
-static inline void dev_kfree_skb_any(struct sk_buff *skb)
-{
-	if (in_irq() || irqs_disabled())
-		dev_kfree_skb_irq(skb);
-	else
-		dev_kfree_skb(skb);
-}
+extern void dev_kfree_skb_any(struct sk_buff *skb);
 
 #define HAVE_NETIF_RX 1
 extern int		netif_rx(struct sk_buff *skb);
@@ -735,22 +716,9 @@ static inline int netif_device_present(s
 	return test_bit(__LINK_STATE_PRESENT, &dev->state);
 }
 
-static inline void netif_device_detach(struct net_device *dev)
-{
-	if (test_and_clear_bit(__LINK_STATE_PRESENT, &dev->state) &&
-	    netif_running(dev)) {
-		netif_stop_queue(dev);
-	}
-}
+extern void netif_device_detach(struct net_device *dev);
 
-static inline void netif_device_attach(struct net_device *dev)
-{
-	if (!test_and_set_bit(__LINK_STATE_PRESENT, &dev->state) &&
-	    netif_running(dev)) {
-		netif_wake_queue(dev);
- 		__netdev_watchdog_up(dev);
-	}
-}
+extern void netif_device_attach(struct net_device *dev);
 
 /*
  * Network interface message level settings
@@ -818,20 +786,7 @@ static inline int netif_rx_schedule_prep
  * already been called and returned 1.
  */
 
-static inline void __netif_rx_schedule(struct net_device *dev)
-{
-	unsigned long flags;
-
-	local_irq_save(flags);
-	dev_hold(dev);
-	list_add_tail(&dev->poll_list, &__get_cpu_var(softnet_data).poll_list);
-	if (dev->quota < 0)
-		dev->quota += dev->weight;
-	else
-		dev->quota = dev->weight;
-	__raise_softirq_irqoff(NET_RX_SOFTIRQ);
-	local_irq_restore(flags);
-}
+extern void __netif_rx_schedule(struct net_device *dev);
 
 /* Try to reschedule poll. Called by irq handler. */
 
diff -urpN linux-2.6.16.org/net/core/dev.c linux-2.6.16.deinline2/net/core/dev.c
--- linux-2.6.16.org/net/core/dev.c	Mon Mar 20 07:53:29 2006
+++ linux-2.6.16.deinline2/net/core/dev.c	Mon Mar 27 13:47:00 2006
@@ -1073,6 +1073,70 @@ void dev_queue_xmit_nit(struct sk_buff *
 	rcu_read_unlock();
 }
 
+
+void __netif_schedule(struct net_device *dev)
+{
+	if (!test_and_set_bit(__LINK_STATE_SCHED, &dev->state)) {
+		unsigned long flags;
+		struct softnet_data *sd;
+
+		local_irq_save(flags);
+		sd = &__get_cpu_var(softnet_data);
+		dev->next_sched = sd->output_queue;
+		sd->output_queue = dev;
+		raise_softirq_irqoff(NET_TX_SOFTIRQ);
+		local_irq_restore(flags);
+	}
+}
+EXPORT_SYMBOL(__netif_schedule);
+
+void __netif_rx_schedule(struct net_device *dev)
+{
+	unsigned long flags;
+
+	local_irq_save(flags);
+	dev_hold(dev);
+	list_add_tail(&dev->poll_list, &__get_cpu_var(softnet_data).poll_list);
+	if (dev->quota < 0)
+		dev->quota += dev->weight;
+	else
+		dev->quota = dev->weight;
+	__raise_softirq_irqoff(NET_RX_SOFTIRQ);
+	local_irq_restore(flags);
+}
+EXPORT_SYMBOL(__netif_rx_schedule);
+
+void dev_kfree_skb_any(struct sk_buff *skb)
+{
+	if (in_irq() || irqs_disabled())
+		dev_kfree_skb_irq(skb);
+	else
+		dev_kfree_skb(skb);
+}
+EXPORT_SYMBOL(dev_kfree_skb_any);
+
+
+/* Hot-plugging. */
+void netif_device_detach(struct net_device *dev)
+{
+	if (test_and_clear_bit(__LINK_STATE_PRESENT, &dev->state) &&
+	    netif_running(dev)) {
+		netif_stop_queue(dev);
+	}
+}
+EXPORT_SYMBOL(netif_device_detach);
+
+void netif_device_attach(struct net_device *dev)
+{
+	if (!test_and_set_bit(__LINK_STATE_PRESENT, &dev->state) &&
+	    netif_running(dev)) {
+		netif_wake_queue(dev);
+ 		__netdev_watchdog_up(dev);
+	}
+}
+EXPORT_SYMBOL(netif_device_attach);
+
+
 /*
  * Invalidate hardware checksum when packet is to be mangled, and
  * complete checksum manually on outgoing path.

^ permalink raw reply

* Re: [PATCH] pcmcia: avoid binding hostap_cs to Orinoco cards
From: Sebastian @ 2006-03-27 11:44 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Linux Kernel Mailing List, linux, Netdev List
In-Reply-To: <44063023.9010603@pobox.com>

> commit 40e3cad61197fce63853e778db020f7637d988f2
> tree 6e086c930e1aef0bb24eb61af42d1f3c1fb7d38c
> parent f0892b89e3c19c7d805825ca12511d26dcdf6415
> author Pavel Roskin <proski@gnu.org> Tue, 28 Feb 2006 11:18:31 -0500
> committer Dominik Brodowski <linux@dominikbrodowski.net> Wed, 01 Mar 
> 2006 11:12:00 +0100
> 
> [PATCH] pcmcia: avoid binding hostap_cs to Orinoco cards
> 
> Don't just use cards with PCMCIA ID 0x0156, 0x0002.  Make sure that
> the vendor string is "Intersil" or "INTERSIL"
> 
> Signed-off-by: Pavel Roskin <proski@gnu.org>
> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
> 
>  drivers/net/wireless/hostap/hostap_cs.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletion(-)


Hello,

this patch seems to break my setup. The hostap_cs driver included in
kernel 2.6.16 does not detect my Prism 2 WLAN card anymore, although it
is *not* Orinoco. With 2.6.15.5 it still worked.

FYI:
pccardctl info
PRODID_1=""
PRODID_2="Link DWL-650 11Mbps WLAN Card"
PRODID_3="Version 01.02"
PRODID_4=""
MANFID=0156,0002
FUNCID=6

Sebastian

^ permalink raw reply

* Re: [PATCH, RESEND] Add MWI workaround for Tulip DC21143
From: Peter Horton @ 2006-03-27 12:39 UTC (permalink / raw)
  To: Martin Michlmayr
  Cc: P. Horton, Geert Uytterhoeven, netdev, Linux/MIPS Development,
	Francois Romieu
In-Reply-To: <20060327070112.GA10906@deprecation.cyrius.com>

Martin Michlmayr wrote:
> * Francois Romieu <romieu@fr.zoreil.com> [2006-03-09 23:44]:
>   
>>> So when compiling for Cobalt, we work around the hardware bug, while for other
>>> platforms, we just disable MWI?
>>>
>>> Wouldn't it be possible to always (I mean, when a rev 65 chip is detected)
>>> work around the bug?
>>>       
>> Of course it is possible but it is not the same semantic as the initial
>> patch (not that I know if it is right or not).
>>
>> So:
>> - does the issue exist beyond Cobalt hosts ?
>> - is the fix Cobalt-only ?
>>     
>
> I don't think anyone has replied to this message yet.  My
> understanding is that it's not Cobalt only but a problem in a specific
> revision of the chip, which the Cobalt happens to use.  However, I'd
> be glad if somone else could comment.  Peter, you read the errata
> right?
>   

According to the errata it applies to all DEC 21143-PD and 21143-TD 
which are the chips with the revision code 0x41 (65). The errata states 
the receive buffers should not end on a cache aligned boundary when 
using MWI otherwise the receiver will not close the last descriptor.

P.

^ permalink raw reply

* Re: [PATCH] pcmcia: avoid binding hostap_cs to Orinoco cards
From: John W. Linville @ 2006-03-27 16:48 UTC (permalink / raw)
  To: Sebastian
  Cc: Jeff Garzik, Linux Kernel Mailing List, linux, Netdev List,
	proski
In-Reply-To: <1143459885.9691.6.camel@coruscant.datenknoten.de>

On Mon, Mar 27, 2006 at 01:44:44PM +0200, Sebastian wrote:
> > commit 40e3cad61197fce63853e778db020f7637d988f2
> > tree 6e086c930e1aef0bb24eb61af42d1f3c1fb7d38c
> > parent f0892b89e3c19c7d805825ca12511d26dcdf6415
> > author Pavel Roskin <proski@gnu.org> Tue, 28 Feb 2006 11:18:31 -0500
> > committer Dominik Brodowski <linux@dominikbrodowski.net> Wed, 01 Mar 
> > 2006 11:12:00 +0100
> > 
> > [PATCH] pcmcia: avoid binding hostap_cs to Orinoco cards
> > 
> > Don't just use cards with PCMCIA ID 0x0156, 0x0002.  Make sure that
> > the vendor string is "Intersil" or "INTERSIL"
> > 
> > Signed-off-by: Pavel Roskin <proski@gnu.org>
> > Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
> > 
> >  drivers/net/wireless/hostap/hostap_cs.c |    5 ++++-
> >  1 files changed, 4 insertions(+), 1 deletion(-)

> this patch seems to break my setup. The hostap_cs driver included in
> kernel 2.6.16 does not detect my Prism 2 WLAN card anymore, although it
> is *not* Orinoco. With 2.6.15.5 it still worked.

This patch didn't come through me, so I don't know much about it.
Hopefully Pavel or Dominik can comment?

John
-- 
John W. Linville
linville@tuxdriver.com

^ permalink raw reply

* Re: [PATCH] pcmcia: avoid binding hostap_cs to Orinoco cards
From: Pavel Roskin @ 2006-03-27 17:12 UTC (permalink / raw)
  To: John W. Linville
  Cc: Sebastian, Jeff Garzik, Linux Kernel Mailing List, linux,
	Netdev List
In-Reply-To: <20060327164844.GF14403@tuxdriver.com>

On Mon, 2006-03-27 at 11:48 -0500, John W. Linville wrote:
> > this patch seems to break my setup. The hostap_cs driver included in
> > kernel 2.6.16 does not detect my Prism 2 WLAN card anymore, although it
> > is *not* Orinoco. With 2.6.15.5 it still worked.

It mean hostap_cs was identifying the card solely by its numeric ID
(0x0156, 0x0002) instead of the vendor strings.  Since that particular
numeric ID was used both by cards that are supported by hostap_cs and
those that are not, it cannot be used in hostap_cs.

Sebastian, please send me the output of "pccardctl ident" and I'll
submit the patch for hostap_cs.

> This patch didn't come through me, so I don't know much about it.
> Hopefully Pavel or Dominik can comment?

-- 
Regards,
Pavel Roskin

^ permalink raw reply

* Re: 32bit compat for rtnetlink wireless extensions?
From: Jean Tourrilhes @ 2006-03-27 18:42 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: netdev, John W. Linville, linux-kernel
In-Reply-To: <200603261408.48766.arnd@arndb.de>

On Sun, Mar 26, 2006 at 02:08:48PM +0200, Arnd Bergmann wrote:
> I stumbled over the 'WE-20 for kernel 2.6.16' and afaict, there is no
> way that IW_HEADER_TYPE_POINT rtnetlink messages can work when using
> 32 bit user tools on a 64 bit kernel.

	Please check again ;-) I agree that it's not obvious...

> For the ioctl inteface, this gets handled using the do_wireless_ioctl
> function in fs/compat_ioctl.c, but we don't have a way to convert
> netlink data -- it is supposed to always be compatible between
> 32 and 64 bit.
> 
> What is the reason for having IW_HEADER_TYPE_POINT in the first place?
> Does that reason apply to both the ioctl and the netlink interface, or
> can the netlink transport for wireless commands be changed so it
> does not need user space pointers?

	Actually, when things are passed over RtNetlink, the pointer
is removed, and the content of IW_HEADER_TYPE_POINT is moved to not
leave a gap.
	The actual code for the commands is a little bit complex,
especially that the buffer is "optimised". But, if you check for the
comments, you will find it. Instead, you may want to check the code
for the event, where I do the same, and which is easier to read.
	The function is iwe_stream_add_point(), and you will find it
in include/net/iw_handler.h. Copy below...

	I was toying with the idea of changing the
IW_HEADER_TYPE_POINT struct itself, but I discarded that because the
amount of fixing in the driver that would require.

> 	Arnd <><

	Thanks for the quick review, have fun...

	Jean

/*------------------------------------------------------------------*/
/*
 * Wrapper to add an short Wireless Event containing a pointer to a
 * stream of events.
 */
static inline char *
iwe_stream_add_point(char *	stream,		/* Stream of events */
		     char *	ends,		/* End of stream */
		     struct iw_event *iwe,	/* Payload length + flags */
		     char *	extra)		/* More payload */
{
	int	event_len = IW_EV_POINT_LEN + iwe->u.data.length;
	/* Check if it's possible */
	if(likely((stream + event_len) < ends)) {
		iwe->len = event_len;
		memcpy(stream, (char *) iwe, IW_EV_LCP_LEN);
		memcpy(stream + IW_EV_LCP_LEN,
		       ((char *) iwe) + IW_EV_LCP_LEN + IW_EV_POINT_OFF,
		       IW_EV_POINT_LEN - IW_EV_LCP_LEN);
		memcpy(stream + IW_EV_POINT_LEN, extra, iwe->u.data.length);
		stream += event_len;
	}
	return stream;
}

^ permalink raw reply

* Re: 32bit compat for rtnetlink wireless extensions?
From: Arnd Bergmann @ 2006-03-27 21:10 UTC (permalink / raw)
  To: jt; +Cc: netdev, John W. Linville, linux-kernel
In-Reply-To: <20060327184242.GC31478@bougret.hpl.hp.com>

Am Monday 27 March 2006 20:42 schrieb Jean Tourrilhes:
>         Actually, when things are passed over RtNetlink, the pointer
> is removed, and the content of IW_HEADER_TYPE_POINT is moved to not
> leave a gap.

Ah, that makes sense, thanks for the explanation.

So if the wireless ioctl interface ever got retired, that code could
get simplified a lot to just pass around a flat data structure, right?

	Arnd <><

^ permalink raw reply

* Re: 32bit compat for rtnetlink wireless extensions?
From: Jean Tourrilhes @ 2006-03-27 21:17 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: netdev, John W. Linville, linux-kernel
In-Reply-To: <200603272310.44692.arnd@arndb.de>

On Mon, Mar 27, 2006 at 11:10:44PM +0200, Arnd Bergmann wrote:
> Am Monday 27 March 2006 20:42 schrieb Jean Tourrilhes:
> >         Actually, when things are passed over RtNetlink, the pointer
> > is removed, and the content of IW_HEADER_TYPE_POINT is moved to not
> > leave a gap.
> 
> Ah, that makes sense, thanks for the explanation.
> 
> So if the wireless ioctl interface ever got retired, that code could
> get simplified a lot to just pass around a flat data structure, right?
> 
> 	Arnd <><

	Actually, it could be removed *now*. You would just have to
fix all wireless drivers in existence. I will scratch my head to see
if we could plan a smooth transition.

	Jean

^ permalink raw reply

* Re: [2.6 patch] PCMCIA_SPECTRUM must select FW_LOADER
From: John W. Linville @ 2006-03-27 21:56 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: Alexander E. Patrakov, LKML, netdev
In-Reply-To: <20060324165619.GG22727@stusta.de>

On Fri, Mar 24, 2006 at 05:56:19PM +0100, Adrian Bunk wrote:

> PCMCIA_SPECTRUM must select FW_LOADER.
> 
> Reported by "Alexander E. Patrakov" <patrakov@ums.usu.ru>.
> 
> Signed-off-by: Adrian Bunk <bunk@stusta.de>

Merged to the 'upstream' branch of wireless-2.6.

Thanks!

John
-- 
John W. Linville
linville@tuxdriver.com

^ permalink raw reply

* 2.6.16, 3com: transmit timed out, tx_status 00 status 8000
From: John Bäckstrand @ 2006-03-27 23:25 UTC (permalink / raw)
  To: linux-kernel; +Cc: netdev, linux-net

Ive been seeing stuff in dmesg with very recent kernels:

NETDEV WATCHDOG: 3com: transmit timed out
3com: transmit timed out, tx_status 00 status 8000.
   diagnostics: net 04fa media 8880 dma 000000a0 fifo 0000
   Flags; bus-master 1, dirty 67260778(10) current 67260794(10)
   Transmit list 2f6758e0 vs. ef675840.
3com: command 0x3002 did not complete! Status=0x9000
   0: @ef675200  length 80000036 status 00000036
   1: @ef6752a0  length 80000042 status 00000042
   2: @ef675340  length 8000028c status 0000028c
   3: @ef6753e0  length 800005d6 status 000005d6
   4: @ef675480  length 800005ea status 000005ea
   5: @ef675520  length 800005ba status 000005ba
   6: @ef6755c0  length 8000028c status 0000028c
   7: @ef675660  length 800005d6 status 000005d6
   8: @ef675700  length 800005ea status 800005ea
   9: @ef6757a0  length 800005d6 status 800005d6
   10: @ef675840  length 80000036 status 00010036
   11: @ef6758e0  length 80000036 status 00000036
   12: @ef675980  length 80000036 status 00000036
   13: @ef675a20  length 80000036 status 00000036
   14: @ef675ac0  length 80000036 status 00000036
   15: @ef675b60  length 80000036 status 00000036

Any ideas at all? Seems to happen mostly when doing heavy downloading.

I think this did not happen a few versions ago, I know it happened with 
2.6.16-rc6, and 2.6.16. I donk think it used to happen on .14/.15 and 
earlier though.

The card is a 3c905.

0000:00:0b.0 Ethernet controller: 3Com Corporation 3c905C-TX/TX-M 
[Tornado] (rev 74)
         Subsystem: 3Com Corporation 3C905C-TX Fast Etherlink for PC 
Management NIC
         Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- 
ParErr- Stepping- SERR- FastB2B-
         Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium 
 >TAbort- <TAbort- <MAbort- >SERR- <PERR-
         Latency: 32 (2500ns min, 2500ns max), Cache Line Size: 0x08 (32 
bytes)
         Interrupt: pin A routed to IRQ 10
         Region 0: I/O ports at 9000 [size=128]
         Region 1: Memory at e3000000 (32-bit, non-prefetchable) [size=128]
         Expansion ROM at 40000000 [disabled] [size=128K]
         Capabilities: [dc] Power Management version 2
                 Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA 
PME(D0+,D1+,D2+,D3hot+,D3cold+)
                 Status: D0 PME-Enable- DSel=0 DScale=2 PME-

(I see there has been 3com-related patches in -git, should I try this? 
Any chance of them helping?

---
John Bäckstrand

^ permalink raw reply

* Re: [PATCH 1/8] [I/OAT] DMA memcpy subsystem
From: Andrew Grover @ 2006-03-28 18:44 UTC (permalink / raw)
  To: Kumar Gala; +Cc: Chris Leech, linux kernel mailing list, netdev
In-Reply-To: <2FF801BB-F96C-4864-AC44-09B4B92531F7@kernel.crashing.org>

On 3/16/06, Kumar Gala <galak@kernel.crashing.org> wrote:
> It would seem that when a client registers (or shortly there after
> when they call dma_async_client_chan_request()) they would expect to
> get the number of channels they need by some given time period.
>
> For example, lets say a client registers but no dma device exists.
> They will never get called to be aware of this condition.
>
> I would think most clients would either spin until they have all the
> channels they need or fall back to a non-async mechanism.

Clients *are* expected to fall back to non-async if they are not given
channels. The reason it was implemented with callbacks for
added/removed was that the client may be initializing before the
channels are enumerated. For example, the net subsystem will ask for
channels and not get them for a while, until the ioatdma PCI device is
found and its driver loads. In this scenario, we'd like the net
subsystem to be given these channels, instead of them going unused.

> Also, what do you think about adding an operation type (MEMCPY, XOR,
> CRYPTO_AES, etc).  We can than validate if the operation type
> expected is supported by the devices that exist.

No objections, but this speculative support doesn't need to be in our
initial patchset.

> Shouldn't we also have a dma_async_client_chan_free()?

Well we could just define it to be chan_request(0) but it doesn't seem
to be needed. Also, the allocation mechanism we have for channels is
different from alloc/free's semantics, so it may be best to not muddy
the water in this area.

Regards -- Andy

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox