Skip to contentSkip to conversation

rfkill: add the WiMAX radio type

PATCH In review Inaky Perez-Gonzalez 6 participants 8 messages Jan 23, 2008 – Jan 29, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rfkill: add the WiMAX radio type

rfkill: add the WiMAX radio type

Teach rfkill about wimax radios.

Had to define a KEY_WIMAX as a 'key for disabling only wimax radios', as other radio technologies have. This makes sense as hardware has specific keys for disabling specific radios.

The RFKILL enabling part is, otherwise, a copy and paste of any other radio technology.

---

include/linux/input.h +2 -0
diff -r a52d5e9e9c91 include/linux/input.h
@@ -362,6 +362,8 @@ struct input_absinfo {
 #define KEY_BRIGHTNESS_CYCLE	243	/* brightness up, after max is min */
 #define KEY_BRIGHTNESS_ZERO	244	/* brightness off, use ambient */
 #define KEY_DISPLAY_OFF		245	/* display device to off state */
+
+#define KEY_WIMAX		246
 
 #define BTN_MISC		0x100
 #define BTN_0			0x100
include/linux/rfkill.h +2 -0
diff -r a52d5e9e9c91 include/linux/rfkill.h
@@ -33,11 +33,13 @@
  * RFKILL_TYPE_WLAN: switch is on a 802.11 wireless network device.
  * RFKILL_TYPE_BLUETOOTH: switch is on a bluetooth device.
  * RFKILL_TYPE_UWB: switch is on a ultra wideband device.
+ * RFKILL_TYPE_WIMAX: switch is on a WiMAX device.
  */
 enum rfkill_type {
 	RFKILL_TYPE_WLAN ,
 	RFKILL_TYPE_BLUETOOTH,
 	RFKILL_TYPE_UWB,
+	RFKILL_TYPE_WIMAX,
 	RFKILL_TYPE_MAX,
 };
 
net/rfkill/rfkill-input.c +10 -1
diff -r a52d5e9e9c91 net/rfkill/rfkill-input.c
@@ -84,6 +84,7 @@ static DEFINE_RFKILL_TASK(rfkill_wlan, R
 static DEFINE_RFKILL_TASK(rfkill_wlan, RFKILL_TYPE_WLAN);
 static DEFINE_RFKILL_TASK(rfkill_bt, RFKILL_TYPE_BLUETOOTH);
 static DEFINE_RFKILL_TASK(rfkill_uwb, RFKILL_TYPE_UWB);
+static DEFINE_RFKILL_TASK(rfkill_wimax, RFKILL_TYPE_WIMAX);
 
 static void rfkill_event(struct input_handle *handle, unsigned int type,
 			unsigned int code, int down)
@@ -98,6 +99,9 @@ static void rfkill_event(struct input_ha
 			break;
 		case KEY_UWB:
 			rfkill_schedule_toggle(&rfkill_uwb);
+			break;
+		case KEY_WIMAX:
+			rfkill_schedule_toggle(&rfkill_wimax);
 			break;
 		default:
 			break;
@@ -150,7 +154,7 @@ static const struct input_device_id rfki
 		.keybit = { [BIT_WORD(KEY_WLAN)] = BIT_MASK(KEY_WLAN) },
 	},
 	{
-		.flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT,
+ 		.flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT,
 		.evbit = { BIT_MASK(EV_KEY) },
 		.keybit = { [BIT_WORD(KEY_BLUETOOTH)] = BIT_MASK(KEY_BLUETOOTH) },
 	},
@@ -158,6 +162,11 @@ static const struct input_device_id rfki
 		.flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT,
 		.evbit = { BIT_MASK(EV_KEY) },
 		.keybit = { [BIT_WORD(KEY_UWB)] = BIT_MASK(KEY_UWB) },
+	},
+	{
+		.flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT,
+		.evbit = { BIT_MASK(EV_KEY) },
+		.keybit = { [BIT_WORD(KEY_WIMAX)] = BIT_MASK(KEY_WIMAX) },
 	},
 	{ }
 };
net/rfkill/rfkill.c +3 -0
diff -r a52d5e9e9c91 net/rfkill/rfkill.c
@@ -126,6 +126,9 @@ static ssize_t rfkill_type_show(struct d
 	case RFKILL_TYPE_UWB:
 		type = "ultrawideband";
 		break;
+	case RFKILL_TYPE_WIMAX:
+		type = "wimax";
+		break;
 	default:
 		BUG();
 	}
#1 lore raw
Quoted 4 lines · Inaky Perez-Gonzalez

rfkill: add the WiMAX radio type

Teach rfkill about wimax radios.

Quoted 8 lines

Had to define a KEY_WIMAX as a 'key for disabling only wimax radios', as other radio technologies have. This makes sense as hardware has specific keys for disabling specific radios.

The RFKILL enabling part is, otherwise, a copy and paste of any other radio technology.

For the rfkill part of the patch:

Quoted 87 lines

---

diff -r a52d5e9e9c91 include/linux/input.h

include/linux/input.h +2 -0
@@ -362,6 +362,8 @@ struct input_absinfo {
 #define KEY_BRIGHTNESS_CYCLE	243	/* brightness up, after max is min */
 #define KEY_BRIGHTNESS_ZERO	244	/* brightness off, use ambient */
 #define KEY_DISPLAY_OFF		245	/* display device to off state */
+
+#define KEY_WIMAX		246
 
 #define BTN_MISC		0x100
 #define BTN_0			0x100

diff -r a52d5e9e9c91 include/linux/rfkill.h

include/linux/rfkill.h +2 -0
@@ -33,11 +33,13 @@
  * RFKILL_TYPE_WLAN: switch is on a 802.11 wireless network device.
  * RFKILL_TYPE_BLUETOOTH: switch is on a bluetooth device.
  * RFKILL_TYPE_UWB: switch is on a ultra wideband device.
+ * RFKILL_TYPE_WIMAX: switch is on a WiMAX device.
  */
 enum rfkill_type {
 	RFKILL_TYPE_WLAN ,
 	RFKILL_TYPE_BLUETOOTH,
 	RFKILL_TYPE_UWB,
+	RFKILL_TYPE_WIMAX,
 	RFKILL_TYPE_MAX,
 };
 

diff -r a52d5e9e9c91 net/rfkill/rfkill-input.c

net/rfkill/rfkill-input.c +10 -1
@@ -84,6 +84,7 @@ static DEFINE_RFKILL_TASK(rfkill_wlan, R
 static DEFINE_RFKILL_TASK(rfkill_wlan, RFKILL_TYPE_WLAN);
 static DEFINE_RFKILL_TASK(rfkill_bt, RFKILL_TYPE_BLUETOOTH);
 static DEFINE_RFKILL_TASK(rfkill_uwb, RFKILL_TYPE_UWB);
+static DEFINE_RFKILL_TASK(rfkill_wimax, RFKILL_TYPE_WIMAX);
 
 static void rfkill_event(struct input_handle *handle, unsigned int type,
 			unsigned int code, int down)
@@ -98,6 +99,9 @@ static void rfkill_event(struct input_ha
 			break;
 		case KEY_UWB:
 			rfkill_schedule_toggle(&rfkill_uwb);
+			break;
+		case KEY_WIMAX:
+			rfkill_schedule_toggle(&rfkill_wimax);
 			break;
 		default:
 			break;
@@ -150,7 +154,7 @@ static const struct input_device_id rfki
 		.keybit = { [BIT_WORD(KEY_WLAN)] = BIT_MASK(KEY_WLAN) },
 	},
 	{
-		.flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT,
+ 		.flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT,
 		.evbit = { BIT_MASK(EV_KEY) },
 		.keybit = { [BIT_WORD(KEY_BLUETOOTH)] = BIT_MASK(KEY_BLUETOOTH) },
 	},
@@ -158,6 +162,11 @@ static const struct input_device_id rfki
 		.flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT,
 		.evbit = { BIT_MASK(EV_KEY) },
 		.keybit = { [BIT_WORD(KEY_UWB)] = BIT_MASK(KEY_UWB) },
+	},
+	{
+		.flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT,
+		.evbit = { BIT_MASK(EV_KEY) },
+		.keybit = { [BIT_WORD(KEY_WIMAX)] = BIT_MASK(KEY_WIMAX) },
 	},
 	{ }
 };

diff -r a52d5e9e9c91 net/rfkill/rfkill.c

net/rfkill/rfkill.c +3 -0
@@ -126,6 +126,9 @@ static ssize_t rfkill_type_show(struct d
 	case RFKILL_TYPE_UWB:
 		type = "ultrawideband";
 		break;
+	case RFKILL_TYPE_WIMAX:
+		type = "wimax";
+		break;
 	default:
 		BUG();
 	}
#2 lore raw

Ouch, I forgot to CC Dimitry :( My apologies

Quoted 9 lines · Ivo van Doorn
Quoted 8 lines · Inaky Perez-Gonzalez

rfkill: add the WiMAX radio type

Teach rfkill about wimax radios.

Had to define a KEY_WIMAX as a 'key for disabling only wimax radios', as other radio technologies have. This makes sense as hardware has specific keys for disabling specific radios.

Quoted 7 lines
Quoted 4 lines

The RFKILL enabling part is, otherwise, a copy and paste of any other radio technology.

For the rfkill part of the patch:

Dimitry, are you ok with the include/linux/input.h part \
of the patch below (chopped); full version at

http://marc.info/?l=linux-wireless&m=120112423923171&w=2

Quoted 16 lines
Quoted 16 lines

---

diff -r a52d5e9e9c91 include/linux/input.h

include/linux/input.h +2 -0
@@ -362,6 +362,8 @@ struct input_absinfo {
 #define KEY_BRIGHTNESS_CYCLE	243	/* brightness up, after max is min */
 #define KEY_BRIGHTNESS_ZERO	244	/* brightness off, use ambient */
 #define KEY_DISPLAY_OFF		245	/* display device to off state */
+
+#define KEY_WIMAX		246
 
 #define BTN_MISC		0x100
 #define BTN_0			0x100

diff -r a52d5e9e9c91 include/linux/rfkill.h

maintainer
#3 lore raw

Hi Inaky,

Quoted 19 lines · Inaky Perez-Gonzalez

Dimitry, are you ok with the include/linux/input.h part \
of the patch below (chopped); full version at

http://marc.info/?l=linux-wireless&m=120112423923171&w=2

Quoted 13 lines
Quoted 13 lines

---

diff -r a52d5e9e9c91 include/linux/input.h

include/linux/input.h +2 -0
@@ -362,6 +362,8 @@ struct input_absinfo {
 #define KEY_BRIGHTNESS_CYCLE	243	/* brightness up, after max is min */
 #define KEY_BRIGHTNESS_ZERO	244	/* brightness off, use ambient */
 #define KEY_DISPLAY_OFF		245	/* display device to off state */
+
+#define KEY_WIMAX		246
 
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
include/linux/input.h +0 -0
 #define BTN_MISC		0x100
 #define BTN_0			0x100

diff -r a52d5e9e9c91 include/linux/rfkill.h

Yes, that should work, thank you. This will go through the network tree, right?

Signature · 1 line
Dmitry
#4 lore raw
Quoted 2 lines · Dmitry Torokhov

Yes, that should work, thank you. This will go through the network tree, right?

Yes, I've got it.

Thanks,

John

Signature · 2 lines
John W. Linville
[email protected]
#5 lore raw
Quoted 6 lines · John W. Linville
Quoted 2 lines · Dmitry Torokhov

Yes, that should work, thank you. This will go through the network tree, right?

Yes, I've got it.

Thank you all :)

#6 lore raw
In reply to Inaky Perez-Gonzalez

net/rfkill/rfkill-input.c static const struct input_device_id rfki · line 157

Quoted 6 lines · On Wednesday 23 January 2008 22:24:38 Inaky Perez-Gonzalez wrote:
net/rfkill/rfkill-input.c +1 -1
@@ -150,7 +154,7 @@ static const struct input_device_id rfki
 		.keybit = { [BIT_WORD(KEY_WLAN)] = BIT_MASK(KEY_WLAN) },
 	},
 	{
-		.flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT,
+ 		.flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT,

Why are you adding a bogus whitespace to the start of the line here?

Quoted 3 lines
net/rfkill/rfkill-input.c +0 -0
 		.evbit = { BIT_MASK(EV_KEY) },
 		.keybit = { [BIT_WORD(KEY_BLUETOOTH)] = BIT_MASK(KEY_BLUETOOTH) },
 	},
Signature · 1 line
Greetings Michael.
#7 lore raw
Quoted 9 lines · Michael Buesch

Review static const struct input_device_id rfki · line 157

Quoted 6 lines · On Wednesday 23 January 2008 22:24:38 Inaky Perez-Gonzalez wrote:
(quoted diff) +1 -1
@@ -150,7 +154,7 @@ static const struct input_device_id rfki
 		.keybit = { [BIT_WORD(KEY_WLAN)] = BIT_MASK(KEY_WLAN) },
 	},
 	{
-		.flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT,
+ 		.flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT,

Why are you adding a bogus whitespace to the start of the line here?

My mistake, fixed. Thanks! -- updated patch follows

---
rfkill: add the WiMAX radio type

Teach rfkill about wimax radios.

Had to define a KEY_WIMAX as a 'key for disabling only wimax radios', as other radio technologies have. This makes sense as hardware has specific keys for disabling specific radios.

The RFKILL enabling part is, otherwise, a copy and paste of any other radio technology.

---

include/linux/input.h +2 -0
diff -r a52d5e9e9c91 include/linux/input.h
@@ -362,6 +362,8 @@ struct input_absinfo {
 #define KEY_BRIGHTNESS_CYCLE	243	/* brightness up, after max is min */
 #define KEY_BRIGHTNESS_ZERO	244	/* brightness off, use ambient */
 #define KEY_DISPLAY_OFF		245	/* display device to off state */
+
+#define KEY_WIMAX		246
 
 #define BTN_MISC		0x100
 #define BTN_0			0x100
include/linux/rfkill.h +2 -0
diff -r a52d5e9e9c91 include/linux/rfkill.h
@@ -33,11 +33,13 @@
  * RFKILL_TYPE_WLAN: switch is on a 802.11 wireless network device.
  * RFKILL_TYPE_BLUETOOTH: switch is on a bluetooth device.
  * RFKILL_TYPE_UWB: switch is on a ultra wideband device.
+ * RFKILL_TYPE_WIMAX: switch is on a WiMAX device.
  */
 enum rfkill_type {
 	RFKILL_TYPE_WLAN ,
 	RFKILL_TYPE_BLUETOOTH,
 	RFKILL_TYPE_UWB,
+	RFKILL_TYPE_WIMAX,
 	RFKILL_TYPE_MAX,
 };
 
net/rfkill/rfkill-input.c +9 -0
diff -r a52d5e9e9c91 net/rfkill/rfkill-input.c
@@ -84,6 +84,7 @@ static DEFINE_RFKILL_TASK(rfkill_wlan, R
 static DEFINE_RFKILL_TASK(rfkill_wlan, RFKILL_TYPE_WLAN);
 static DEFINE_RFKILL_TASK(rfkill_bt, RFKILL_TYPE_BLUETOOTH);
 static DEFINE_RFKILL_TASK(rfkill_uwb, RFKILL_TYPE_UWB);
+static DEFINE_RFKILL_TASK(rfkill_wimax, RFKILL_TYPE_WIMAX);
 
 static void rfkill_event(struct input_handle *handle, unsigned int type,
 			unsigned int code, int down)
@@ -98,6 +99,9 @@ static void rfkill_event(struct input_ha
 			break;
 		case KEY_UWB:
 			rfkill_schedule_toggle(&rfkill_uwb);
+			break;
+		case KEY_WIMAX:
+			rfkill_schedule_toggle(&rfkill_wimax);
 			break;
 		default:
 			break;
@@ -158,6 +162,11 @@ static const struct input_device_id rfki
 		.flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT,
 		.evbit = { BIT_MASK(EV_KEY) },
 		.keybit = { [BIT_WORD(KEY_UWB)] = BIT_MASK(KEY_UWB) },
+	},
+	{
+		.flags = INPUT_DEVICE_ID_MATCH_EVBIT | INPUT_DEVICE_ID_MATCH_KEYBIT,
+		.evbit = { BIT_MASK(EV_KEY) },
+		.keybit = { [BIT_WORD(KEY_WIMAX)] = BIT_MASK(KEY_WIMAX) },
 	},
 	{ }
 };
net/rfkill/rfkill.c +3 -0
diff -r a52d5e9e9c91 net/rfkill/rfkill.c
@@ -126,6 +126,9 @@ static ssize_t rfkill_type_show(struct d
 	case RFKILL_TYPE_UWB:
 		type = "ultrawideband";
 		break;
+	case RFKILL_TYPE_WIMAX:
+		type = "wimax";
+		break;
 	default:
 		BUG();
 	}