netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 6/6] rt2x00 update: Apply correct error handling to dscape stack
@ 2006-04-28 14:52 Ivo van Doorn
  0 siblings, 0 replies; only message in thread
From: Ivo van Doorn @ 2006-04-28 14:52 UTC (permalink / raw)
  To: netdev; +Cc: rt2x00-devel

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

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

Return correct error code at failure, and
request debug report when the function _tx()
has received an invalid queue.

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:32:12.000000000 +0200
+++ wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2400pci.c	2006-04-28 16:34:55.000000000 +0200
@@ -1538,20 +1538,21 @@ rt2400pci_tx(struct net_device *net_dev,
 	 */
 	ring = rt2x00pci_get_ring(rt2x00pci, control->queue);
 	if (unlikely(!ring)) {
-		ERROR("Attempt to send packet over invalid queue %d.\n",
-			control->queue);
-		return NET_RX_DROP;
+		ERROR("Attempt to send packet over invalid queue %d.\n"
+			"Please file bug report to %s.\n",
+			control->queue, DRV_PROJECT);
+		return NET_XMIT_DROP;
 	}
 
 	if (rt2x00_ring_full(ring))
-		return NET_RX_DROP;
+		return NET_XMIT_DROP;
 
 	entry = rt2x00_get_data_entry(ring);
 	txd = entry->desc_addr;
 
 	if (rt2x00_get_field32(txd->word0, TXD_W0_OWNER_NIC)
 	|| rt2x00_get_field32(txd->word0, TXD_W0_VALID))
-		return NET_RX_DROP;
+		return NET_XMIT_DROP;
 
 	memcpy(entry->data_addr, skb->data, skb->len);
 	rt2400pci_write_tx_desc(rt2x00pci, txd, skb, control);
@@ -2032,7 +2033,7 @@ rt2400pci_conf_tx(struct net_device *net
 	 */
 	if (queue != IEEE80211_TX_QUEUE_DATA0) {
 		NOTICE("Ignoring configuration for queue %d.\n", queue);
-		return 0;
+		return -EINVAL;
 	}
 
 	memcpy(&ring->tx_params, params, sizeof(*params));
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:32:31.000000000 +0200
+++ wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500pci.c	2006-04-28 16:34:54.000000000 +0200
@@ -1661,20 +1661,21 @@ rt2500pci_tx(struct net_device *net_dev,
 	 */
 	ring = rt2x00pci_get_ring(rt2x00pci, control->queue);
 	if (unlikely(!ring)) {
-		ERROR("Attempt to send packet over invalid queue %d.\n",
-			control->queue);
-		return NET_RX_DROP;
+		ERROR("Attempt to send packet over invalid queue %d.\n"
+			"Please file bug report to %s.\n",
+			control->queue, DRV_PROJECT);
+		return NET_XMIT_DROP;
 	}
 
 	if (rt2x00_ring_full(ring))
-		return NET_RX_DROP;
+		return NET_XMIT_DROP;
 
 	entry = rt2x00_get_data_entry(ring);
 	txd = entry->desc_addr;
 
 	if (rt2x00_get_field32(txd->word0, TXD_W0_OWNER_NIC)
 	|| rt2x00_get_field32(txd->word0, TXD_W0_VALID))
-		return NET_RX_DROP;
+		return NET_XMIT_DROP;
 
 	memcpy(entry->data_addr, skb->data, skb->len);
 	rt2500pci_write_tx_desc(rt2x00pci, txd, skb, control);
@@ -2147,7 +2148,7 @@ rt2500pci_conf_tx(struct net_device *net
 	ring = rt2x00pci_get_ring(rt2x00pci, queue);
 	if (unlikely(!ring)) {
 		NOTICE("Ignoring configuration for queue %d.\n", queue);
-		return 0;
+		return -EINVAL;
 	}
 
 	memcpy(&ring->tx_params, params, sizeof(*params));
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:32:06.000000000 +0200
+++ wireless-dev-rt2x00-patch/drivers/net/wireless/d80211/rt2x00/rt2500usb.c	2006-04-28 16:34:56.000000000 +0200
@@ -1373,13 +1373,14 @@ rt2500usb_tx(struct net_device *net_dev,
 	 */
 	ring = rt2x00usb_get_ring(rt2x00usb, control->queue);
 	if (unlikely(!ring)) {
-		ERROR("Attempt to send packet over invalid queue %d.\n",
-			control->queue);
-		return NET_RX_DROP;
+		ERROR("Attempt to send packet over invalid queue %d.\n"
+			"Please file bug report to %s.\n",
+			control->queue, DRV_PROJECT);
+		return NET_XMIT_DROP;
 	}
 
 	if (rt2x00_ring_full(ring))
-		return NET_RX_DROP;
+		return NET_XMIT_DROP;
 
 	entry = rt2x00_get_data_entry(ring);
 	txd = rt2x00usb_txdesc_addr(entry);
@@ -1797,7 +1798,7 @@ rt2500usb_conf_tx(struct net_device *net
 	ring = rt2x00usb_get_ring(rt2x00usb, queue);
 	if (unlikely(!ring)) {
 		NOTICE("Ignoring configuration for queue %d.\n", queue);
-		return 0;
+		return -EINVAL;
 	}
 
 	memcpy(&ring->tx_params, params, sizeof(*params));

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-04-28 14:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-28 14:52 [PATCH 6/6] rt2x00 update: Apply correct error handling to dscape stack Ivo van Doorn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).