summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rtl818x
Commit message (Collapse)AuthorAgeFilesLines
* rtlwifi: rtl818x: Move drivers into new realtek directoryLarry Finger2015-10-1425-8041/+0
| | | | | | | | | | | | Now that a new mac80211-based driver for Realtek devices has been submitted, it is time to reorganize the directories. Rather than having directories rtlwifi and rtl818x be in drivers/net/wireless/, they will now be in drivers/net/wireless/realtek/. This change simplifies the directory structure, but does not result in any configuration changes that are visable to the user. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mac80211: convert HW flags to unsigned long bitmapJohannes Berg2015-06-102-7/+8
| | | | | | | | | | | | | | | As we're running out of hardware capability flags pretty quickly, convert them to use the regular test_bit() style unsigned long bitmaps. This introduces a number of helper functions/macros to set and to test the bits, along with new debugfs code. The occurrences of an explicit __clear_bit() are intentional, the drivers were never supposed to change their supported bits on the fly. We should investigate changing this to be a per-frame flag. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* rtl818x_pci: fix response rate may be incorrect.Andrea Merello2014-10-071-11/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the allowed "respose rate" set (rates for HW generated frames like ACKs) is the same as the basic rate set. The HW will use the higher allowed response rate that is lower than the rate of the received frame. This is more or less what IEEE80211 mandates, but I missed the fact that IEEE80211 also says that whenever it happens that for a modulation class there is no any rate in the basic rates set, then the response rate set shall include also all the mandatory rates for that modulation class. This patch adds mandatory OFDM rates to the allowed response rate set if no OFDM rate is included in the basic rate set. Depending by the AP, I faced cases in which this patch seems to cause a noticeable perfomance improvement. - With my usual test AP there is no particular perfomance difference. - With a prism54/hostapd AP this patch causes RX thoughput increase from about 5Mbps to about 20Mbps. Hopefully this patch may help people that faced performance regression wrt the old staging driver. Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtl818x_pci: add RSSI information for rtl8187SEandrea.merello2014-09-261-5/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes the driver to report signal strength information to mac80211 for rtl8187se boards. It differs from my previous RFT patch: http://marc.info/?l=linux-wireless&m=140155388332534&w=2 because: - I have now a working rtl8187se card, so I could serve my RFT by myself. :) - CCK measurement code has changed a bit, but it does basically the same things. - OFDM measurement method is changed because the older method reported incorrect measures, at least for signals stronger than -40dBm). CCK measurement seems quite good. OFDM seems less accurate, but this is the same as the "reference" staging driver dose. I wanted not to change things just to make measures of _one_ (my) card a bit more close to what _I_ (in my setup) expected.. IMHO results are still good enough to justify reporting signal in dBm rather than in "unspecified" units, so this is what this patch actually does. Results of my tests with a working rtl8187se card connected with coaxes and various RF attenuators to my AP are: Input (approx) | CCK meas | OFDM meas -------------------------------------- -30dBm | -32dBm | -31dBm -40dBm | -40dBm | -41dBm -50dBm | -50dBm | -55dBm -60dBm | -59dBm | -63dBm -70dBm | -69dBm | -73dBm -80dBm | -79dBm | -83dBm Also some real-field tests has been done (no coax, packets in the air) for the CCK measure method, and they resulted in reasonable values. Thanks-to: Bernhard Schiffner <bernhard@schiffner-limbach.de> [ for real-field tests] Signed-off-by: andrea.merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* PCI: Remove DEFINE_PCI_DEVICE_TABLE macro useBenoit Taine2014-08-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | We should prefer `struct pci_device_id` over `DEFINE_PCI_DEVICE_TABLE` to meet kernel coding style guidelines. This issue was reported by checkpatch. A simplified version of the semantic patch that makes this change is as follows (http://coccinelle.lip6.fr/): // <smpl> @@ identifier i; declarer name DEFINE_PCI_DEVICE_TABLE; initializer z; @@ - DEFINE_PCI_DEVICE_TABLE(i) + const struct pci_device_id i[] = z; // </smpl> [bhelgaas: add semantic patch] Signed-off-by: Benoit Taine <benoit.taine@lip6.fr> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
* rtl818x: use pci_zalloc_consistentJoe Perches2014-08-081-7/+4
| | | | | | | | | Remove the now unnecessary memset too. Signed-off-by: Joe Perches <joe@perches.com> Cc: "John W. Linville" <linville@tuxdriver.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* rtl818x_pci: fix pci probe returns success when it failsAndrea Merello2014-07-011-0/+4
| | | | | | | | | | | | | | There are several exit path from the PCI probe function. Some of them, that are taken in case of errors, forget to set the "err" variable, that is returned by the probe function. This can lead to the kernel thinking the probe function succeeds while it didn't, and this in turn causes extra calls to the "remove" function. This patch fix this problem by ensuring "err" variable is assigned to a proper non-zero value in each exit path. Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtl818x_pci: handle broken PIO mappingAndrea Merello2014-07-012-4/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All boards supported by this driver could work using PIO or MMIO for accessing registers. This driver tries to access HW by using MMIO, and, if this fails for somewhat reason, the driver tries to fall back to PIO mode. MMIO-mode is straightforward on all boards. PIO-mode is straightforward on rtl8180 only. On rtl8185 and rtl8187se boards not all registers are directly available in PIO mode (they are paged). On rtl8185 there are two pages and it is known how to switch page. PIO mode works, except for only one access to a register out of default page, recently added by me in the initialization code with patch: rtl818x_pci: Fix rtl8185 excessive IFS after CTS-to-self This can be easily fixed to work in both cases (MMIO and PIO). On rtl8187se, for a number of reasons, there is much more work to do to fix PIO access. PIO access is currently broken on rtl8187se, and it never worked. This patch fixes the said register write for rtl8185 and makes the driver to fail cleanly if PIO mode is attempted with rtl8187se boards. While doing this, I converted also a couple of printk(KERN_ERR) to dev_err(), in order to make checkpatch happy. Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtl8180: disable buggy rate fallback mechanismAndrea Merello2014-07-011-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the driver configures mac80211 to provide two rates for each TX frame: One initial rate and one alternate fallback rate, each one with its retry count. HW does not support fully this: rtl8180 doesn't have support for rate scaling at all, and rtl8185/rtl8187SE supports it in a way that does not fit with mac80211: The HW does automatically fall back to the next lower rate, and only a lower limit can be specified, so the HW may TX also on rates in between the two rates specified by mac80211. Furthermore only the total TX retry count can be specified for each packet, while the number of TX attempts before scaling rate can be configured only globally (not per each packet). Currently the driver sets the HW auto rate fallback mechanism to quickly scale rate after a couple of retries, and it uses the alternate rate requested by mac80211 as fallback limit rate (and it does this even wrongly). The HW indeed will behave differently than what mac80211 mandates, that is probably undesirable, and the reported TX retry count may not refer to what mac80211 thinks, and this could fool mac80211. This patch makes the driver to declare to mac80211 to support only one rate configuration for each packet, and it does disable the HW auto rate fallback mechanism, relying only on SW and letting mac80211 to do all by itself. This should ensure correct operation and fairness respect to mac80211. Indeed here tests with iperf do not show significant performance differences. Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtl8180: fix incorrect TX retry.Andrea Merello2014-07-011-1/+1
| | | | | | | | | | | | | HW is programmed with wrong retry count value for TX: Mac80211 passes to driver the number of times the TX should be attempted. The HW, instead, wants the number of time the TX should be retried if it fails the first time (assuming we have to TX it at least one time). This patch correct this. Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtl818x_pci: add comment pointing to the rtl8187se reference codeAndrea Merello2014-07-011-0/+1
| | | | | | | | | | | | | | | | | | Rtl8187se support has been added to the rtl818x_pci driver by extracting a lot of information from a rtl8187se Linux staging driver included in the kernel at the time rtl8187se support was added. The rtl818x_pci main file has a comment that advertises this. Recently this staging driver has been removed from the kernel, but I still feel it can be useful as "reference" code (in case of bugs, or to implement improvements in rtl818x_pci driver). This one-line patch adds a comment in rtl818x_pci driver to point people searching for that "reference code" to the last kernel version still containing it (3.14). Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtl818x_pci: Fix rtl8185 excessive IFS after CTS-to-selfAndrea Merello2014-07-011-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | Measuring time between _end_ of CTS-to-self and _end_ of datapacket (with a prism54 board and mac80211 hacked to let the MAC timestamp stay untouched in the radiotap header) resulted in about 300uS, while the datapacket itself should be by far shorter (less than 100uS) and IFS should be SIFS (10uS). This measure was confirmed whith a scope: about 250uS IFS has been seen between the two packets. This situation causes the CTS-to-self protection mechanism to work incorrectly due to the NAV expiring during, or even before beginning, the packet transmission, and it also causes the performances to be anyway reduced due to time waste. This problem has been seen at every packet TXed with CTS-to-self enabled on rtl8185 board. rtl8187se seems not affected (and rtl8180, being a 802.11b card, does not have CTS-to-self mechaninsm). This patch fixes this by adding a magic register write, making the board wait for correct SIFS after CTS-to-self packet. Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtl818x_pci: Fix BSSID register written incorrectlyAndrea Merello2014-07-011-3/+4
| | | | | | | | | | | | | | BSSID register was written with six byte-writes. It seems that, similarly to what happens with MAC registers, they needs to be written with one 16-bit and one 32-bit writes, otherwise the write does not work. The byte write didn't work only on my rtl8185, while it worked on rtl8180 and rtl8187se, BTW since there are probably a number of different ASIC revisions out of there, I let the change to affect all cards. It shouldn't hurt anyway. Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtl818x_pci: fix possible RX descriptor invalid data readAndrea Merello2014-06-191-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | RX descriptor data must be read only if the descriptor has been fully updated by HW. There is a "ownership" flag in the descriptor itself to test this. The driver code contains a read for the "ownership" flag and, after it, other read access for descriptor data. This is in DMA coherent memory, that is _not_ guaranteed to be immune to instruction reordering, thus it is possible that the descriptor data is read _before_ the "ownership" flag. This can theoretically lead to a DMA/CPU race that may end up with the driver reading the data when it is still not valid, and the "ownership" bit just after enough time that the HW make the whole descriptor valid. The driver will in this case believe the data is valid, but it will use the invalid data read earlier. In order to avoid this, this patch adds a rmb() to force the "ownership" bit read to be issued before other descriptor data reads are attempted. Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtl818x_pci: provide dBm signal information for rtl8185Andrea Merello2014-06-191-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes the driver report signal information for rtl8185 boards using dBm instead of unspecified unit. Rtl8180 remains untouched. I did some tests to confirm the correctness of the measure performed by the board and it seems reasonably correct. The test setup has been made by connecting an AP with coax and RF attenuators to the card antenna port. In order to get a reference measure I tried with several cards with different chipset I own. I found that many gave different results, and I finally selected two cards that gave me consistent results to use as reference: AR9271 and Prism54-usb (isl3887 with Frisbee radio). Using this references I compared the RSSI information with my rtl8185 and I repeated tests with three different attenuation values, increasing attenuation by 10dB each step. I made only relative measures, making NO assumption about source power. CCK measures seem very close to my references, OFDM are a little bit less precise but, considering that these cards are not measuring instrumentation, IMHO this is still fairly good. CCK measures (1Mbps beacons) ATTENUATOR 1 p54usb: -58dBm ath9k_htc: -59dBm rtl8185: -59dBm ATTENUATOR 2 p54usb: -67dBm ath9k_htc: -68dBm rtl8185: -70dBm ATTENUATOR 3 p54usb: -78dBm ath9k_htc: -79dBm rtl8185: -79dBm OFDM measures (54Mbps ping) ATTENUATOR 1 p54usb: -58dBm ath9k_htc: -57dBm rtl8185: -62dBm ATTENUATOR 2 p54usb: -68dBm rtl8185: -71dBm Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtl818x_pci: make RSSI code more readableAndrea Merello2014-06-191-5/+8
| | | | | | | | remove the if-else chains and use switch-case to make code more readable and avoiding long lines that broke in several lines Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtl8187: make CTS-to-self protection workAndrea Merello2014-05-071-1/+8
| | | | | | | | | | | CTS protection was not working properly because the HW needs RTS flag to be asserted, and it need also RTS duration field to be filled with CTS-to-self duration. This patch makes the driver to do this. Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtl8180: make CTS-to-self protection workAndrea Merello2014-05-071-5/+10
| | | | | | | | | | | | CTS protection was not working properly because the HW still need RTS flag to be asserted, and it need also RTS rate field to be set with CTS-to-self rate and RTS duration field to be filled with CTS-to-self duration. This patch makes the driver to do this. Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtl8180: report mac80211 short preamble RX flagAndrea Merello2014-05-071-0/+2
| | | | | | | | | | | | This patch make it possible to mac80211 to know whether a frame has been received with short preamble. It simply checks for the "splcp" flag in the RX status descriptor, and eventually set RX_FLAG_SHORTPRE in mac80211 rx status structure. Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtl8187: report mac80211 short preamble RX flagAndrea Merello2014-05-071-0/+2
| | | | | | | | | | | | This patch make it possible to mac80211 to know whether a frame has been received with short preamble. It simply checks for the "splcp" flag in the RX status descriptor, and eventually set RX_FLAG_SHORTPRE in mac80211 rx status structure. Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtl8180: be paranoid in stopping unused queues.Andrea Merello2014-04-221-1/+4
| | | | | | | | | | | | | | HW should never attempt to perform DMA for unused queues. For rtl8187se this is ensured by setting a dedicated register at init time, before enabling TX. In rtl8180/5 the register is only written at the first TX (because in rtl8180/5 it serves also to kick DMA for used queues). This should be enough, but it's worth to add a register write at init time, before enabling TX. Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtl8180: add parentheses to REG_ADDR macrosAndrea Merello2014-04-221-3/+3
| | | | | | | | | | | | | | Parentheses are missing around the macro argument, causing the macro possibly not to work passing certain expressions as arguments. This should not cause any issues with current code, however it's worth to add them, as a good practice, and to eventually avoid future bugs. Suggested-by: Dave Kilroy <kilroyd@googlemail.com> Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtl8180: fix enabled interrupt mask for rtl8187seAndrea Merello2014-04-221-3/+2
| | | | | | | | | | | | | | | | | | | | When preparing the bitfield to write to HW register, the high-priority queue error interrupt bit is set two times, and the beacon queue TX-OK interrupt is not enabled. Currently this have no functional impact because the high-priority queue is not used at all, and the beacon queue is not used yet. This patch removes high-priority queue bits and it adds the beacon queue missing bit. It removes also the management queue bits because it is not used. This was found by static code analyzer. Reported-by: Fengguang Wu <fengguang.wu@intel.com> Reported-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtl8180: change module name in rtl818x_pciLarry Finger [ original patch ]2014-04-221-2/+2
| | | | | | | | | | | | | | rtl8180 driver can handle also rtl8185 and rtl8187SE cards, however in userspace tools (network manager) it still appares as "rtl8180". This might lead the user to think the wrong driver is in use. This patch changes module name to "rtl818x_pci" that should be more explanatory. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> [ original patch ] Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtl8187: fix use after free on failure path in rtl8187_probe()Alexey Khoroshilov2014-03-311-2/+2
| | | | | | | | | | | | If allocation of io_dmabuf fails, rtl8187_probe() calls usb_put_dev(udev) while usb_get_dev(udev) is not called yet. As a result refcnt is decremented incorrectly and usb_dev can be used after memory deallocation. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtl8180: don't use weird trick to access "far" registersAndrea Merello2014-03-311-10/+4
| | | | | | | | | | | | | | | | | | | | | | | | | In rtl8180/rtl8185/rtl8187se the register space is represented using packed structure type. Register are thus accessed using a pointer of this type. All registers are packed toghether, and only small gaps are present. However Rtl8187se has also some "sparse" registers, very far from the "main register block". It could be possible to access them by simply declare huge reserved blocks inside the register struct (and this causes NO memory waste). However, for various reasons, access to those "far" registers is done with special dedicated macros, without declaring them in the register struct. This is done in an intricate manner, that makes code less readable and caused static analisys tool to produce warnings. This patch keeps the "macro" mechanism, but it changes its implementation in a simplier and more straightforward way. Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtl8187: fix compile warningAndrea Merello2014-03-311-1/+1
| | | | | | | | | | | | | | | | | ANAPARAM3 register, defined in the rtl818x common register struct, is accessed as 16bit by rtl8187se and as 8bit by rtl8187b. Since I have no documentation about this, I can only stick to the reference code and to what is known to work. This issue has been addressed by a patch from Larry Finger that introduces an "union", in the register struct. In my last patch-set I applied it on the register struct, but I forget to update rtl8187 driver too. This patch does it. Suggested-by: Larry Finger <Larry.Finger@lwfinger.net> [ Original patch ] Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtl818x: Update Kconfig for rtl8187seAndrea Merello2014-03-271-2/+2
| | | | | | | | update description in Kconfig to state rtl8180 driver now supports also rtl8187se cards Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtl8180: enable rtl8187se supportAndrea Merello2014-03-271-4/+35
| | | | | | | | | Finally make rtl8187se works (hopefylly). This patch adds PCI ID for rtl8187, updates copyright notes and updates MODULE_DESCRIPTION. Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtl8180: detect rtl8187se cardAndrea Merello2014-03-271-2/+15
| | | | | | | | Add case to detect the rtl8187se card and its RF frontend. In this case set also accordingly mac80211 queue number. Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtl8180: add WMM parameters configuration for rtl8187seAndrea Merello2014-03-272-2/+61
| | | | | | | | | Introduce a new function to configure AC parameters for TX queues on rtl8187se cards, and hook it onto mac80211 in order to enable WMM support. Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtl8180: make sure RTL818X_MSR_ENEDCA is set for rtl8187seAndrea Merello2014-03-271-0/+4
| | | | | | | | MSR register for rtl8187se must always have ENEDCA flag set. Write it accordingly when updated on BSS change. Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtl8180: add ERP configuration for rtl8187seAndrea Merello2014-03-271-6/+10
| | | | | | | | | | This patch adds ERP configuration support for rtl8187se to the existing ERP configuration function. It needs a different register offset and it must not apply rtl8185 workaround. Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtl8180: add rtl8187se HW initializationAndrea Merello2014-03-271-9/+159
| | | | | | | | | This patch adds few functions that initializes extra stuff that is present only in rtl8187se HW, and it modify the existing HW initialization function where necessary Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtl8180: add RF code for rtl8225 zebra v4Andrea Merello2014-03-274-1/+538
| | | | | | | | | | | This patch introduce new RF code for rtl8225 zebra v4 radio frontend. This code contains a lot of black magic and it can work probably only with the radio embdedded in the rtl8187se single-chip. Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtl8180: introduce functions for setting ANAPARAM 2 and 3 paramsAndrea Merello2014-03-273-0/+42
| | | | | | | | | | | | rtl8180 has one register for analog converters setting ,rtl8185 has two and rtl8187se has three. Setting those registers require more than a simple write, and for one of them a function is already provided. This patch introduces functions for the other two. rtl8187se will use them. rtl8185 doesen't yet, but should Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtl8180: add rtl8187se params to eeprom readingAndrea Merello2014-03-272-1/+24
| | | | | | | | rtl8187se nees extra parameters to be read from the eeprom. This patch adds support for it Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtl8180: config carbus register for rtl8187seAndrea Merello2014-03-271-7/+21
| | | | | | | | | | configuration of carbus-related registers is different for rtl8187se. Introduce a dedicated function that does it for all cards in the proper way Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtl8180: add TX queue mapping and support for rtl8187seAndrea Merello2014-03-272-6/+88
| | | | | | | | | | This patch adds tx queue mapping for rtl8187se and a long comment block about their usages. It adapts the TX function to use that map and it sets properly the TX descriptor rtl8187se-only fields Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtl8180: don't write MAR registers for rtl8187seAndrea Merello2014-03-271-2/+7
| | | | | | | | MAR registers are not present in rtl8187se, and attempting to write to them must be avoided Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtl8180: introduce functions to enable/disable ints and add support for ↵Andrea Merello2014-03-271-3/+33
| | | | | | | | | | | rtl8187se This patch introduces two dedicated functions for enabling and disabling ints. Support for rtl8187se is also added to them Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtl8180: add ISR for rtl8187seAndrea Merello2014-03-271-1/+56
| | | | | | | | rtl8187se has more queues and different ISR flags. This patch adds a separated ISR handler for rtl8187se Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtl8180: support for rtl8187se RX descriptorsAndrea Merello2014-03-272-18/+57
| | | | | | | | | | | | | Currently RX status descriptor and RX command descriptor are represented using the same struct type. This patch splits this by introducing different types for rx status and command descriptor. Doing this make it possible to handle rtl8187se RX descriptors easier. This patch do also this by adding specific cases where needed. Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtl8180: add basic rate configuration support for rtl8187seAndrea Merello2014-03-271-1/+5
| | | | | | | | | Basic rate configuration is a bit different for rtl8187se. Adding this also fixes the gcc warning introduced in last patch about unhandled case in switch. Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtl8180: add rtl8187se fields to TX descriptorAndrea Merello2014-03-271-2/+14
| | | | | | | | | | This patch modifies the TX descriptor struct so it can work also for rtl8187se. Some reserved field is now meaningful, and where needed union is used. Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtl8180: add rtl8187se chip typeAndrea Merello2014-03-271-0/+1
| | | | | | | | | Add back rtl8187se chip type to the enum for known chips. This causes unhandled switch/case warning that will be fixed in following patch Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtl818x: add registers for rtl8187seAndrea Merello2014-03-271-49/+217
| | | | | | | Adds registers for rtl8187se to the rtl818x common struct Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtl8180: rationalize TX queuesAndrea Merello2014-03-272-16/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | On currently supported HW there are four TX queues (three for normal packets and one for beacons). The driver uses just one TX queue, and declare to mac80211 to support just one queue, but it allocates coherent memory for all queues. Furthermore the TX is code is written assumimg four queues exists, and even if we decide to enable more queues in future, its mapping rule to mac80211 is fixed. This means we have memory waste on rtl8180/rtl8185, and we have also not enough flexibility to add support for boards (rtl8187se) that will use more queues. This patch changes things in order to allocate coherent memory only for the queues effectively used and it make it possible to specify how to map hardware queues on mac80211 queues, that will be used by rtl8187se code as soon it will be merged. Note: even if the beacon queue is currently unused, this should change, so I kept it. Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtl8180: fix DMA register are written two timesAndrea Merello2014-03-271-6/+0
| | | | | | | | | | | Hw DMA registers are written in rtl8180_init_hw function. They are also written again just after calling rtl8180_init_hw. There is no point in doing this twice. Remove those redundant register writes from rtl8180_start. Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* rtl818x: remove unused conf_erp callback from RF ops structAndrea Merello2014-03-191-1/+0
| | | | | | | | | | | The ERP configuration is now done outside RF code in both rtl8180 and rtl8187 drivers. The conf_erp callback in common RF ops struct is now useless. Remove it. Signed-off-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
OpenPOWER on IntegriCloud