aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2500pci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2500pci.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2500pci.c55
1 files changed, 49 insertions, 6 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c
index 6a558bf74f11..36c64f751b1d 100644
--- a/drivers/net/wireless/rt2x00/rt2500pci.c
+++ b/drivers/net/wireless/rt2x00/rt2500pci.c
@@ -252,7 +252,7 @@ static void rt2500pci_config_intf(struct rt2x00_dev *rt2x00dev,
252 const unsigned int flags) 252 const unsigned int flags)
253{ 253{
254 struct data_queue *queue = 254 struct data_queue *queue =
255 rt2x00queue_get_queue(rt2x00dev, IEEE80211_TX_QUEUE_BEACON); 255 rt2x00queue_get_queue(rt2x00dev, RT2X00_BCN_QUEUE_BEACON);
256 unsigned int bcn_preload; 256 unsigned int bcn_preload;
257 u32 reg; 257 u32 reg;
258 258
@@ -1195,11 +1195,11 @@ static void rt2500pci_write_tx_desc(struct rt2x00_dev *rt2x00dev,
1195 * TX data initialization 1195 * TX data initialization
1196 */ 1196 */
1197static void rt2500pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev, 1197static void rt2500pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev,
1198 unsigned int queue) 1198 const unsigned int queue)
1199{ 1199{
1200 u32 reg; 1200 u32 reg;
1201 1201
1202 if (queue == IEEE80211_TX_QUEUE_BEACON) { 1202 if (queue == RT2X00_BCN_QUEUE_BEACON) {
1203 rt2x00pci_register_read(rt2x00dev, CSR14, &reg); 1203 rt2x00pci_register_read(rt2x00dev, CSR14, &reg);
1204 if (!rt2x00_get_field32(reg, CSR14_BEACON_GEN)) { 1204 if (!rt2x00_get_field32(reg, CSR14_BEACON_GEN)) {
1205 rt2x00_set_field32(&reg, CSR14_BEACON_GEN, 1); 1205 rt2x00_set_field32(&reg, CSR14_BEACON_GEN, 1);
@@ -1214,7 +1214,7 @@ static void rt2500pci_kick_tx_queue(struct rt2x00_dev *rt2x00dev,
1214 rt2x00_set_field32(&reg, TXCSR0_KICK_TX, 1214 rt2x00_set_field32(&reg, TXCSR0_KICK_TX,
1215 (queue == IEEE80211_TX_QUEUE_DATA1)); 1215 (queue == IEEE80211_TX_QUEUE_DATA1));
1216 rt2x00_set_field32(&reg, TXCSR0_KICK_ATIM, 1216 rt2x00_set_field32(&reg, TXCSR0_KICK_ATIM,
1217 (queue == IEEE80211_TX_QUEUE_AFTER_BEACON)); 1217 (queue == RT2X00_BCN_QUEUE_ATIM));
1218 rt2x00pci_register_write(rt2x00dev, TXCSR0, reg); 1218 rt2x00pci_register_write(rt2x00dev, TXCSR0, reg);
1219} 1219}
1220 1220
@@ -1316,7 +1316,7 @@ static irqreturn_t rt2500pci_interrupt(int irq, void *dev_instance)
1316 * 3 - Atim ring transmit done interrupt. 1316 * 3 - Atim ring transmit done interrupt.
1317 */ 1317 */
1318 if (rt2x00_get_field32(reg, CSR7_TXDONE_ATIMRING)) 1318 if (rt2x00_get_field32(reg, CSR7_TXDONE_ATIMRING))
1319 rt2500pci_txdone(rt2x00dev, IEEE80211_TX_QUEUE_AFTER_BEACON); 1319 rt2500pci_txdone(rt2x00dev, RT2X00_BCN_QUEUE_ATIM);
1320 1320
1321 /* 1321 /*
1322 * 4 - Priority ring transmit done interrupt. 1322 * 4 - Priority ring transmit done interrupt.
@@ -1822,6 +1822,49 @@ static void rt2500pci_reset_tsf(struct ieee80211_hw *hw)
1822 rt2x00pci_register_write(rt2x00dev, CSR17, 0); 1822 rt2x00pci_register_write(rt2x00dev, CSR17, 0);
1823} 1823}
1824 1824
1825static int rt2500pci_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb,
1826 struct ieee80211_tx_control *control)
1827{
1828 struct rt2x00_dev *rt2x00dev = hw->priv;
1829 struct rt2x00_intf *intf = vif_to_intf(control->vif);
1830 struct queue_entry_priv_pci_tx *priv_tx;
1831 struct skb_frame_desc *skbdesc;
1832
1833 if (unlikely(!intf->beacon))
1834 return -ENOBUFS;
1835
1836 priv_tx = intf->beacon->priv_data;
1837
1838 /*
1839 * Fill in skb descriptor
1840 */
1841 skbdesc = get_skb_frame_desc(skb);
1842 memset(skbdesc, 0, sizeof(*skbdesc));
1843 skbdesc->data = skb->data;
1844 skbdesc->data_len = skb->len;
1845 skbdesc->desc = priv_tx->desc;
1846 skbdesc->desc_len = intf->beacon->queue->desc_size;
1847 skbdesc->entry = intf->beacon;
1848
1849 /*
1850 * mac80211 doesn't provide the control->queue variable
1851 * for beacons. Set our own queue identification so
1852 * it can be used during descriptor initialization.
1853 */
1854 control->queue = RT2X00_BCN_QUEUE_BEACON;
1855 rt2x00lib_write_tx_desc(rt2x00dev, skb, control);
1856
1857 /*
1858 * Enable beacon generation.
1859 * Write entire beacon with descriptor to register,
1860 * and kick the beacon generator.
1861 */
1862 memcpy(priv_tx->data, skb->data, skb->len);
1863 rt2x00dev->ops->lib->kick_tx_queue(rt2x00dev, control->queue);
1864
1865 return 0;
1866}
1867
1825static int rt2500pci_tx_last_beacon(struct ieee80211_hw *hw) 1868static int rt2500pci_tx_last_beacon(struct ieee80211_hw *hw)
1826{ 1869{
1827 struct rt2x00_dev *rt2x00dev = hw->priv; 1870 struct rt2x00_dev *rt2x00dev = hw->priv;
@@ -1847,7 +1890,7 @@ static const struct ieee80211_ops rt2500pci_mac80211_ops = {
1847 .get_tx_stats = rt2x00mac_get_tx_stats, 1890 .get_tx_stats = rt2x00mac_get_tx_stats,
1848 .get_tsf = rt2500pci_get_tsf, 1891 .get_tsf = rt2500pci_get_tsf,
1849 .reset_tsf = rt2500pci_reset_tsf, 1892 .reset_tsf = rt2500pci_reset_tsf,
1850 .beacon_update = rt2x00pci_beacon_update, 1893 .beacon_update = rt2500pci_beacon_update,
1851 .tx_last_beacon = rt2500pci_tx_last_beacon, 1894 .tx_last_beacon = rt2500pci_tx_last_beacon,
1852}; 1895};
1853 1896