git: 9front

Download patch

ref: 60f433a0719dc54c67c84d352e59cc6343af71f7
parent: b830655219df51b8db6af8f4f47ae2609f729e1b
author: cinap_lenrek <cinap_lenrek@gmx.de>
date: Sat Feb 9 19:14:17 EST 2013

etheriwl: check RF-Kill switch on attach

--- a/sys/src/9/pc/etheriwl.c
+++ b/sys/src/9/pc/etheriwl.c
@@ -1309,6 +1309,11 @@
 		nexterror();
 	}
 	if(ctlr->attached == 0){
+		if((csr32r(ctlr, Gpc) & RfKill) == 0){
+			print("#l%d: wifi disabled by switch\n", edev->ctlrno);
+			error("wifi disabled by switch");
+		}
+
 		if(ctlr->wifi == nil)
 			ctlr->wifi = wifiattach(edev, transmit);
 
--