File: ath9k_regdomain_override.patch

package info (click to toggle)
aircrack-ng 1%3A1.6%2Bgit20210130.91820bc-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 19,056 kB
  • sloc: ansic: 67,045; cs: 5,392; sh: 3,773; python: 2,565; pascal: 1,074; asm: 570; makefile: 253; cpp: 46
file content (31 lines) | stat: -rw-r--r-- 1,520 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
PaulFertser> Get _your_ country code from regd.h, add 32768 and supply as a parameter.
fercerpav@gmail.com
--- linux-2.6.32-gentoo-r1-orig/drivers/net/wireless/ath/ath9k/main.c	2009-12-03 06:51:21.000000000 +0300
+++ linux-2.6.32-gentoo-r1/drivers/net/wireless/ath/ath9k/main.c	2010-01-16 02:04:00.000000000 +0300
@@ -28,6 +28,11 @@
 module_param_named(nohwcrypt, modparam_nohwcrypt, int, 0444);
 MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption");
 
+static int modparam_override_eeprom_regdomain = -1;
+module_param_named(override_eeprom_regdomain, 
+			modparam_override_eeprom_regdomain, int, S_IRUGO);
+MODULE_PARM_DESC(override_eeprom_regdomain, "Override regdomain hardcoded in EEPROM with this value (DANGEROUS).");
+
 /* We use the hw_value as an index into our private channel structure */
 
 #define CHAN2G(_freq, _idx)  { \
@@ -1588,6 +1593,14 @@
 	if (error != 0)
 		return error;
 
+	if (modparam_override_eeprom_regdomain != -1) {
+		printk(KERN_ERR "ath9k: DANGER! You're overriding EEPROM-defined regulatory domain.\n");
+		printk(KERN_ERR "ath9k: Your card was not certified to operate on the domain you choosed.\n");
+		printk(KERN_ERR "ath9k: This might result in a violation of your local regulatory rules.\n");
+		printk(KERN_ERR "ath9k: Do not ever do that unless you really know what you do!\n");
+		sc->common.regulatory.current_rd = modparam_override_eeprom_regdomain;
+	}
+
 	/* get mac address from hardware and set in mac80211 */
 
 	SET_IEEE80211_PERM_ADDR(hw, sc->sc_ah->macaddr);