Attachment 'ath_ar9565_rfkill_gpio-2.0.patch'
Download 1 Index: sys/contrib/dev/ath/ath_hal/ar9300/ar9300_gpio.c
2 ===================================================================
3 --- sys/contrib/dev/ath/ath_hal/ar9300/ar9300_gpio.c (revision 276098)
4 +++ sys/contrib/dev/ath/ath_hal/ar9300/ar9300_gpio.c (working copy)
5 @@ -161,10 +161,11 @@
6 };
7
8 HALASSERT(gpio < AH_PRIVATE(ah)->ah_caps.halNumGpioPins);
9 - if ((gpio == AR9382_GPIO_PIN_8_RESERVED) ||
10 - (gpio == AR9382_GPIO_PIN_11_RESERVED) ||
11 + if ((gpio == AR9382_GPIO_PIN_8_RESERVED) /* ||
12 + (gpio == AR9382_GPIO_PIN_11_RESERVED) */ ||
13 (gpio == AR9382_GPIO_9_INPUT_ONLY))
14 {
15 + ath_hal_printf(ah, "%s: Invalid GPIO 0x%x\n", __func__, gpio);
16 return AH_FALSE;
17 }
18
19 @@ -347,10 +348,11 @@
20 u_int32_t gpio_shift;
21
22 HALASSERT(gpio < AH_PRIVATE(ah)->ah_caps.halNumGpioPins);
23 - if ((gpio == AR9382_GPIO_PIN_8_RESERVED) ||
24 - (gpio == AR9382_GPIO_PIN_11_RESERVED) ||
25 + if ((gpio == AR9382_GPIO_PIN_8_RESERVED) /* ||
26 + (gpio == AR9382_GPIO_PIN_11_RESERVED) */ ||
27 (gpio > AR9382_MAX_GPIO_INPUT_PIN_NUM))
28 {
29 + ath_hal_printf(ah, "%s: Invalid GPIO 0x%x\n", __func__, gpio);
30 return AH_FALSE;
31 }
32
33 @@ -377,12 +379,14 @@
34 ar9300_gpio_set(struct ath_hal *ah, u_int32_t gpio, u_int32_t val)
35 {
36 HALASSERT(gpio < AH_PRIVATE(ah)->ah_caps.halNumGpioPins);
37 - if ((gpio == AR9382_GPIO_PIN_8_RESERVED) ||
38 - (gpio == AR9382_GPIO_PIN_11_RESERVED) ||
39 + if ((gpio == AR9382_GPIO_PIN_8_RESERVED) /* ||
40 + (gpio == AR9382_GPIO_PIN_11_RESERVED) */ ||
41 (gpio == AR9382_GPIO_9_INPUT_ONLY))
42 {
43 + ath_hal_printf(ah, "%s: Invalid GPIO 0x%x\n", __func__, gpio);
44 return AH_FALSE;
45 }
46 + ath_hal_printf(ah, "%s: GPIO 0x%x => %u\n", __func__, gpio, val);
47 OS_REG_RMW(ah, AR_HOSTIF_REG(ah, AR_GPIO_OUT),
48 ((val & 1) << gpio), AR_GPIO_BIT(gpio));
49
50 @@ -397,9 +401,10 @@
51 {
52 u_int32_t gpio_in;
53 HALASSERT(gpio < AH_PRIVATE(ah)->ah_caps.halNumGpioPins);
54 - if ((gpio == AR9382_GPIO_PIN_8_RESERVED) ||
55 - (gpio == AR9382_GPIO_PIN_11_RESERVED))
56 + if (gpio == AR9382_GPIO_PIN_8_RESERVED /* ||
57 + gpio == AR9382_GPIO_PIN_11_RESERVED*/)
58 {
59 + ath_hal_printf(ah, "%s: Invalid GPIO 0x%x\n", __func__, gpio);
60 return 0xffffffff;
61 }
62
63 @@ -452,10 +457,11 @@
64
65 HALASSERT(gpio < AH_PRIVATE(ah)->ah_caps.halNumGpioPins);
66
67 - if ((gpio == AR9382_GPIO_PIN_8_RESERVED) ||
68 - (gpio == AR9382_GPIO_PIN_11_RESERVED) ||
69 + if ((gpio == AR9382_GPIO_PIN_8_RESERVED) /* ||
70 + (gpio == AR9382_GPIO_PIN_11_RESERVED) */ ||
71 (gpio > AR9382_MAX_GPIO_INPUT_PIN_NUM))
72 {
73 + ath_hal_printf(ah, "%s: Invalid GPIO 0x%x\n", __func__, gpio);
74 return;
75 }
76
77 @@ -549,8 +555,8 @@
78
79 if (AH_PRIVATE(ah)->ah_devid == AR9300_DEVID_AR9380_PCIE) {
80 mask = (1 << AR9382_MAX_GPIO_PIN_NUM) - 1;
81 - mask &= ~(1 << AR9382_GPIO_PIN_8_RESERVED |
82 - 1 << AR9382_GPIO_PIN_11_RESERVED);
83 + mask &= ~(1 << AR9382_GPIO_PIN_8_RESERVED /* |
84 + 1 << AR9382_GPIO_PIN_11_RESERVED*/);
85 }
86 return mask;
87 }
88 @@ -562,8 +568,8 @@
89
90 if (AH_PRIVATE(ah)->ah_devid == AR9300_DEVID_AR9380_PCIE) {
91 invalid = ~((1 << AR9382_MAX_GPIO_PIN_NUM) - 1);
92 - invalid |= 1 << AR9382_GPIO_PIN_8_RESERVED |
93 - 1 << AR9382_GPIO_PIN_11_RESERVED;
94 + invalid |= 1 << AR9382_GPIO_PIN_8_RESERVED /* |
95 + 1 << AR9382_GPIO_PIN_11_RESERVED*/;
96 }
97 if (mask & invalid) {
98 ath_hal_printf(ah, "%s: invalid GPIO mask 0x%x\n", __func__, mask);
Attached Files
To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.You are not allowed to attach a file to this page.