rt2x00 update: Apply correct error handling to dscape stack
Subsystems (3)
PATCH 6/6 rt2x00 update: Apply correct error handling to dscape stack
From: Ivo van Doorn <[email protected]>
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 <[email protected]>
drivers/net/wireless/d80211/rt2x00/rt2400pci.c +7 -6
@@ -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));
drivers/net/wireless/d80211/rt2x00/rt2500pci.c +7 -6
@@ -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));
drivers/net/wireless/d80211/rt2x00/rt2500usb.c +6 -5
@@ -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));