diff options
Diffstat (limited to 'drivers/net/wireless/rt2x00')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2800lib.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00.h | 6 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00dev.c | 12 | ||||
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00queue.c | 6 |
4 files changed, 21 insertions, 5 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c index 27bf887f1453..9deae41cb784 100644 --- a/drivers/net/wireless/rt2x00/rt2800lib.c +++ b/drivers/net/wireless/rt2x00/rt2800lib.c | |||
@@ -340,7 +340,7 @@ static int rt2800_blink_set(struct led_classdev *led_cdev, | |||
340 | rt2x00_set_field32(®, LED_CFG_OFF_PERIOD, *delay_off); | 340 | rt2x00_set_field32(®, LED_CFG_OFF_PERIOD, *delay_off); |
341 | rt2x00_set_field32(®, LED_CFG_SLOW_BLINK_PERIOD, 3); | 341 | rt2x00_set_field32(®, LED_CFG_SLOW_BLINK_PERIOD, 3); |
342 | rt2x00_set_field32(®, LED_CFG_R_LED_MODE, 3); | 342 | rt2x00_set_field32(®, LED_CFG_R_LED_MODE, 3); |
343 | rt2x00_set_field32(®, LED_CFG_G_LED_MODE, 12); | 343 | rt2x00_set_field32(®, LED_CFG_G_LED_MODE, 3); |
344 | rt2x00_set_field32(®, LED_CFG_Y_LED_MODE, 3); | 344 | rt2x00_set_field32(®, LED_CFG_Y_LED_MODE, 3); |
345 | rt2x00_set_field32(®, LED_CFG_LED_POLAR, 1); | 345 | rt2x00_set_field32(®, LED_CFG_LED_POLAR, 1); |
346 | rt2800_register_write(led->rt2x00dev, LED_CFG, reg); | 346 | rt2800_register_write(led->rt2x00dev, LED_CFG, reg); |
diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h index 4d841c07c970..dcfc8c25d1a7 100644 --- a/drivers/net/wireless/rt2x00/rt2x00.h +++ b/drivers/net/wireless/rt2x00/rt2x00.h | |||
@@ -113,6 +113,12 @@ | |||
113 | ( ((unsigned long)((__skb)->data + (__header))) & 3 ) | 113 | ( ((unsigned long)((__skb)->data + (__header))) & 3 ) |
114 | 114 | ||
115 | /* | 115 | /* |
116 | * Constants for extra TX headroom for alignment purposes. | ||
117 | */ | ||
118 | #define RT2X00_ALIGN_SIZE 4 /* Only whole frame needs alignment */ | ||
119 | #define RT2X00_L2PAD_SIZE 8 /* Both header & payload need alignment */ | ||
120 | |||
121 | /* | ||
116 | * Standard timing and size defines. | 122 | * Standard timing and size defines. |
117 | * These values should follow the ieee80211 specifications. | 123 | * These values should follow the ieee80211 specifications. |
118 | */ | 124 | */ |
diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c index 06c43ca39bf8..265e66dba552 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c | |||
@@ -686,7 +686,17 @@ static int rt2x00lib_probe_hw(struct rt2x00_dev *rt2x00dev) | |||
686 | /* | 686 | /* |
687 | * Initialize extra TX headroom required. | 687 | * Initialize extra TX headroom required. |
688 | */ | 688 | */ |
689 | rt2x00dev->hw->extra_tx_headroom = rt2x00dev->ops->extra_tx_headroom; | 689 | rt2x00dev->hw->extra_tx_headroom = |
690 | max_t(unsigned int, IEEE80211_TX_STATUS_HEADROOM, | ||
691 | rt2x00dev->ops->extra_tx_headroom); | ||
692 | |||
693 | /* | ||
694 | * Take TX headroom required for alignment into account. | ||
695 | */ | ||
696 | if (test_bit(DRIVER_REQUIRE_L2PAD, &rt2x00dev->flags)) | ||
697 | rt2x00dev->hw->extra_tx_headroom += RT2X00_L2PAD_SIZE; | ||
698 | else if (test_bit(DRIVER_REQUIRE_DMA, &rt2x00dev->flags)) | ||
699 | rt2x00dev->hw->extra_tx_headroom += RT2X00_ALIGN_SIZE; | ||
690 | 700 | ||
691 | /* | 701 | /* |
692 | * Register HW. | 702 | * Register HW. |
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c index 239afc7a9c0b..9915a09141ef 100644 --- a/drivers/net/wireless/rt2x00/rt2x00queue.c +++ b/drivers/net/wireless/rt2x00/rt2x00queue.c | |||
@@ -104,7 +104,7 @@ void rt2x00queue_map_txskb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb) | |||
104 | * is also mapped to the DMA so it can be used for transfering | 104 | * is also mapped to the DMA so it can be used for transfering |
105 | * additional descriptor information to the hardware. | 105 | * additional descriptor information to the hardware. |
106 | */ | 106 | */ |
107 | skb_push(skb, rt2x00dev->hw->extra_tx_headroom); | 107 | skb_push(skb, rt2x00dev->ops->extra_tx_headroom); |
108 | 108 | ||
109 | skbdesc->skb_dma = | 109 | skbdesc->skb_dma = |
110 | dma_map_single(rt2x00dev->dev, skb->data, skb->len, DMA_TO_DEVICE); | 110 | dma_map_single(rt2x00dev->dev, skb->data, skb->len, DMA_TO_DEVICE); |
@@ -112,7 +112,7 @@ void rt2x00queue_map_txskb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb) | |||
112 | /* | 112 | /* |
113 | * Restore data pointer to original location again. | 113 | * Restore data pointer to original location again. |
114 | */ | 114 | */ |
115 | skb_pull(skb, rt2x00dev->hw->extra_tx_headroom); | 115 | skb_pull(skb, rt2x00dev->ops->extra_tx_headroom); |
116 | 116 | ||
117 | skbdesc->flags |= SKBDESC_DMA_MAPPED_TX; | 117 | skbdesc->flags |= SKBDESC_DMA_MAPPED_TX; |
118 | } | 118 | } |
@@ -134,7 +134,7 @@ void rt2x00queue_unmap_skb(struct rt2x00_dev *rt2x00dev, struct sk_buff *skb) | |||
134 | * by the driver, but it was actually mapped to DMA. | 134 | * by the driver, but it was actually mapped to DMA. |
135 | */ | 135 | */ |
136 | dma_unmap_single(rt2x00dev->dev, skbdesc->skb_dma, | 136 | dma_unmap_single(rt2x00dev->dev, skbdesc->skb_dma, |
137 | skb->len + rt2x00dev->hw->extra_tx_headroom, | 137 | skb->len + rt2x00dev->ops->extra_tx_headroom, |
138 | DMA_TO_DEVICE); | 138 | DMA_TO_DEVICE); |
139 | skbdesc->flags &= ~SKBDESC_DMA_MAPPED_TX; | 139 | skbdesc->flags &= ~SKBDESC_DMA_MAPPED_TX; |
140 | } | 140 | } |