Realtek 8187B wireless support with product id 0x8197/0x8189
I have made a small change (r8187b_endpoint-12.patch) on top of a patch which Herton (rtl8187b_5.patch) sent to Axel for a new mac80211-based driver for Realtek 8187B. Herton's patch was missing one thing that the vendor driver does - the vendor driver sends management control frames through usb endpoint 12 rather than the normal priority-based queueing endpoints 6,7,5,4. Without the management frame change, it seems that the new driver can scan but not associate, and my patch fixes that. My patch is probably a bit ugly (hence I have not provided an integrated patch), but since it is just a few lines and short enough, I am sure somebody can re-write it better.
So I *am* using the new driver *right now* connected to the internet...
The rest of the story is at:
https://bugzilla.redhat.com/show_bug.cgi?id=432280
These two patches are the same as (and Herton may have a newer/better one for his already):
https://bugzilla.redhat.com/attachment.cgi?id=304231
https://bugzilla.redhat.com/attachment.cgi?id=305203
BTW, I am not subscribed to linux-wireless, but feel free to CC me on this...
__________________________________________________________
Sent from Yahoo! Mail.
A Smarter Email http://uk.docs.yahoo.com/nowyoucan.html
drivers/net/wireless/rtl8187_dev.c renamed from compat-wireless-2008-05-07/drivers/net/wireless/rtl8187_dev.c +4 -1
@@ -206,6 +206,8 @@__le16 rts_dur =0 ;u32 flags;unsigned int ep[4 ] = {6 ,7 ,5 ,4 }; +u16 frame_control =le16_to_cpu (((struct ieee80211_hdr *)(skb->data))->frame_control); +u8 is_mgmt = ((frame_control &IEEE80211_FCTL_FTYPE ) ==IEEE80211_FTYPE_MGMT ); urb =usb_alloc_urb (0 ,GFP_ATOMIC );if (!urb) {
@@ -251,7 +253,8 @@ info->dev = dev;usb_fill_bulk_urb (urb, priv->udev,usb_sndbulkpipe (priv->udev, - priv->is_rtl8187b ? ep[control->queue] :2 ), + priv->is_rtl8187b ? (is_mgmt ?12 : ep[control->queue]) + :2 ), buf, skb->len, rtl8187_tx_cb, skb);usb_submit_urb (urb,GFP_ATOMIC );
drivers/net/wireless/rtl8187.h +94 -17
187 lines not on this page · raw message
drivers/net/wireless/rtl8187_dev.c +439 -64
685 lines not on this page · raw message
drivers/net/wireless/rtl8187_rtl8225.c +229 -10
286 lines not on this page · raw message
drivers/net/wireless/rtl8187_rtl8225.h +3 -0
@@ -34,4 +34,7 @@ static inline void rtl8225_write_phy_cck(struct ieee80211_hw *dev, rtl8187_write_phy(dev, addr, data | 0x10000); } +int rtl8187_get_radio_registers (char *page,char **start,off_t offset, +int count,int *eof,void *data); +#endif /* RTL8187_RTL8225_H */
drivers/net/wireless/rtl818x.h +26 -9
@@ -66,7 +66,10 @@ struct rtl818x_csr {#define RTL818X_TX_CONF_R8180_F (3 << 25)#define RTL818X_TX_CONF_R8185_ABC (4 << 25)#define RTL818X_TX_CONF_R8185_D (5 << 25) +#define RTL818X_TX_CONF_R8187vD_1 (5 << 25) +#define RTL818X_TX_CONF_R8187vD_2 (6 << 25)#define RTL818X_TX_CONF_HWVER_MASK (7 << 25) +#define RTL818X_TX_CONF_DISREQQSIZE (1 << 28)#define RTL818X_TX_CONF_PROBE_DTS (1 << 29)#define RTL818X_TX_CONF_HW_SEQNUM (1 << 30)#define RTL818X_TX_CONF_CW_MIN (1 << 31)
@@ -106,8 +109,11 @@ struct rtl818x_csr {#define RTL818X_MSR_NO_LINK (0 << 2)#define RTL818X_MSR_ADHOC (1 << 2)#define RTL818X_MSR_INFRA (2 << 2) +#define RTL818X_MSR_MASTER (3 << 2) +#define RTL818X_MSR_ENEDCA (4 << 2)u8 CONFIG3 ;#define RTL818X_CONFIG3_ANAPARAM_WRITE (1 << 6) +#define RTL818X_CONFIG3_GNT_SELECT (1 << 7)u8 CONFIG4 ;#define RTL818X_CONFIG4_POWEROFF (1 << 6)#define RTL818X_CONFIG4_VCOOFF (1 << 7)
@@ -133,7 +139,9 @@ struct rtl818x_csr {__le32 RF_TIMING ;u8 GP_ENABLE ;u8 GPIO ; -u8 reserved_12[10 ]; +u8 reserved_12[2 ]; +__le32 HSSI_PARA ; +u8 reserved_13[4 ];u8 TX_AGC_CTL ;#define RTL818X_TX_AGC_CTL_PERPACKET_GAIN_SHIFT (1 << 0)#define RTL818X_TX_AGC_CTL_PERPACKET_ANTSEL_SHIFT (1 << 1)
@@ -141,29 +149,38 @@ struct rtl818x_csr {u8 TX_GAIN_CCK ;u8 TX_GAIN_OFDM ;u8 TX_ANTENNA ; -u8 reserved_13[16 ]; +u8 reserved_14[16 ];u8 WPA_CONF ; -u8 reserved_14[3 ]; +u8 reserved_15[3 ];u8 SIFS ;u8 DIFS ;u8 SLOT ; -u8 reserved_15[5 ]; +u8 reserved_16[5 ];u8 CW_CONF ;#define RTL818X_CW_CONF_PERPACKET_CW_SHIFT (1 << 0)#define RTL818X_CW_CONF_PERPACKET_RETRY_SHIFT (1 << 1)u8 CW_VAL ;u8 RATE_FALLBACK ; -u8 reserved_16[25 ]; +#define RTL818X_RATE_FALLBACK_ENABLE (1 << 7) +u8 ACM_CONTROL ; +u8 reserved_17[24 ];u8 CONFIG5 ;u8 TX_DMA_POLLING ; -u8 reserved_17[2 ]; +u8 reserved_18[2 ];__le16 CWR ;u8 RETRY_CTR ; -u8 reserved_18[5 ]; +u8 reserved_19[3 ]; +__le16 INT_MIG ; +#define RTL818X_R8187B_B 0 +#define RTL818X_R8187B_D 1 +#define RTL818X_R8187B_E 2__le32 RDSAR ; -u8 reserved_19[12 ]; -__le16 FEMR ; +__le16 TID_AC_MAP ;u8 reserved_20[4 ]; +u8 ANAPARAM3 ; +u8 reserved_21[5 ]; +__le16 FEMR ; +u8 reserved_22[4 ];__le16 TALLY_CNT ;u8 TALLY_SEL ; } __attribute__((packed));