Netdev List
 help / color / mirror / Atom feed
* [PATCH 4/6] rt2x00 update: Remove packed attributes for structures that don't need it
From: Ivo van Doorn @ 2006-04-28 14:52 UTC (permalink / raw)
  To: netdev; +Cc: rt2x00-devel

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

From: Ivo van Doorn <IvDoorn@gmail.com>

Remove __attribute__ ((packed)) for structures that
are not being send to the device.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>

diff -uprN wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2x00.h wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2x00.h
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2x00.h	2006-04-28 15:09:53.000000000 +0200
+++ wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2x00.h	2006-04-28 15:50:06.000000000 +0200
@@ -324,12 +324,12 @@ extern int error_bitrange_bad;
 struct rt2x00_field16{
 	u16	bit_offset;
 	u16	bit_mask;
-} __attribute__ ((packed));
+};
 
 struct rt2x00_field32{
 	u32	bit_offset;
 	u32	bit_mask;
-} __attribute__ ((packed));
+};
 
 /*
  * Before intitializing the rt2x00_field# structures,
@@ -430,7 +430,7 @@ rt2x00_get_field16_nb(const u16 reg, con
 struct _rt2x00_chip{
 	u16				rt;
 	u16				rf;
-} __attribute__ ((packed));
+};
 
 /*
  * Set chipset data.
@@ -511,7 +511,7 @@ struct data_ring{
 	 */
 	u16					data_size;
 	u16					desc_size;
-} __attribute__ ((packed));
+};
 
 /*
  * Handlers to determine the address of the current device specific
@@ -612,7 +612,7 @@ struct scanning{
 	short					status;
 #define SCANNING_READY				0x0001
 #define SCANNING_CANCELLED			0x0002
-} __attribute__ ((packed));
+};
 
 
 /*
diff -uprN wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2x00pci.h wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2x00pci.h
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2x00pci.h	2006-04-28 15:09:45.000000000 +0200
+++ wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2x00pci.h	2006-04-28 15:49:18.000000000 +0200
@@ -72,7 +72,7 @@ struct rt2x00_button{
 	short					button_status:1;
 	short					active_poll:1;
 	short					__pad:14;
-} __attribute__ ((packed));
+};
 #endif /* CONFIG_RT2X00_BUTTON */
 
 /*
@@ -106,7 +106,7 @@ struct data_entry{
 	 */
 	void				*data_addr;
 	dma_addr_t			data_dma;
-} __attribute__ ((packed));
+};
 
 /*
  * Device specific structure.
@@ -231,7 +231,7 @@ struct rt2x00_pci{
 	 * after that the beacon and RX ring follow.
 	 */
 	struct data_ring			*ring;
-} __attribute__ ((packed));
+};
 
 static inline struct data_ring*
 rt2x00pci_get_ring(struct rt2x00_pci *rt2x00pci, const int ring)
diff -uprN wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2x00usb.h wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2x00usb.h
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2x00usb.h	2006-04-28 15:09:44.000000000 +0200
+++ wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2x00usb.h	2006-04-28 15:49:31.000000000 +0200
@@ -85,7 +85,7 @@ struct data_entry{
 	 */
 	void				*data_addr;
 	dma_addr_t			data_dma;
-} __attribute__ ((packed));
+};
 
 /*
  * The location of the descriptor is variating and depends
@@ -215,7 +215,7 @@ struct rt2x00_usb{
 	 * after that the beacon and RX ring follow.
 	 */
 	struct data_ring			*ring;
-} __attribute__ ((packed));
+};
 
 static inline struct data_ring*
 rt2x00usb_get_ring(struct rt2x00_usb *rt2x00usb, const int ring)

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

^ permalink raw reply

* [PATCH 5/6] rt2x00 update: Apply correct endian annotation for structures that are DMA'ed to device.
From: Ivo van Doorn @ 2006-04-28 14:52 UTC (permalink / raw)
  To: netdev; +Cc: rt2x00-devel

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

From: Ivo van Doorn <IvDoorn@gmail.com>

Use __le32 annotations for all fields in the descriptor,
since these should always be treated as little endian.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>

diff -uprN wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2400pci.h wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2400pci.h
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2400pci.h	2006-04-28 15:09:48.000000000 +0200
+++ wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2400pci.h	2006-04-28 15:59:24.000000000 +0200
@@ -739,7 +739,7 @@
  * TX descriptor format for TX, PRIO, ATIM and Beacon Ring.
  */
 struct txd{
-	u32	word0;
+	__le32				word0;
 #define TXD_W0_OWNER_NIC		FIELD32(0x00000001)
 #define TXD_W0_VALID			FIELD32(0x00000002)
 #define TXD_W0_RESULT			FIELD32(0x0000001c)
@@ -753,32 +753,32 @@ struct txd{
 #define TXD_W0_AGC			FIELD32(0x00ff0000)
 #define TXD_W0_R2			FIELD32(0xff000000)
 
-	u32	word1;
+	__le32				word1;
 #define TXD_W1_BUFFER_ADDRESS		FIELD32(0xffffffff)
 
-	u32	word2;
+	__le32				word2;
 #define TXD_W2_BUFFER_LENGTH		FIELD32(0x0000ffff)
 #define TXD_W2_DATABYTE_COUNT		FIELD32(0xffff0000)
 
-	u32	word3;
+	__le32				word3;
 #define TXD_W3_PLCP_SIGNAL		FIELD32(0x0000ffff)
 #define TXD_W3_PLCP_SERVICE		FIELD32(0xffff0000)
 
-	u32	word4;
+	__le32				word4;
 #define TXD_W4_PLCP_LENGTH_LOW		FIELD32(0x0000ffff)
 #define TXD_W4_PLCP_LENGTH_HIGH		FIELD32(0xffff0000)
 
-	u32	word5;
+	__le32				word5;
 #define TXD_W5_BBCR4			FIELD32(0x0000ffff)
 #define TXD_W5_AGC_REG			FIELD32(0x007f0000)
 #define TXD_W5_AGC_REG_VALID		FIELD32(0x00800000)
 #define TXD_W5_XXX_REG			FIELD32(0x7f000000)
 #define TXD_W5_XXX_REG_VALID		FIELD32(0x80000000)
 
-	u32	word6;
+	__le32				word6;
 #define TXD_W6_SK_BUFF			FIELD32(0xffffffff)
 
-	u32	word7;
+	__le32				word7;
 #define TXD_W7_RESERVED			FIELD32(0xffffffff)
 } __attribute__ ((packed));
 
@@ -786,7 +786,7 @@ struct txd{
  * RX descriptor format for RX Ring.
  */
 struct rxd{
-	u32	word0;
+	__le32				word0;
 #define RXD_W0_OWNER_NIC		FIELD32(0x00000001)
 #define RXD_W0_UNICAST_TO_ME		FIELD32(0x00000002)
 #define RXD_W0_MULTICAST		FIELD32(0x00000004)
@@ -796,30 +796,30 @@ struct rxd{
 #define RXD_W0_PHYSICAL_ERROR		FIELD32(0x00000080)
 #define RXD_W0_DATABYTE_COUNT		FIELD32(0xffff0000)
 
-	u32	word1;
+	__le32				word1;
 #define RXD_W1_BUFFER_ADDRESS		FIELD32(0xffffffff)
 
-	u32	word2;
+	__le32				word2;
 #define RXD_W2_BUFFER_LENGTH		FIELD32(0x0000ffff)
 #define RXD_W2_BBR0			FIELD32(0x00ff0000)
 #define RXD_W2_RSSI			FIELD32(0xff000000)
 
-	u32	word3;
+	__le32				word3;
 #define RXD_W3_BBR2			FIELD32(0x000000ff)
 #define RXD_W3_BBR3			FIELD32(0x0000ff00)
 #define RXD_W3_BBR4			FIELD32(0x00ff0000)
 #define RXD_W3_BBR5			FIELD32(0xff000000)
 
-	u32	word4;
+	__le32				word4;
 #define RXD_W4_RX_END_TIME		FIELD32(0xffffffff)
 
-	u32	word5;
+	__le32				word5;
 #define RXD_W5_RESERVED			FIELD32(0xffffffff)
 
-	u32	word6;
+	__le32				word6;
 #define RXD_W6_RESERVED			FIELD32(0xffffffff)
 
-	u32	word7;
+	__le32				word7;
 #define RXD_W7_RESERVED			FIELD32(0xffffffff)
 } __attribute__ ((packed));
 
diff -uprN wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500pci.h wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500pci.h
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500pci.h	2006-04-28 15:09:48.000000000 +0200
+++ wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500pci.h	2006-04-28 15:58:29.000000000 +0200
@@ -987,7 +987,7 @@
  * TX descriptor format for TX, PRIO, ATIM and Beacon Ring.
  */
 struct txd{
-	u32	word0;
+	__le32				word0;
 #define TXD_W0_OWNER_NIC		FIELD32(0x00000001)
 #define TXD_W0_VALID			FIELD32(0x00000002)
 #define TXD_W0_RESULT			FIELD32(0x0000001c)
@@ -1002,40 +1002,40 @@ struct txd{
 #define TXD_W0_DATABYTE_COUNT		FIELD32(0x0fff0000)
 #define TXD_W0_CIPHER_ALG		FIELD32(0xe0000000)
 
-	u32	word1;
+	__le32				word1;
 #define TXD_W1_BUFFER_ADDRESS		FIELD32(0xffffffff)
 
-	u32	word2;
+	u32				word2;
 #define TXD_W2_IV_OFFSET		FIELD32(0x0000003f)
 #define TXD_W2_AIFS			FIELD32(0x000000c0)
 #define TXD_W2_CWMIN			FIELD32(0x00000f00)
 #define TXD_W2_CWMAX			FIELD32(0x0000f000)
 
-	u32	word3;
+	__le32				word3;
 #define TXD_W3_PLCP_SIGNAL		FIELD32(0x000000ff)
 #define TXD_W3_PLCP_SERVICE		FIELD32(0x0000ff00)
 #define TXD_W3_PLCP_LENGTH_LOW		FIELD32(0x00ff0000)
 #define TXD_W3_PLCP_LENGTH_HIGH		FIELD32(0xff000000)
 
-	u32	word4;
+	__le32				word4;
 #define TXD_W4_IV			FIELD32(0xffffffff)
 
-	u32	word5;
+	__le32				word5;
 #define TXD_W5_EIV			FIELD32(0xffffffff)
 
-	u32	word6;
+	__le32				word6;
 #define TXD_W6_KEY			FIELD32(0xffffffff)
 
-	u32	word7;
+	__le32				word7;
 #define TXD_W7_KEY			FIELD32(0xffffffff)
 
-	u32	word8;
+	__le32				word8;
 #define TXD_W8_KEY			FIELD32(0xffffffff)
 
-	u32	word9;
+	__le32				word9;
 #define TXD_W9_KEY			FIELD32(0xffffffff)
 
-	u32	word10;
+	__le32				word10;
 #define TXD_W10_RTS			FIELD32(0x00000001)
 #define TXD_W10_TX_RATE			FIELD32(0x000000fe)
 } __attribute__ ((packed));
@@ -1044,7 +1044,7 @@ struct txd{
  * RX descriptor format for RX Ring.
  */
 struct rxd{
-	u32	word0;
+	__le32				word0;
 #define RXD_W0_OWNER_NIC		FIELD32(0x00000001)
 #define RXD_W0_UNICAST_TO_ME		FIELD32(0x00000002)
 #define RXD_W0_MULTICAST		FIELD32(0x00000004)
@@ -1059,36 +1059,36 @@ struct rxd{
 #define RXD_W0_DATABYTE_COUNT		FIELD32(0x0fff0000)
 #define RXD_W0_CIPHER_ALG		FIELD32(0xe0000000)
 
-	u32	word1;
+	__le32				word1;
 #define RXD_W1_BUFFER_ADDRESS		FIELD32(0xffffffff)
 
-	u32	word2;
+	__le32				word2;
 #define RXD_W2_BBR0			FIELD32(0x000000ff)
 #define RXD_W2_RSSI			FIELD32(0x0000ff00)
 #define RXD_W2_TA			FIELD32(0xffff0000)
 
-	u32	word3;
+	__le32				word3;
 #define RXD_W3_TA			FIELD32(0xffffffff)
 
-	u32	word4;
+	__le32				word4;
 #define RXD_W4_IV			FIELD32(0xffffffff)
 
-	u32	word5;
+	__le32				word5;
 #define RXD_W5_EIV			FIELD32(0xffffffff)
 
-	u32	word6;
+	__le32				word6;
 #define RXD_W6_KEY			FIELD32(0xffffffff)
 
-	u32	word7;
+	__le32				word7;
 #define RXD_W7_KEY			FIELD32(0xffffffff)
 
-	u32	word8;
+	__le32				word8;
 #define RXD_W8_KEY			FIELD32(0xffffffff)
 
-	u32	word9;
+	__le32				word9;
 #define RXD_W9_KEY			FIELD32(0xffffffff)
 
-	u32	word10;
+	__le32				word10;
 #define RXD_W10_DROP			FIELD32(0x00000001)
 } __attribute__ ((packed));
 
diff -uprN wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500usb.h wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500usb.h
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500usb.h	2006-04-28 15:09:48.000000000 +0200
+++ wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500usb.h	2006-04-28 15:58:57.000000000 +0200
@@ -553,7 +553,7 @@
  * TX descriptor format for TX, PRIO, ATIM and Beacon Ring.
  */
 struct txd{
-	u32	word0;
+	__le32				word0;
 #define TXD_W0_PACKET_ID		FIELD32(0x0000000f)
 #define TXD_W0_RETRY_LIMIT		FIELD32(0x000000f0)
 #define TXD_W0_MORE_FRAG		FIELD32(0x00000100)
@@ -566,22 +566,22 @@ struct txd{
 #define TXD_W0_CIPHER			FIELD32(0x20000000)
 #define TXD_W0_KEY_ID			FIELD32(0xc0000000)
 
-	u32	word1;
+	__le32				word1;
 #define TXD_W1_IV_OFFSET		FIELD32(0x0000003f)
 #define TXD_W1_AIFS			FIELD32(0x000000c0)
 #define TXD_W1_CWMIN			FIELD32(0x00000f00)
 #define TXD_W1_CWMAX			FIELD32(0x0000f000)
 
-	u32	word2;
+	__le32				word2;
 #define TXD_W2_PLCP_SIGNAL		FIELD32(0x000000ff)
 #define TXD_W2_PLCP_SERVICE		FIELD32(0x0000ff00)
 #define TXD_W2_PLCP_LENGTH_LOW		FIELD32(0x00ff0000)
 #define TXD_W2_PLCP_LENGTH_HIGH		FIELD32(0xff000000)
 
-	u32	word3;
+	__le32				word3;
 #define TXD_W3_IV			FIELD32(0xffffffff)
 
-	u32	word4;
+	__le32				word4;
 #define TXD_W4_EIV			FIELD32(0xffffffff)
 } __attribute__ ((packed));
 
@@ -589,7 +589,7 @@ struct txd{
  * RX descriptor format for RX Ring.
  */
 struct rxd{
-	u32	word0;
+	__le32				word0;
 #define RXD_W0_UNICAST_TO_ME		FIELD32(0x00000002)
 #define RXD_W0_MULTICAST		FIELD32(0x00000004)
 #define RXD_W0_BROADCAST		FIELD32(0x00000008)
@@ -601,14 +601,14 @@ struct rxd{
 #define RXD_W0_CI_ERROR			FIELD32(0x00000200)
 #define RXD_W0_DATABYTE_COUNT		FIELD32(0x0fff0000)
 
-	u32	word1;
+	__le32				word1;
 #define RXD_W1_SIGNAL			FIELD32(0x000000ff)
 #define RXD_W1_RSSI			FIELD32(0x0000ff00)
 
-	u32	word2;
+	__le32				word2;
 #define RXD_W2_IV			FIELD32(0xffffffff)
 
-	u32	word3;
+	__le32				word3;
 #define RXD_W3_EIV			FIELD32(0xffffffff)
 } __attribute__ ((packed));
 

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

^ permalink raw reply

* [PATCH 2/6] rt2x00 update: Deactivate monitor_during_oper for now
From: Ivo van Doorn @ 2006-04-28 14:52 UTC (permalink / raw)
  To: netdev; +Cc: rt2x00-devel

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

From: Ivo van Doorn <IvDoorn@gmail.com>

Set monitor_during_oper to 0 for the time being,
this feature will be supported in the future.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>

diff -uprN wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2400pci.c wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2400pci.c
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2400pci.c	2006-04-28 15:13:49.000000000 +0200
+++ wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2400pci.c	2006-04-28 15:16:23.000000000 +0200
@@ -2362,7 +2362,7 @@ rt2400pci_init_hw(struct rt2x00_pci *rt2
 	hw->no_tkip_wmm_hwaccel = 1;
 	hw->extra_hdr_room = 0;
 	hw->device_strips_mic = 0;
-	hw->monitor_during_oper = 1;
+	hw->monitor_during_oper = 0;
 	hw->fraglist = 0;
 
 	/*
diff -uprN wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500pci.c wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500pci.c
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500pci.c	2006-04-28 15:12:23.000000000 +0200
+++ wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500pci.c	2006-04-28 15:16:23.000000000 +0200
@@ -2619,7 +2619,7 @@ rt2500pci_init_hw(struct rt2x00_pci *rt2
 	hw->no_tkip_wmm_hwaccel = 1;
 	hw->extra_hdr_room = 0;
 	hw->device_strips_mic = 0;
-	hw->monitor_during_oper = 1;
+	hw->monitor_during_oper = 0;
 	hw->fraglist = 0;
 	hw->channel_change_time = 2000;
 
diff -uprN wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500usb.c wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500usb.c
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500usb.c	2006-04-28 15:13:01.000000000 +0200
+++ wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500usb.c	2006-04-28 15:16:22.000000000 +0200
@@ -2233,7 +2233,7 @@ rt2500usb_init_hw(struct rt2x00_usb *rt2
 	hw->no_tkip_wmm_hwaccel = 1;
 	hw->extra_hdr_room = 0;
 	hw->device_strips_mic = 0;
-	hw->monitor_during_oper = 1;
+	hw->monitor_during_oper = 0;
 	hw->fraglist = 0;
 	hw->channel_change_time = 500000;
 

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

^ permalink raw reply

* [PATCH 1/6] rt2x00 update: Remove casts from void* pointers
From: Ivo van Doorn @ 2006-04-28 14:52 UTC (permalink / raw)
  To: netdev; +Cc: rt2x00-devel

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

From: Ivo van Doorn <IvDoorn@gmail.com>

Remove unneeded casts when working with a void* pointer.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>

diff -uprN wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2400pci.c wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2400pci.c
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2400pci.c	2006-04-28 15:09:53.000000000 +0200
+++ wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2400pci.c	2006-04-28 15:13:49.000000000 +0200
@@ -917,7 +917,7 @@ rt2400pci_write_tx_desc(
 static void
 rt2400pci_beacondone(void *data)
 {
-	struct data_ring	*ring = (struct data_ring*)data;
+	struct data_ring	*ring = data;
 	struct rt2x00_pci	*rt2x00pci =
 		ieee80211_dev_hw_data(ring->net_dev);
 	struct sk_buff		*skb;
@@ -938,7 +938,7 @@ rt2400pci_beacondone(void *data)
 static void
 rt2400pci_rxdone(void *data)
 {
-	struct data_ring	*ring = (struct data_ring*)data;
+	struct data_ring	*ring = data;
 	struct rt2x00_pci	*rt2x00pci =
 		ieee80211_dev_hw_data(ring->net_dev);
 	struct data_entry	*entry;
@@ -995,7 +995,7 @@ rt2400pci_rxdone(void *data)
 static void
 rt2400pci_txdone(void *data)
 {
-	struct data_ring	*ring = (struct data_ring*)data;
+	struct data_ring	*ring = data;
 	struct rt2x00_pci	*rt2x00pci =
 		ieee80211_dev_hw_data(ring->net_dev);
 	struct data_entry	*entry;
@@ -1067,7 +1067,7 @@ rt2400pci_txdone(void *data)
 static irqreturn_t
 rt2400pci_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
 {
-	struct rt2x00_pci	*rt2x00pci = (struct rt2x00_pci*)dev_instance;
+	struct rt2x00_pci	*rt2x00pci = dev_instance;
 	u32			reg;
 
 	/*
@@ -1187,7 +1187,7 @@ rt2400pci_alloc_ring(
 	 * Initialize all ring entries to contain valid
 	 * addresses.
 	 */
-	entry = (struct data_entry*)ring->entry;
+	entry = ring->entry;
 	for (counter = 0; counter < ring->stats.limit; counter++) {
 		entry[counter].skb = NULL;
 		entry[counter].desc_addr = ring->data_addr
@@ -1275,7 +1275,7 @@ rt2400pci_init_rxdesc(struct rt2x00_pci 
 
 	memset(ring->data_addr, 0x00, rt2x00_get_ring_size(ring));
 
-	entry = (struct data_entry*)ring->entry;
+	entry = ring->entry;
 	for (counter = 0; counter < ring->stats.limit; counter++) {
 		rxd = entry[counter].desc_addr;
 
@@ -1298,7 +1298,7 @@ rt2400pci_init_txdesc(struct rt2x00_pci 
 
 	memset(ring->data_addr, 0x00, rt2x00_get_ring_size(ring));
 
-	entry = (struct data_entry*)ring->entry;
+	entry = ring->entry;
 	for (counter = 0; counter < ring->stats.limit; counter++) {
 		txd = entry[counter].desc_addr;
 
diff -uprN wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500pci.c wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500pci.c
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500pci.c	2006-04-28 15:09:53.000000000 +0200
+++ wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500pci.c	2006-04-28 15:12:23.000000000 +0200
@@ -994,7 +994,7 @@ rt2500pci_write_tx_desc(
 static void
 rt2500pci_beacondone(void *data)
 {
-	struct data_ring	*ring = (struct data_ring*)data;
+	struct data_ring	*ring = data;
 	struct rt2x00_pci	*rt2x00pci =
 		ieee80211_dev_hw_data(ring->net_dev);
 	struct sk_buff		*skb;
@@ -1015,7 +1015,7 @@ rt2500pci_beacondone(void *data)
 static void
 rt2500pci_rxdone(void *data)
 {
-	struct data_ring	*ring = (struct data_ring*)data;
+	struct data_ring	*ring = data;
 	struct rt2x00_pci	*rt2x00pci =
 		ieee80211_dev_hw_data(ring->net_dev);
 	struct data_entry	*entry;
@@ -1083,7 +1083,7 @@ rt2500pci_rxdone(void *data)
 static void
 rt2500pci_txdone(void *data)
 {
-	struct data_ring	*ring = (struct data_ring*)data;
+	struct data_ring	*ring = data;
 	struct rt2x00_pci	*rt2x00pci =
 		ieee80211_dev_hw_data(ring->net_dev);
 	struct data_entry	*entry;
@@ -1155,7 +1155,7 @@ rt2500pci_txdone(void *data)
 static irqreturn_t
 rt2500pci_interrupt(int irq, void *dev_instance, struct pt_regs *regs)
 {
-	struct rt2x00_pci	*rt2x00pci = (struct rt2x00_pci*)dev_instance;
+	struct rt2x00_pci	*rt2x00pci = dev_instance;
 	u32			reg;
 
 	/*
@@ -1276,7 +1276,7 @@ rt2500pci_alloc_ring(
 	 * Initialize all ring entries to contain valid
 	 * addresses.
 	 */
-	entry = (struct data_entry*)ring->entry;
+	entry = ring->entry;
 	for (counter = 0; counter < ring->stats.limit; counter++) {
 		entry[counter].skb = NULL;
 		entry[counter].desc_addr = ring->data_addr
@@ -1364,7 +1364,7 @@ rt2500pci_init_rxdesc(struct rt2x00_pci 
 
 	memset(ring->data_addr, 0x00, rt2x00_get_ring_size(ring));
 
-	entry = (struct data_entry*)ring->entry;
+	entry = ring->entry;
 	for (counter = 0; counter < ring->stats.limit; counter++) {
 		rxd = entry[counter].desc_addr;
 
@@ -1385,7 +1385,7 @@ rt2500pci_init_txdesc(struct rt2x00_pci 
 
 	memset(ring->data_addr, 0x00, rt2x00_get_ring_size(ring));
 
-	entry = (struct data_entry*)ring->entry;
+	entry = ring->entry;
 	for (counter = 0; counter < ring->stats.limit; counter++) {
 		txd = entry[counter].desc_addr;
 
diff -uprN wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500usb.c wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500usb.c
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500usb.c	2006-04-28 15:09:53.000000000 +0200
+++ wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500usb.c	2006-04-28 15:13:01.000000000 +0200
@@ -818,7 +818,7 @@ rt2500usb_write_tx_desc(
 static void
 rt2500usb_beacondone(void *data)
 {
-	struct data_ring	*ring = (struct data_ring*)data;
+	struct data_ring	*ring = data;
 	struct rt2x00_usb	*rt2x00usb =
 		ieee80211_dev_hw_data(ring->net_dev);
 	struct sk_buff		*skb;
@@ -839,7 +839,7 @@ rt2500usb_beacondone(void *data)
 static void
 rt2500usb_rxdone(void *data)
 {
-	struct data_ring	*ring = (struct data_ring*)data;
+	struct data_ring	*ring = data;
 	struct rt2x00_usb	*rt2x00usb =
 		ieee80211_dev_hw_data(ring->net_dev);
 	struct data_entry	*entry;
@@ -924,7 +924,7 @@ rt2500usb_rxdone(void *data)
 static void
 rt2500usb_txdone(void *data)
 {
-	struct data_ring	*ring = (struct data_ring*)data;
+	struct data_ring	*ring = data;
 	struct rt2x00_usb	*rt2x00usb =
 		ieee80211_dev_hw_data(ring->net_dev);
 	struct data_entry	*entry;
@@ -1069,7 +1069,7 @@ rt2500usb_alloc_ring(
 	 * addresses.
 	 */
 	status = 0;
-	entry = (struct data_entry*)ring->entry;
+	entry = ring->entry;
 	for (counter = 0; counter < ring->stats.limit; counter++) {
 		entry[counter].ring = ring;
 		if (!status)
@@ -1099,7 +1099,7 @@ rt2500usb_free_ring(struct rt2x00_usb *r
 	if (!ring->entry)
 		goto exit;
 
-	entry = (struct data_entry*)ring->entry;
+	entry = ring->entry;
 	for (counter = 0; counter < ring->stats.limit; counter++) {
 		usb_kill_urb(entry[counter].urb);
 		usb_free_urb(entry[counter].urb);
@@ -1175,7 +1175,7 @@ rt2500usb_init_rxring(struct rt2x00_usb 
 	struct data_entry	*entry;
 	u8			counter;
 
-	entry = (struct data_entry*)ring->entry;
+	entry = ring->entry;
 	for (counter = 0; counter < ring->stats.limit; counter++) {
 		entry[counter].urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
 		entry[counter].urb->transfer_dma = entry[counter].data_dma;
@@ -1198,7 +1198,7 @@ rt2500usb_init_txring(struct rt2x00_usb 
 	struct data_entry	*entry;
 	u8			counter;
 
-	entry = (struct data_entry*)ring->entry;
+	entry = ring->entry;
 	for (counter = 0; counter < ring->stats.limit; counter++) {
 		entry[counter].urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
 		entry[counter].urb->transfer_dma = entry[counter].data_dma;
@@ -1410,7 +1410,7 @@ rt2500usb_reset_ring(struct data_ring *r
 	struct data_entry	*entry;
 	int			counter;
 
-	entry = (struct data_entry*)ring->entry;
+	entry = ring->entry;
 	for (counter = 0; counter < ring->stats.limit; counter++)
 		usb_kill_urb(entry[counter].urb);
 }

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

^ permalink raw reply

* [PATCH 3/6] rt2x00 update: Use static const for the vals arrays
From: Ivo van Doorn @ 2006-04-28 14:52 UTC (permalink / raw)
  To: netdev; +Cc: rt2x00-devel

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

From: Ivo van Doorn <IvDoorn@gmail.com>

Make the vals arrays static const.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>

diff -uprN wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2400pci.c wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2400pci.c
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2400pci.c	2006-04-28 15:16:23.000000000 +0200
+++ wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2400pci.c	2006-04-28 15:32:12.000000000 +0200
@@ -2229,7 +2229,7 @@ rt2400pci_init_hw_channels(struct rt2x00
 {
 	int				counter;
 	u16				eeprom;
-	static u32 vals[] = {
+	static const u32 vals[] = {
 		0x000c1fda, 0x000c1fee, 0x000c2002, 0x000c2016,
 		0x000c202a, 0x000c203e, 0x000c2052, 0x000c2066,
 		0x000c207a, 0x000c208e, 0x000c20a2, 0x000c20b6,
diff -uprN wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500pci.c wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500pci.c
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500pci.c	2006-04-28 15:16:23.000000000 +0200
+++ wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500pci.c	2006-04-28 15:32:31.000000000 +0200
@@ -2347,7 +2347,7 @@ rt2500pci_init_hw_channels(struct rt2x00
 	int				counter;
 	u32				rf2_base;
 	u16				eeprom;
-	static struct {
+	static const struct {
 		unsigned int chip;
 		u32 val[3];
 	} rf[] = {
@@ -2404,7 +2404,7 @@ rt2500pci_init_hw_channels(struct rt2x00
 		rf2_base = 0x00080000;
 
 	if (rt2x00_rf(&rt2x00pci->chip, RF2522)) {
-		static u32 vals[] = {
+		static const u32 vals[] = {
 			0x000c1fda, 0x000c1fee, 0x000c2002, 0x000c2016,
 			0x000c202a, 0x000c203e, 0x000c2052, 0x000c2066,
 			0x000c207a, 0x000c208e, 0x000c20a2, 0x000c20b6,
@@ -2416,7 +2416,7 @@ rt2500pci_init_hw_channels(struct rt2x00
 	} else if (rt2x00_rf(&rt2x00pci->chip, RF2523)
 	|| rt2x00_rf(&rt2x00pci->chip, RF2524)
 	|| rt2x00_rf(&rt2x00pci->chip, RF2525)) {
-		static u32 vals[] = {
+		static const u32 vals[] = {
 			0x00000c9e, 0x00000ca2, 0x00000ca6, 0x00000caa,
 			0x00000cae, 0x00000cb2, 0x00000cb6, 0x00000cba,
 			0x00000cbe, 0x00000d02, 0x00000d06, 0x00000d0a,
@@ -2428,7 +2428,7 @@ rt2500pci_init_hw_channels(struct rt2x00
 				cpu_to_le32(vals[counter] | rf2_base);
 	} else if (rt2x00_rf(&rt2x00pci->chip, RF2525E)
 	|| rt2x00_rf(&rt2x00pci->chip, RF5222)) {
-		static u32 vals[] = {
+		static const u32 vals[] = {
 			0x00001136, 0x0000113a, 0x0000113e, 0x00001182,
 			0x00001186, 0x0000118a, 0x0000118e, 0x00001192,
 			0x00001196, 0x0000119a, 0x0000119e, 0x000011a2,
@@ -2440,7 +2440,7 @@ rt2500pci_init_hw_channels(struct rt2x00
 				cpu_to_le32(vals[counter] | rf2_base);
 	}
 	if (rt2x00_rf(&rt2x00pci->chip, RF5222)) {
-		static u32 vals[] = {
+		static const u32 vals[] = {
 			0x00018896, 0x0001889a, 0x0001889e, 0x000188a2,
 			0x000188a6, 0x000188aa, 0x000188ae, 0x000188b2,
 			0x00008802, 0x00008806, 0x0000880a, 0x0000880e,
diff -uprN wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500usb.c wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500usb.c
--- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500usb.c	2006-04-28 15:16:22.000000000 +0200
+++ wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500usb.c	2006-04-28 15:32:06.000000000 +0200
@@ -1968,7 +1968,7 @@ rt2500usb_init_hw_channels(struct rt2x00
 	int				counter;
 	u32				rf2_base;
 	u16				eeprom;
-	static struct {
+	static const struct {
 		unsigned int chip;
 		u32 val[3];
 	} rf[] = {
@@ -2024,7 +2024,7 @@ rt2500usb_init_hw_channels(struct rt2x00
 		rf2_base = 0x00080000;
 
 	if (rt2x00_rf(&rt2x00usb->chip, RF2522)) {
-		static u32 vals[] = {
+		static const u32 vals[] = {
 			0x000c1fda, 0x000c1fee, 0x000c2002, 0x000c2016,
 			0x000c202a, 0x000c203e, 0x000c2052, 0x000c2066,
 			0x000c207a, 0x000c208e, 0x000c20a2, 0x000c20b6,
@@ -2036,7 +2036,7 @@ rt2500usb_init_hw_channels(struct rt2x00
 	} else if (rt2x00_rf(&rt2x00usb->chip, RF2523)
 	|| rt2x00_rf(&rt2x00usb->chip, RF2524)
 	|| rt2x00_rf(&rt2x00usb->chip, RF2525)) {
-		static u32 vals[] = {
+		static const u32 vals[] = {
 			0x00000c9e, 0x00000ca2, 0x00000ca6, 0x00000caa,
 			0x00000cae, 0x00000cb2, 0x00000cb6, 0x00000cba,
 			0x00000cbe, 0x00000d02, 0x00000d06, 0x00000d0a,
@@ -2046,7 +2046,7 @@ rt2500usb_init_hw_channels(struct rt2x00
 		for (counter = 0; counter < ARRAY_SIZE(vals); counter++)
 			channels[counter].val = vals[counter] | rf2_base;
 	} else if (rt2x00_rf(&rt2x00usb->chip, RF2525E)) {
-		static u32 vals[] = {
+		static const u32 vals[] = {
 			0x0000089a, 0x0000089e, 0x0000089e, 0x000008a2,
 			0x000008a2, 0x000008a6, 0x000008a6, 0x000008aa,
 			0x000008aa, 0x000008ae, 0x000008ae, 0x000008b2,
@@ -2056,7 +2056,7 @@ rt2500usb_init_hw_channels(struct rt2x00
 		for (counter = 0; counter < ARRAY_SIZE(vals); counter++)
 			channels[counter].val = vals[counter];
 	} else if (rt2x00_rf(&rt2x00usb->chip, RF5222)) {
-		static u32 vals[] = {
+		static const u32 vals[] = {
 			0x00001136, 0x0000113a, 0x0000113e, 0x00001182,
 			0x00001186, 0x0000118a, 0x0000118e, 0x00001192,
 			0x00001196, 0x0000119a, 0x0000119e, 0x000011a2,

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

^ permalink raw reply

* Re: [PATCH 22/32] rt2x00: Allocate ring structures in single array
From: Ivo van Doorn @ 2006-04-28 14:33 UTC (permalink / raw)
  To: Jiri Benc; +Cc: netdev, rt2x00-devel
In-Reply-To: <20060428163055.0656bc08@griffin.suse.cz>

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

On Friday 28 April 2006 16:30, Jiri Benc wrote:
> On Fri, 28 Apr 2006 16:25:09 +0200, Ivo van Doorn wrote:
> > I am not really fan on such messages. But when the control->queue is indeed
> > invalid, it is a serious bug. Perhaps a BUG() should be used as well?
> > If so, I'll put it into a new patch along with the fixes below.
> 
> BUG() is not a good idea, this is not critical enough to panic the kernel.

Ok, I"ll just change the debug message then. :)

Thanks.

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

^ permalink raw reply

* Re: [PATCH 22/32] rt2x00: Allocate ring structures in single array
From: Jiri Benc @ 2006-04-28 14:30 UTC (permalink / raw)
  To: Ivo van Doorn; +Cc: netdev, rt2x00-devel
In-Reply-To: <200604281625.13165.IvDoorn@gmail.com>

On Fri, 28 Apr 2006 16:25:09 +0200, Ivo van Doorn wrote:
> I am not really fan on such messages. But when the control->queue is indeed
> invalid, it is a serious bug. Perhaps a BUG() should be used as well?
> If so, I'll put it into a new patch along with the fixes below.

BUG() is not a good idea, this is not critical enough to panic the kernel.

-- 
Jiri Benc
SUSE Labs

^ permalink raw reply

* Re: [PATCH 22/32] rt2x00: Allocate ring structures in single array
From: Ivo van Doorn @ 2006-04-28 14:25 UTC (permalink / raw)
  To: Jiri Benc; +Cc: netdev, rt2x00-devel
In-Reply-To: <20060428125201.4f20ece2@griffin.suse.cz>

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

On Friday 28 April 2006 12:52, Jiri Benc wrote:
> On Fri, 28 Apr 2006 00:03:13 +0200, Ivo van Doorn wrote:
> > Use seperate function to convert a dscape ring ID
> > to the address of the actual ring.
> 
> Just minor things:
> 
> > [...]
> > @@ -1386,20 +1412,19 @@ rt2400pci_tx(struct net_device *net_dev,
> >  
> >  	rt2x00_register_read(rt2x00pci, TXCSR0, &reg);
> >  
> > -	if (control->queue == IEEE80211_TX_QUEUE_DATA0) {
> > -		ring = &rt2x00pci->prio;
> > -		rt2x00_set_field32(&reg, TXCSR0_KICK_PRIO, 1);
> > -	} else if (control->queue == IEEE80211_TX_QUEUE_DATA1) {
> > -		ring = &rt2x00pci->tx;
> > -		rt2x00_set_field32(&reg, TXCSR0_KICK_TX, 1);
> > -	} else if (control->queue == IEEE80211_TX_QUEUE_AFTER_BEACON) {
> > -		ring = &rt2x00pci->atim;
> > -		rt2x00_set_field32(&reg, TXCSR0_KICK_ATIM, 1);
> > -	} else {
> > -		ERROR("Frame received for invalid queue.");
> > +	/*
> > +	 * Determine which ring to put packet on.
> > +	 */
> > +	ring = rt2x00pci_get_ring(rt2x00pci, control->queue);
> > +	if (unlikely(!ring)) {
> 
> Should not happen. Maybe some message that user should report a bug?

I am not really fan on such messages. But when the control->queue is indeed
invalid, it is a serious bug. Perhaps a BUG() should be used as well?
If so, I'll put it into a new patch along with the fixes below.

> > +		ERROR("Attempt to send packet over invalid queue %d.\n",
> > +			control->queue);
> >  		return NET_RX_DROP;
> >  	}
> >  
> > +	if (rt2x00_ring_full(ring))
> > +		return NET_RX_DROP;
> 
> NET_XMIT_DROP?

Absolutely true, I'll fix this as well.

> > +
> >  	entry = rt2x00_get_data_entry(ring);
> >  	txd = entry->desc_addr;
> >  
> > [...]
> > @@ -1780,14 +1813,17 @@ rt2400pci_conf_tx(struct net_device *net
> >  	int queue, const struct ieee80211_tx_queue_params *params)
> >  {
> >  	struct rt2x00_pci	*rt2x00pci = ieee80211_dev_hw_data(net_dev);
> > -	struct data_ring	*ring;
> > +	struct data_ring	*ring = &rt2x00pci->ring[RING_TX];
> >  
> > -	if (queue == IEEE80211_TX_QUEUE_DATA0)
> > -		ring = &rt2x00pci->prio;
> > -	else if (queue == IEEE80211_TX_QUEUE_DATA1)
> > -		ring = &rt2x00pci->tx;
> > -	else
> > -		return -EINVAL;
> > +	/*
> > +	 * We don't support variating cw_min and cw_max variables
> > +	 * per queue. So by default we only configure the TX queue,
> > +	 * and ignore all other configurations.
> > +	 */
> > +	if (queue != IEEE80211_TX_QUEUE_DATA0) {
> > +		NOTICE("Ignoring configuration for queue %d.\n", queue);
> > +		return 0;
> 
> Is there a reason for not returning a proper error code?

Good question, in rt2400pci the behaviour is something that is not
somethign the dscape could expect. Since we don't allow the
configuration of all available tx queues.
I had made it return 0, since I wasn't sure how the stack would
appreciate this behaviour.
But I have checked this in the stack since then, and apparently,
tx_conf is called without any notice of available tx queues.
Only when WMM is available the return value is checked,
so it is safe to return a error value.
But this behaviour should never have appeared in rt2500pci and rt2500usb,
so I'll put this fix in the patch as well.

Thanks.

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

^ permalink raw reply

* Re: [PATCH 20/32] rt2x00: byte ordering correctness
From: Michael Buesch @ 2006-04-28 13:56 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: Ivo van Doorn, netdev, rt2x00-devel
In-Reply-To: <20060428134632.GA4526@infradead.org>

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

On Friday 28 April 2006 15:46, you wrote:
> On Fri, Apr 28, 2006 at 03:42:29PM +0200, Michael Buesch wrote:
> > I guess you are confusing something here:
> > MMIO access versus values in structs (for example) that 
> > are accessed through DMA (for example).
> 
> so there's two general problems:
> 
>   mmio/pio   - linux expects the device to be le there by defalt and
>                {read,write}{b,s,l} do the switch automatically
>   dmaed data - you always need to switch data yourself, data is commonly
>   	       either be or le
> 
> now there's devices that are always be for mmio or can be switched to it
> during initialization.  For Linux you'd traditionally have to switch before
> calling {read,write}{b,s,l} or use the __raw_ version that have other issues.
> The ioread*/iowrite* APIs now have a BE version, too.
> 
> I've not heard about devices having this switch for dma payload, and it
> would be rather usual as large parts of it are determined by some on the
> wire protocol anyway.

bcm43xx has a switch for this in PIO mode.
But we are currently not using it, because it is a little
bit tricky to get right and I did not want to do such experiments
before 2.6.17.

-- 
Greetings Michael.

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

^ permalink raw reply

* Re: [PATCH 20/32] rt2x00: byte ordering correctness
From: Christoph Hellwig @ 2006-04-28 13:46 UTC (permalink / raw)
  To: Michael Buesch; +Cc: Ivo van Doorn, netdev, rt2x00-devel
In-Reply-To: <200604281542.29534.mb@bu3sch.de>

On Fri, Apr 28, 2006 at 03:42:29PM +0200, Michael Buesch wrote:
> I guess you are confusing something here:
> MMIO access versus values in structs (for example) that 
> are accessed through DMA (for example).

so there's two general problems:

  mmio/pio   - linux expects the device to be le there by defalt and
               {read,write}{b,s,l} do the switch automatically
  dmaed data - you always need to switch data yourself, data is commonly
  	       either be or le

now there's devices that are always be for mmio or can be switched to it
during initialization.  For Linux you'd traditionally have to switch before
calling {read,write}{b,s,l} or use the __raw_ version that have other issues.
The ioread*/iowrite* APIs now have a BE version, too.

I've not heard about devices having this switch for dma payload, and it
would be rather usual as large parts of it are determined by some on the
wire protocol anyway.

> 
> -- 
> Greetings Michael.


---end quoted text---

^ permalink raw reply

* Re: [PATCH 20/32] rt2x00: byte ordering correctness
From: Ivo van Doorn @ 2006-04-28 13:45 UTC (permalink / raw)
  To: Michael Buesch; +Cc: netdev, rt2x00-devel, Christoph Hellwig
In-Reply-To: <200604281542.29534.mb@bu3sch.de>

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

On Friday 28 April 2006 15:42, Michael Buesch wrote:
> On Friday 28 April 2006 15:31, you wrote:
> > On Friday 28 April 2006 15:14, Christoph Hellwig wrote:
> > > On Fri, Apr 28, 2006 at 02:59:23PM +0200, Ivo van Doorn wrote:
> > > > I am not sure if that would be a wise idea,
> > > > there is no byte ordering done in rt2500usb except for the EEPROM
> > > > contents which is little endian.
> > > > So when the module is used on a normal x86 platform, there won't be
> > > > any big endian structures or fields.
> > > 
> > > Well, then you'll need __le* annotation and the le*_to_cpu/cpu_to_le*
> > > instead.  Any new driver should be endian clean.
> > 
> > Not exactly true for rt2570, to correctly operate with the device, no
> > endian conversions should be made at all. Not to big endian and not
> > to little endian. The register should be send as a regular value with the
> > byteordering equal to the byteordering of the currently used CPU.
> > It has been tested to send only little endian or big endian values to
> > the device on all CPU's, and in all cases it meant that the device would not function on
> > CPU's with the other byte ordering.
> 
> I guess you are confusing something here:
> MMIO access versus values in structs (for example) that 
> are accessed through DMA (for example).

Ah ok. I was indeed missing that point.
In that case you are right, there could be some places where
the __le* annotation could be used.
I'll create a quick patch to do that.

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

^ permalink raw reply

* Re: [PATCH 29/32] rt2x00: dscape compatibilitiy
From: Ivo van Doorn @ 2006-04-28 13:43 UTC (permalink / raw)
  To: Jiri Benc; +Cc: netdev, rt2x00-devel
In-Reply-To: <20060428131237.49dbe6a1@griffin.suse.cz>

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

On Friday 28 April 2006 13:12, Jiri Benc wrote:
> On Fri, 28 Apr 2006 00:03:19 +0200, Ivo van Doorn wrote:
> > Latest dscape patches have broken rt2x00,
> > fix compile issues, and support the new features.
> 
> > @@ -2466,6 +2568,7 @@ rt2500pci_init_hw(struct rt2x00_pci *rt2
> >  	hw->no_tkip_wmm_hwaccel = 1;
> >  	hw->extra_hdr_room = 0;
> >  	hw->device_strips_mic = 0;
> > +	hw->monitor_during_oper = 1;
> 
> You should not set this to 1 if you support only one interface at a
> time. Please add support for concurrent running of one regular (i.e.
> STA, IBSS, AP, WDS) interface plus arbitrary number of monitor
> interfaces or set monitor_during_oper to 0.
> 
> (Yes, I know, I definitely must reserve some time to write a
> documentation about monitor mode support.)

My fault, this was a leftover from my initial patch for the dscape update.
I actually had written some code to indeed allow multiple monitor
mode interfaces. But I spotted some problems with it, and removed the code
and planned to rewrite it later after I had send this code series.
I'll create a quick patch to correctly set the monitor_during_oper variable,
because the patch for correct monitor mode behaviour might take some time.

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

^ permalink raw reply

* Re: [PATCH 17/32] rt2x00: Put net_device structure in data_ring
From: Ivo van Doorn @ 2006-04-28 13:41 UTC (permalink / raw)
  To: Ingo Oeser; +Cc: netdev, rt2x00-devel
In-Reply-To: <200604281345.22006.netdev@axxeo.de>

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

On Friday 28 April 2006 13:45, Ingo Oeser wrote:
> Hi Ivo,
> 
> Ivo van Doorn wrote:
> > diff -uprN wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2400pci.c wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2400pci.c
> > --- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2400pci.c	2006-04-27 21:48:21.000000000 +0200
> > +++ wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2400pci.c	2006-04-27 21:49:08.000000000 +0200
> > @@ -760,10 +760,8 @@ rt2400pci_write_tx_desc(
> >  static void
> >  rt2400pci_beacondone(void *data)
> >  {
> > -	struct data_ring	*ring = (struct data_ring*)data;
> > -	struct rt2x00_pci	*rt2x00pci = (struct rt2x00_pci*)ring->dev;
> > -	struct net_device	*net_dev = pci_get_drvdata(rt2x00pci->pci_dev);
> > -	struct sk_buff		*skb;
> > +	struct data_ring		*ring = (struct data_ring*)data;
> 
> No need for a cast here. 
> In C you can cast from any struct pointer to void pointer and back
> without problems.
> 
> > @@ -784,8 +782,8 @@ static void
> >  rt2400pci_rxdone(void *data)
> >  {
> >  	struct data_ring	*ring = (struct data_ring*)data;
> 
> No need for casting.
> 
> > @@ -835,8 +834,8 @@ static void
> >  rt2400pci_txdone(void *data)
> >  {
> >  	struct data_ring	*ring = (struct data_ring*)data;
> 
> No need for casting.
> 
> > diff -uprN wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500pci.c wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500pci.c
> > --- wireless-dev-rt2x00/drivers/net/wireless/d80211/rt2x00/rt2500pci.c	2006-04-27 21:48:21.000000000 +0200
> > +++ wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500pci.c	2006-04-27 21:49:08.000000000 +0200
> > @@ -834,10 +834,8 @@ rt2500pci_write_tx_desc(
> >  static void
> >  rt2500pci_beacondone(void *data)
> >  {
> > -	struct data_ring	*ring = (struct data_ring*)data;
> > -	struct rt2x00_pci	*rt2x00pci = (struct rt2x00_pci*)ring->dev;
> > -	struct net_device	*net_dev = pci_get_drvdata(rt2x00pci->pci_dev);
> > -	struct sk_buff		*skb;
> > +	struct data_ring		*ring = (struct data_ring*)data;
> 
> No need for casting.
> 
> Many more of them.
> 
> I guess you could just do a fgrep for "*ring = (struct data_ring*)data;"

Thanks,

Not only the data_ring has unneeded casts, but they are also found on some other locations.
I'll create a patch that removes them all. 

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

^ permalink raw reply

* Re: [PATCH 7/32] rt2x00: make vals static
From: Ivo van Doorn @ 2006-04-28 13:40 UTC (permalink / raw)
  To: Ingo Oeser; +Cc: netdev, rt2x00-devel
In-Reply-To: <200604281326.43769.netdev@axxeo.de>

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

On Friday 28 April 2006 13:26, Ingo Oeser wrote:
> Sie schrieben:
> > From: Ivo van Doorn <IvDoorn@gmail.com>
> > 
> > The vals[] arrays in *_init_hw_channels can be made
> > static to optimize memory and reduce stack size.
> 
> What about static const? They are also constants, right?
> But please try first, if this helps in terms of code size.

Good idea, I'll create a patch to make them constant as well.

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

^ permalink raw reply

* Re: [PATCH 3/32] rt2x00: use pci_*_consistent for DMA mapping
From: Ivo van Doorn @ 2006-04-28 13:39 UTC (permalink / raw)
  To: Michael Buesch; +Cc: Christoph Hellwig, netdev, rt2x00-devel
In-Reply-To: <200604281533.57372.mb@bu3sch.de>

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

On Friday 28 April 2006 15:33, Michael Buesch wrote:
> On Friday 28 April 2006 15:24, you wrote:
> > struct data_ring{
> > 	/*
> > 	 * net_device where this ring belongs to.
> > 	 */
> > 	struct net_device			*net_dev;
> > 
> > 	/*
> > 	 * Work structure for bottom half interrupt handling.
> > 	 */
> > 	struct work_struct			irq_work;
> > 
> > 	/*
> > 	 * Base address for the device specific data entries.
> > 	 */
> > 	void					*entry;
> > 
> > 	/*
> > 	 * TX queue statistic info.
> > 	 */
> > 	struct ieee80211_tx_queue_stats_data	stats;
> > 
> > 	/*
> > 	 * TX Queue parameters.
> > 	 */
> > 	struct ieee80211_tx_queue_params	tx_params;
> > 
> > 	/*
> > 	 * Base address for data ring.
> > 	 */
> > 	dma_addr_t				data_dma;
> > 	void					*data_addr;
> > 
> > 	/*
> > 	 * Index variables.
> > 	 */
> > 	u8					index;
> > 	u8					index_done;
> > 
> > 	/*
> > 	 * Size of device specific data entry structure.
> > 	 */
> > 	u16					entry_size;
> > 
> > 	/*
> > 	 * Size of packet and descriptor in bytes.
> > 	 */
> > 	u16					data_size;
> > 	u16					desc_size;
> > } __attribute__ ((packed));
> 
> Why is this packed? I don't believe you write such a data
> structure (which contains dscape specific structs) to some
> device registers.

I can't remember actually, I believe this came from a patch we had received
last year with the legacy drivers from a user. 
Since then most structures have received the __attribute__ ((packed)) tag.
I'll create a patch to remove the tags where they are not needed.

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

^ permalink raw reply

* Re: [PATCH 20/32] rt2x00: byte ordering correctness
From: Michael Buesch @ 2006-04-28 13:42 UTC (permalink / raw)
  To: Ivo van Doorn; +Cc: netdev, rt2x00-devel, Christoph Hellwig
In-Reply-To: <200604281531.06896.IvDoorn@gmail.com>

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

On Friday 28 April 2006 15:31, you wrote:
> On Friday 28 April 2006 15:14, Christoph Hellwig wrote:
> > On Fri, Apr 28, 2006 at 02:59:23PM +0200, Ivo van Doorn wrote:
> > > I am not sure if that would be a wise idea,
> > > there is no byte ordering done in rt2500usb except for the EEPROM
> > > contents which is little endian.
> > > So when the module is used on a normal x86 platform, there won't be
> > > any big endian structures or fields.
> > 
> > Well, then you'll need __le* annotation and the le*_to_cpu/cpu_to_le*
> > instead.  Any new driver should be endian clean.
> 
> Not exactly true for rt2570, to correctly operate with the device, no
> endian conversions should be made at all. Not to big endian and not
> to little endian. The register should be send as a regular value with the
> byteordering equal to the byteordering of the currently used CPU.
> It has been tested to send only little endian or big endian values to
> the device on all CPU's, and in all cases it meant that the device would not function on
> CPU's with the other byte ordering.

I guess you are confusing something here:
MMIO access versus values in structs (for example) that 
are accessed through DMA (for example).

-- 
Greetings Michael.

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

^ permalink raw reply

* Re: [PATCH 20/32] rt2x00: byte ordering correctness
From: Ivo van Doorn @ 2006-04-28 13:31 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: netdev, rt2x00-devel
In-Reply-To: <20060428131430.GA3288@infradead.org>

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

On Friday 28 April 2006 15:14, Christoph Hellwig wrote:
> On Fri, Apr 28, 2006 at 02:59:23PM +0200, Ivo van Doorn wrote:
> > I am not sure if that would be a wise idea,
> > there is no byte ordering done in rt2500usb except for the EEPROM
> > contents which is little endian.
> > So when the module is used on a normal x86 platform, there won't be
> > any big endian structures or fields.
> 
> Well, then you'll need __le* annotation and the le*_to_cpu/cpu_to_le*
> instead.  Any new driver should be endian clean.

Not exactly true for rt2570, to correctly operate with the device, no
endian conversions should be made at all. Not to big endian and not
to little endian. The register should be send as a regular value with the
byteordering equal to the byteordering of the currently used CPU.
It has been tested to send only little endian or big endian values to
the device on all CPU's, and in all cases it meant that the device would not function on
CPU's with the other byte ordering.

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

^ permalink raw reply

* Re: [PATCH 3/32] rt2x00: use pci_*_consistent for DMA mapping
From: Michael Buesch @ 2006-04-28 13:33 UTC (permalink / raw)
  To: Ivo van Doorn; +Cc: Christoph Hellwig, netdev, rt2x00-devel
In-Reply-To: <200604281524.11670.IvDoorn@gmail.com>

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

On Friday 28 April 2006 15:24, you wrote:
> struct data_ring{
> 	/*
> 	 * net_device where this ring belongs to.
> 	 */
> 	struct net_device			*net_dev;
> 
> 	/*
> 	 * Work structure for bottom half interrupt handling.
> 	 */
> 	struct work_struct			irq_work;
> 
> 	/*
> 	 * Base address for the device specific data entries.
> 	 */
> 	void					*entry;
> 
> 	/*
> 	 * TX queue statistic info.
> 	 */
> 	struct ieee80211_tx_queue_stats_data	stats;
> 
> 	/*
> 	 * TX Queue parameters.
> 	 */
> 	struct ieee80211_tx_queue_params	tx_params;
> 
> 	/*
> 	 * Base address for data ring.
> 	 */
> 	dma_addr_t				data_dma;
> 	void					*data_addr;
> 
> 	/*
> 	 * Index variables.
> 	 */
> 	u8					index;
> 	u8					index_done;
> 
> 	/*
> 	 * Size of device specific data entry structure.
> 	 */
> 	u16					entry_size;
> 
> 	/*
> 	 * Size of packet and descriptor in bytes.
> 	 */
> 	u16					data_size;
> 	u16					desc_size;
> } __attribute__ ((packed));

Why is this packed? I don't believe you write such a data
structure (which contains dscape specific structs) to some
device registers.

-- 
Greetings Michael.

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

^ permalink raw reply

* Re: [patch 3/9] natsemi: Add support for using MII port with no PHY
From: Mark Brown @ 2006-04-28 13:01 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: akpm, netdev, jgarzik, thockin
In-Reply-To: <445094F2.1060807@garzik.org>

On Thu, Apr 27, 2006 at 05:54:58AM -0400, Jeff Garzik wrote:

> >Provide a module option which configures the natsemi driver to use the
> >external MII port on the chip but ignore any PHYs that may be attached to 
> >it. The link state will be left as it was when the driver started and can 

> The proper way to do this is via the force_media boolean flag found in 
> several net drivers.

I've had a look at several of the net drivers that implement this option
(e100, smc91x, starfire and the shared code in mii.c).  Unless I'm
misreading the code it looks like the effect of this option in those
drivers is to disable autonegotiation but still configure the PHY when
the NIC is configured.

That is a subset of what the patch does and isn't sufficient for the
hardware this patch targets: sometimes there may be a PHY visible on the
MII bus but with a different configuration to the natsemi or there may
be no PHY present at all.  In this case the code in the natsemi driver
that configures the PHY to match the configuration of the natsemi also
needs to be disabled.

It looks like I should implement a force_media option and redo this
patch to use that.

-- 
"You grabbed my hand and we fell into it, like a daydream - or a fever."

^ permalink raw reply

* Re: [PATCH 3/32] rt2x00: use pci_*_consistent for DMA mapping
From: Ivo van Doorn @ 2006-04-28 13:24 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: netdev, rt2x00-devel
In-Reply-To: <20060428131533.GB3288@infradead.org>

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

On Friday 28 April 2006 15:15, Christoph Hellwig wrote:
> On Fri, Apr 28, 2006 at 02:57:31PM +0200, Ivo van Doorn wrote:
> > On Friday 28 April 2006 00:11, Christoph Hellwig wrote:
> > > On Fri, Apr 28, 2006 at 12:02:52AM +0200, Ivo van Doorn wrote:
> > > > From: Ivo van Doorn <IvDoorn@gmail.com>
> > > > 
> > > > Instead of dma_*_coherent
> > > > use pci_*consistent functions.
> > > 
> > > No point in doing that, quite reverse as you use the gfp_mask argument
> > > which is a (small) pessimation here.
> > 
> > Would it be recommended that I replace the usb_alloc_buffers in the
> > rt2570 driver with dma_*coherent?
> > This would get the dma rings allocation and freeing a bit more generic
> > between PCI and USB and could reduce some duplicate code between them.
> > But I am not sure if there is any major difference between the two.
> 
> I don't have the full code for your driver anywhere near me so I can't
> comment on this.  Maybe you could send the code of 'usb_alloc_buffers'
> for comments?

Below is the function of the rt2500usb_alloc_ring, it works very similar
to the pci equivalent, except that urbs are allocated and usb_buffer_alloc is used.
The data_ring structure where the information is stored in is also the same as
used in the pci driver.

Basicly what I want to do is move the urbs to somewhere else,
the data_ring structure has been very generic, and the only real difference
between the pci and usb version of the data_entry has been the urb structure pointer.
If the usb_buffer_* calls could be replaced by dma_*coherent a lot
of duplicate code in the pci and usb drivers could be moved into
a seperate header or source file.

struct data_ring{
	/*
	 * net_device where this ring belongs to.
	 */
	struct net_device			*net_dev;

	/*
	 * Work structure for bottom half interrupt handling.
	 */
	struct work_struct			irq_work;

	/*
	 * Base address for the device specific data entries.
	 */
	void					*entry;

	/*
	 * TX queue statistic info.
	 */
	struct ieee80211_tx_queue_stats_data	stats;

	/*
	 * TX Queue parameters.
	 */
	struct ieee80211_tx_queue_params	tx_params;

	/*
	 * Base address for data ring.
	 */
	dma_addr_t				data_dma;
	void					*data_addr;

	/*
	 * Index variables.
	 */
	u8					index;
	u8					index_done;

	/*
	 * Size of device specific data entry structure.
	 */
	u16					entry_size;

	/*
	 * Size of packet and descriptor in bytes.
	 */
	u16					data_size;
	u16					desc_size;
} __attribute__ ((packed));

static int
rt2500usb_alloc_ring(
	struct rt2x00_usb *rt2x00usb,
	struct data_ring *ring,
	void (*handler)(void *),
	const u16 max_entries,
	const u16 data_size,
	const u16 desc_size)
{
	struct data_entry	*entry;
	u8			counter;
	int			status;

	/*
	 *Set device structure.
	 */
	ring->net_dev = usb_get_intfdata(rt2x00usb->usb_intf);

	/*
	 * Initialize work structure for deferred work.
	 */
	INIT_WORK(&ring->irq_work, handler, ring);

	/*
	 * Initialize ring parameters.
	 */
	ring->tx_params.aifs = 2;
	ring->tx_params.cw_min = 5;	/* cw_min: 2^5 = 32. */
	ring->tx_params.cw_max = 10;	/* cw_max: 2^10 = 1024. */

	rt2x00_ring_index_clear(ring);

	ring->stats.limit = max_entries;
	ring->entry_size = sizeof(struct data_entry);
	ring->data_size = data_size;
	ring->desc_size = desc_size;

	/*
	 * Allocate all ring entries.
	 */
	ring->entry = kmalloc(ring->stats.limit * ring->entry_size,
		GFP_KERNEL);
	if (!ring->entry)
		return -ENOMEM;

	/*
	 * Allocate DMA memory for descriptor and buffer.
	 */
	ring->data_addr = usb_buffer_alloc(
		interface_to_usbdev(rt2x00usb->usb_intf),
		rt2x00_get_ring_size(ring), GFP_KERNEL, &ring->data_dma);
	if (!ring->data_addr) {
		kfree(ring->entry);
		return -ENOMEM;
	}

	/*
	 * Initialize all ring entries to contain valid
	 * addresses.
	 */
	status = 0;
	entry = ring->entry;
	for (counter = 0; counter < ring->stats.limit; counter++) {
		entry[counter].ring = ring;
		if (!status)
			entry[counter].urb = usb_alloc_urb(0, GFP_KERNEL);
		else
			entry[counter].urb = NULL;
		if (!entry[counter].urb)
			status = -ENOMEM;
		entry[counter].skb = NULL;
		entry[counter].data_addr = ring->data_addr
			+ (counter * ring->desc_size)
			+ (counter * ring->data_size);
		entry[counter].data_dma = ring->data_dma
			+ (counter * ring->desc_size)
			+ (counter * ring->data_size);
	}

	return status;
}

static void
rt2500usb_free_ring(struct rt2x00_usb *rt2x00usb, struct data_ring *ring)
{
	struct	data_entry	*entry;
	u8			counter;

	if (!ring->entry)
		goto exit;

	entry = ring->entry;
	for (counter = 0; counter < ring->stats.limit; counter++) {
		usb_kill_urb(entry[counter].urb);
		usb_free_urb(entry[counter].urb);
	}

	kfree(ring->entry);
	ring->entry = NULL;

exit:
	if (ring->data_addr)
		usb_buffer_free(
			interface_to_usbdev(rt2x00usb->usb_intf),
			rt2x00_get_ring_size(ring), ring->data_addr,
			ring->data_dma);
	ring->data_addr = NULL;
}

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

^ permalink raw reply

* Re: [PATCH 3/32] rt2x00: use pci_*_consistent for DMA mapping
From: Christoph Hellwig @ 2006-04-28 13:15 UTC (permalink / raw)
  To: Ivo van Doorn; +Cc: Christoph Hellwig, netdev, rt2x00-devel
In-Reply-To: <200604281457.35460.IvDoorn@gmail.com>

On Fri, Apr 28, 2006 at 02:57:31PM +0200, Ivo van Doorn wrote:
> On Friday 28 April 2006 00:11, Christoph Hellwig wrote:
> > On Fri, Apr 28, 2006 at 12:02:52AM +0200, Ivo van Doorn wrote:
> > > From: Ivo van Doorn <IvDoorn@gmail.com>
> > > 
> > > Instead of dma_*_coherent
> > > use pci_*consistent functions.
> > 
> > No point in doing that, quite reverse as you use the gfp_mask argument
> > which is a (small) pessimation here.
> 
> Would it be recommended that I replace the usb_alloc_buffers in the
> rt2570 driver with dma_*coherent?
> This would get the dma rings allocation and freeing a bit more generic
> between PCI and USB and could reduce some duplicate code between them.
> But I am not sure if there is any major difference between the two.

I don't have the full code for your driver anywhere near me so I can't
comment on this.  Maybe you could send the code of 'usb_alloc_buffers'
for comments?



---end quoted text---

^ permalink raw reply

* Re: [PATCH 20/32] rt2x00: byte ordering correctness
From: Christoph Hellwig @ 2006-04-28 13:14 UTC (permalink / raw)
  To: Ivo van Doorn; +Cc: Christoph Hellwig, netdev, rt2x00-devel
In-Reply-To: <200604281459.24186.IvDoorn@gmail.com>

On Fri, Apr 28, 2006 at 02:59:23PM +0200, Ivo van Doorn wrote:
> I am not sure if that would be a wise idea,
> there is no byte ordering done in rt2500usb except for the EEPROM
> contents which is little endian.
> So when the module is used on a normal x86 platform, there won't be
> any big endian structures or fields.

Well, then you'll need __le* annotation and the le*_to_cpu/cpu_to_le*
instead.  Any new driver should be endian clean.


^ permalink raw reply

* Re: [PATCH 20/32] rt2x00: byte ordering correctness
From: Ivo van Doorn @ 2006-04-28 12:59 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: netdev, rt2x00-devel
In-Reply-To: <20060427221321.GB22135@infradead.org>

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

On Friday 28 April 2006 00:13, Christoph Hellwig wrote:
> On Fri, Apr 28, 2006 at 12:03:12AM +0200, Ivo van Doorn wrote:
> > From: Ivo van Doorn <IvDoorn@gmail.com>
> > 
> > Fix various little/big endian conversions.
> > rt2500pci should use cpu_to_le32 and rt2500usb should not.
> 
> While you're at it can you add __be* annotations to the hardware
> datastructures so the endianess handling can be verified using sparse?

I am not sure if that would be a wise idea,
there is no byte ordering done in rt2500usb except for the EEPROM
contents which is little endian.
So when the module is used on a normal x86 platform, there won't be
any big endian structures or fields.

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

^ permalink raw reply

* Re: [PATCH 3/32] rt2x00: use pci_*_consistent for DMA mapping
From: Ivo van Doorn @ 2006-04-28 12:57 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: netdev, rt2x00-devel
In-Reply-To: <20060427221127.GA22135@infradead.org>

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

On Friday 28 April 2006 00:11, Christoph Hellwig wrote:
> On Fri, Apr 28, 2006 at 12:02:52AM +0200, Ivo van Doorn wrote:
> > From: Ivo van Doorn <IvDoorn@gmail.com>
> > 
> > Instead of dma_*_coherent
> > use pci_*consistent functions.
> 
> No point in doing that, quite reverse as you use the gfp_mask argument
> which is a (small) pessimation here.

Would it be recommended that I replace the usb_alloc_buffers in the
rt2570 driver with dma_*coherent?
This would get the dma rings allocation and freeing a bit more generic
between PCI and USB and could reduce some duplicate code between them.
But I am not sure if there is any major difference between the two.

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

^ permalink raw reply

* Re: IP1000 gigabit nic driver
From: Ingo Oeser @ 2006-04-28 11:59 UTC (permalink / raw)
  To: David Gómez
  Cc: Pekka Enberg, David Vrabel, Francois Romieu, Linux-kernel, netdev
In-Reply-To: <20060428113755.GA7419@fargo>

Hi David,

David Gómez wrote:
> On Apr 28 at 01:58:04, Pekka Enberg wrote:
> > Needs some serious coding style cleanup and conversion to proper 2.6
> > APIs for starters.
> 
> Ok, i could take care of that, and it's a good way of getting my hands
> dirty with kernel programming ;). David, if it's ok to you i'll do the
> cleanup thing.

Have fun! Great that you do this.
 
> What about 2.4/2.2 code? It's supposed to stay for compatibility
> or it should be removed before submitting?

Usually it should be removed.

The way to remove 2.4/2.2. code is by reimplementation
of 2.6-APIs in seperate files and headers and not submitting
these into latest kernel. Keep these somewhere else 
(e.g. a project web site).

That way your drivers ALWAYS work with latest kernels
and you notice breakage of backward compatiblity quite easily.
If maintaining these parts becomes a pain with no gain, 
you can simply stop providing these yourself.

"#ifdef KERNEL_VERSON" stuff in submitted drivers
is generally not acceptable. Since it is hard to test these parts.

I ported some off-tree drivers from 2.2 to 2.4. using this technique
and it works good, reduces maintainence burden and keeps
your driver current to latest APIs automatically.


Regards

Ingo Oeser

^ 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