9front - general discussion about 9front
 help / color / mirror / Atom feed
From: kemal <kemalinanc8@gmail.com>
To: 9front@9front.org
Subject: Re: [9front] driver for intel wireless 7260?
Date: Wed, 4 Aug 2021 20:50:06 +0000	[thread overview]
Message-ID: <CABO6shebP2EbWxcbH9aRGRj3r15e4t_pWt0=6wuAZduoT2YBhw@mail.gmail.com> (raw)
In-Reply-To: <trinity-ef6d725c-8c4c-49ae-afe2-93a8fce2b1ad-1627370490043@3c-app-gmx-bs58>

[-- Attachment #1: Type: text/plain, Size: 742 bytes --]

2021-07-27 7:21 GMT, Eckard Brauer <eckard.brauer@gmx.de>:
> Just a few weeks ago, I had some mailing with Kemal for that topic, as
> he tried to help me on that. My little understanding reached it's end
> early, and unfortunately we had no luck getting the card to work
> finally, but Kemal already did some patches I tried out.

correct. (except for the few weeks part, it has been months :))

just now i cleaned up those patches and now i have a diff that
should work. it can be applied with `ape/patch -p0 < diff.txt`

this diff might work with 3160, but requires normal additions like
pci ids etc. PLUS this line:

"	if(ctlr->type == Type7260){"

being changed to

"	if(ctlr->type == Type7260 || ctlr->type == Type3160){

hope it works.

[-- Attachment #2: diff.txt --]
[-- Type: text/plain, Size: 2419 bytes --]

--- /sys/src/9/pc/etheriwl.c
+++ /sys/src/9/pc/etheriwl.c
@@ -1,9 +1,10 @@
 /*
  * Intel WiFi Link driver.
  *
- * Written without any documentation but Damien Bergaminis
- * OpenBSD iwn(4) and iwm(4) driver sources. Requires intel
- * firmware to be present in /lib/firmware/iwn-* on attach.
+ * Written without any documentation but Damien Bergamini's
+ * iwn(4) and Stefan Sperling's iwm(4) OpenBSD driver sources.
+ * Requires Intel firmware to be present in /lib/firmware/iw[nm]-*
+ * on attach.
  */
 
 #include "u.h"
@@ -242,6 +243,8 @@
 
 	SbCpu1Status	= 0xa01e30,
 	SbCpu2Status	= 0xa01e34,
+	OscClk		= 0xa04068,
+		OscClkCtrl	= 1<<3,
 	UregChick	= 0xa05c00,
 		UregChickMsiEnable	= 1<<24,
 
@@ -631,6 +634,7 @@
 	Type6005	= 11,	/* also Centrino Advanced-N 6030, 6235 */
 	Type2030	= 12,
 	Type2000	= 16,
+	Type7260	= 30,
 
 	Type8265	= 35,
 };
@@ -686,6 +690,7 @@
 	[Type6005] "iwn-6005", /* see in iwlattach() below */
 	[Type2030] "iwn-2030",
 	[Type2000] "iwn-2000",
+	[Type7260] "iwm-7260-17",
 };
 
 static char *qcmd(Ctlr *ctlr, uint qid, uint code, uchar *data, int size, Block *block);
@@ -1088,6 +1093,22 @@
 		nicunlock(ctlr);
 	}
 
+	/* Enable the oscillator to count wake up time for L1 exit. (weird W/A) */
+	if(ctlr->type == Type7260){
+		if((err = niclock(ctlr)) != nil)
+			return err;
+
+		prphread(ctlr, OscClk);
+		prphread(ctlr, OscClk);
+		delay(20);
+
+		prphwrite(ctlr, OscClk, prphread(ctlr, OscClk) | OscClkCtrl);
+
+		prphread(ctlr, OscClk);
+		prphread(ctlr, OscClk);
+
+		nicunlock(ctlr);
+	}
 	if(ctlr->family < 8000){
 		if((err = niclock(ctlr)) != nil)
 			return err;
@@ -3416,6 +3437,12 @@
 		iunlock(ctlr);
 		return "qcmd: broken";
 	}
+	/* wake up the nic (just needed for 7k) */
+	if(ctlr->family == 7000 && q->n == 0)
+		if(niclock(ctlr) != nil){
+			iunlock(ctlr);
+			return "qcmd: busy";
+		}
 	q->n++;
 	q->lastcmd = code;
 
@@ -4242,6 +4269,9 @@
 		if(tx != nil && tx->n > 0){
 			tx->n--;
 			wakeup(tx);
+			/* unlock 7k family nics as all commands are done */
+			if(ctlr->family == 7000 && tx->n == 0)
+				nicunlock(ctlr);
 		}
 	}
 
@@ -4349,6 +4379,11 @@
 		case 0x088e:	/* Centrino Advanced-N 6235 */
 		case 0x088f:	/* Centrino Advanced-N 6235 */
 			family = 0;
+			fwname = nil;
+			break;
+		case 0x08b1:	/* Wireless AC 7260 */
+		case 0x08b2:	/* Wireless AC 7260 */
+			family = 7000;
 			fwname = nil;
 			break;
 		case 0x24f3:	/* Wireless AC 8260 */

  reply	other threads:[~2021-08-05  0:39 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-26 16:30 Skylar Bleed
2021-07-26 19:29 ` cinap_lenrek
2021-07-27  7:21   ` Aw: " Eckard Brauer
2021-08-04 20:50     ` kemal [this message]
2021-08-05  0:32       ` kemal
2021-08-05  7:52         ` cinap_lenrek
2021-08-05 12:41           ` kemal
2021-08-05 21:19             ` Eckard Brauer
2021-08-05 22:33             ` cinap_lenrek
2021-07-27  8:17   ` Aw: " Eckard Brauer
2021-07-30 21:19     ` unobe
2021-08-06  4:43 qwx
2021-08-06  4:57 ` Skylar Bleed
2021-08-06 10:06 ` cinap_lenrek
2021-08-06 17:56   ` Skylar Bleed
2021-08-06 23:48     ` cinap_lenrek
2021-08-07  2:59       ` Skylar Bleed
2021-08-07 11:16         ` cinap_lenrek
2021-08-07 14:39           ` Skylar Bleed
2021-08-07 22:14             ` kemal
2021-08-08 14:35               ` Skylar Bleed
2021-08-09 12:05               ` kemal
2021-08-10 15:11                 ` Skylar Bleed
2021-08-12 21:03                   ` kemal
2021-08-13 19:49                     ` Skylar Bleed
2021-08-14 13:26                       ` kemal
2021-08-13 23:41                     ` kemal
2021-08-14 17:25                       ` cinap_lenrek
2021-08-14 17:50                       ` kemal
2021-08-07 22:27             ` ori
2021-08-07 10:30     ` kemal
2021-08-06 14:07 ` kemal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CABO6shebP2EbWxcbH9aRGRj3r15e4t_pWt0=6wuAZduoT2YBhw@mail.gmail.com' \
    --to=kemalinanc8@gmail.com \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).