653-0002-rtl8xxxu-Add-initial-code-to-detect-8188eu-devices.patch 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. From 6f971392cd52524058f179d7c78464d692fbb018 Mon Sep 17 00:00:00 2001
  2. From: Jes Sorensen <Jes.Sorensen@redhat.com>
  3. Date: Mon, 27 Jun 2016 14:23:44 -0400
  4. Subject: [PATCH] rtl8xxxu: Add initial code to detect 8188eu devices
  5. So far this just detects the device and tries to load firmware.
  6. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
  7. ---
  8. drivers/net/wireless/realtek/rtl8xxxu/Makefile | 2 +-
  9. drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h | 1 +
  10. .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c | 65 ++++++++++++++++++++++
  11. .../net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c | 3 +
  12. 4 files changed, 70 insertions(+), 1 deletion(-)
  13. create mode 100644 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
  14. --- a/drivers/net/wireless/realtek/rtl8xxxu/Makefile
  15. +++ b/drivers/net/wireless/realtek/rtl8xxxu/Makefile
  16. @@ -1,4 +1,4 @@
  17. obj-$(CPTCFG_RTL8XXXU) += rtl8xxxu.o
  18. rtl8xxxu-y := rtl8xxxu_core.o rtl8xxxu_8192e.o rtl8xxxu_8723b.o \
  19. - rtl8xxxu_8723a.o rtl8xxxu_8192c.o
  20. + rtl8xxxu_8723a.o rtl8xxxu_8192c.o rtl8xxxu_8188e.o
  21. --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
  22. +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu.h
  23. @@ -1446,6 +1446,7 @@ void rtl8xxxu_fill_txdesc_v2(struct ieee
  24. bool short_preamble, bool ampdu_enable,
  25. u32 rts_rate);
  26. +extern struct rtl8xxxu_fileops rtl8188eu_fops;
  27. extern struct rtl8xxxu_fileops rtl8192cu_fops;
  28. extern struct rtl8xxxu_fileops rtl8192eu_fops;
  29. extern struct rtl8xxxu_fileops rtl8723au_fops;
  30. --- /dev/null
  31. +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8188e.c
  32. @@ -0,0 +1,65 @@
  33. +/*
  34. + * RTL8XXXU mac80211 USB driver - 8188e specific subdriver
  35. + *
  36. + * Copyright (c) 2014 - 2016 Jes Sorensen <Jes.Sorensen@redhat.com>
  37. + *
  38. + * Portions, notably calibration code:
  39. + * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
  40. + *
  41. + * This driver was written as a replacement for the vendor provided
  42. + * rtl8723au driver. As the Realtek 8xxx chips are very similar in
  43. + * their programming interface, I have started adding support for
  44. + * additional 8xxx chips like the 8192cu, 8188cus, etc.
  45. + *
  46. + * This program is free software; you can redistribute it and/or modify it
  47. + * under the terms of version 2 of the GNU General Public License as
  48. + * published by the Free Software Foundation.
  49. + *
  50. + * This program is distributed in the hope that it will be useful, but WITHOUT
  51. + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  52. + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  53. + * more details.
  54. + */
  55. +
  56. +#include <linux/init.h>
  57. +#include <linux/kernel.h>
  58. +#include <linux/sched.h>
  59. +#include <linux/errno.h>
  60. +#include <linux/slab.h>
  61. +#include <linux/module.h>
  62. +#include <linux/spinlock.h>
  63. +#include <linux/list.h>
  64. +#include <linux/usb.h>
  65. +#include <linux/netdevice.h>
  66. +#include <linux/etherdevice.h>
  67. +#include <linux/ethtool.h>
  68. +#include <linux/wireless.h>
  69. +#include <linux/firmware.h>
  70. +#include <linux/moduleparam.h>
  71. +#include <net/mac80211.h>
  72. +#include "rtl8xxxu.h"
  73. +#include "rtl8xxxu_regs.h"
  74. +
  75. +static int rtl8188eu_parse_efuse(struct rtl8xxxu_priv *priv)
  76. +{
  77. + return 0;
  78. +}
  79. +
  80. +static int rtl8188eu_load_firmware(struct rtl8xxxu_priv *priv)
  81. +{
  82. + char *fw_name;
  83. + int ret;
  84. +
  85. + fw_name = "rtlwifi/rtl8188eufw.bin";
  86. +
  87. + ret = rtl8xxxu_load_firmware(priv, fw_name);
  88. +
  89. + return -EINVAL;
  90. + return ret;
  91. +}
  92. +
  93. +struct rtl8xxxu_fileops rtl8188eu_fops = {
  94. + .parse_efuse = rtl8188eu_parse_efuse,
  95. + .load_firmware = rtl8188eu_load_firmware,
  96. + .reset_8051 = rtl8xxxu_reset_8051,
  97. +};
  98. --- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
  99. +++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_core.c
  100. @@ -54,6 +54,7 @@ MODULE_LICENSE("GPL");
  101. MODULE_FIRMWARE("rtlwifi/rtl8723aufw_A.bin");
  102. MODULE_FIRMWARE("rtlwifi/rtl8723aufw_B.bin");
  103. MODULE_FIRMWARE("rtlwifi/rtl8723aufw_B_NoBT.bin");
  104. +MODULE_FIRMWARE("rtlwifi/rtl8188eufw.bin");
  105. MODULE_FIRMWARE("rtlwifi/rtl8192cufw_A.bin");
  106. MODULE_FIRMWARE("rtlwifi/rtl8192cufw_B.bin");
  107. MODULE_FIRMWARE("rtlwifi/rtl8192cufw_TMSC.bin");
  108. @@ -6210,6 +6211,8 @@ static struct usb_device_id dev_table[]
  109. {USB_DEVICE_AND_INTERFACE_INFO(USB_VENDOR_ID_REALTEK, 0xb720, 0xff, 0xff, 0xff),
  110. .driver_info = (unsigned long)&rtl8723bu_fops},
  111. #ifdef CPTCFG_RTL8XXXU_UNTESTED
  112. +{USB_DEVICE_AND_INTERFACE_INFO(USB_VENDOR_ID_REALTEK, 0x8179, 0xff, 0xff, 0xff),
  113. + .driver_info = (unsigned long)&rtl8188eu_fops},
  114. /* Still supported by rtlwifi */
  115. {USB_DEVICE_AND_INTERFACE_INFO(USB_VENDOR_ID_REALTEK, 0x8176, 0xff, 0xff, 0xff),
  116. .driver_info = (unsigned long)&rtl8192cu_fops},