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: Sat, 7 Aug 2021 22:14:58 +0000	[thread overview]
Message-ID: <CABO6shfLWRxvNWU59MeeNp5Y5CAFp_YAX2dbkCTpm173FiRvtg@mail.gmail.com> (raw)
In-Reply-To: <TdXYvuoDtM1kc8kdZC8dOJ-CpEsHpmLKSYjX6j2nFDFg32wl3wS2C4bT4UUiVALVmiC0fVVU4VAOK9nb_PVIF93e3Q3kdapSFaNcf_S7328=@protonmail.ch>

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

2021-08-07 14:39 GMT, Skylar Bleed <skylarbleed@protonmail.ch>:
> I can't send the output in text form because it can't connect to the
> internet, but I've attached a picture of my screen.

ok, this is the firmware error that also happened on qwx's 7260.

now with qwx we have managed to solve 2 firmware errors that
happened:

1-the error you just sent. the line that was reading the mac
address from the nvm failed. why? apparently fw doesn't like
us reading just 6 bytes, reading 8 bytes works... wtf...
2-sendmccupdate spitted a BAD_COMMAND error. apparently
7260 doesn't support the mcc update command, so check the
ucode capabilities to see if we can run it.

now we're still facing one more firmware error, this one:

http://okturing.com/src/11797/body

for some reason, any command on rxoff7000 fails with
BAD_COMMAND. i didn't see anything wrong with command
data, and 7260 supports these, so i am kind of puzzled why it
happens. will look into it tommorow.

if someone wonders, the changes we made are attached in
diff.txt

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

--- /sys/src/9/pc/etheriwl.c
+++ /sys/src/9/pc/etheriwl.c
@@ -329,7 +329,18 @@
 	SchedTransTblOff	= 0x7E0,		// +q*2
 };
 
+/*
+ * uCode capabilities
+ */
 enum {
+	/* capa[0] */
+	UcodeCapLar	= (1<<1),
+	
+	/* capa[2] */
+	UcodeCapLar2	= (1<<9),
+};
+
+enum {
 	FilterPromisc		= 1<<0,
 	FilterCtl		= 1<<1,
 	FilterMulticast		= 1<<2,
@@ -635,7 +646,7 @@
 	Type2030	= 12,
 	Type2000	= 16,
 
-	Type7260	= 30,
+	Type7260	= 20,
 	Type8265	= 35,
 };
 
@@ -1984,7 +1995,7 @@
 	*p++ = mcc[0];
 	*p++ = 0;
 	*p++ = 0;	// reserved
-	if(1){
+	if(ctlr->fw->capa[2] & UcodeCapLar2){
 		p += 4;
 		p += 5*4;
 	}
@@ -2272,7 +2283,9 @@
 			ea[5] = a1 >> 0;
 		}
 	} else {
-		readnvmsect(ctlr, 0, ea, Eaddrlen, 0x15<<1);
+		/* fw gets angry if we read 6 bytes instead of 8 */
+		readnvmsect(ctlr, 0, buf, 8, 0x15<<1);
+		memmove(ea, buf, Eaddrlen);
 	}
 	memmove(ctlr->edev->addr, ea, Eaddrlen);
 
@@ -2822,13 +2835,13 @@
 	return cmd(ctlr, 210, c, 11*4);
 }
 
-static void
+static char*
 tttxbackoff(Ctlr *ctlr)
 {
 	uchar c[4];
 	
 	put32(c, 0);
-	cmd(ctlr, 126, c, sizeof(c));
+	return cmd(ctlr, 126, c, sizeof(c));
 }
 
 static char*
@@ -2897,16 +2910,16 @@
 
 		/* Initialize tx backoffs to the minimum. */
 		if(ctlr->family == 7000)
-			tttxbackoff(ctlr);
+			if((err = tttxbackoff(ctlr)) != nil)
+				return err;
 
 		if((err = updatedevicepower(ctlr)) != nil){
 			print("can't update device power: %s\n", err);
 			return err;
 		}
-		if((err = sendmccupdate(ctlr, "ZZ")) != nil){
-			print("can't disable beacon filter: %s\n", err);
-			return err;
-		}
+		if(ctlr->fw->capa[0] & UcodeCapLar)
+			if((err = sendmccupdate(ctlr, "ZZ")) != nil)
+				return err;
 		if((err = disablebeaconfilter(ctlr)) != nil){
 			print("can't disable beacon filter: %s\n", err);
 			return err;
@@ -3452,7 +3465,7 @@
 		return "qcmd: broken";
 	}
 	/* wake up the nic (just needed for 7k) */
-	if(ctlr->family == 7000 && q->n == 0)
+	if(ctlr->family == 7000 && qid == 4 && q->n == 0)
 		if(niclock(ctlr) != nil){
 			iunlock(ctlr);
 			return "qcmd: busy";
@@ -4283,8 +4296,8 @@
 		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)
+			/* unlock 7k family nics as the command is done */
+			if(ctlr->family == 7000 && qid == 4 && tx->n == 0)
 				nicunlock(ctlr);
 		}
 	}

  reply	other threads:[~2021-08-08  9:07 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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
  -- strict thread matches above, loose matches on Subject: below --
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
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

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=CABO6shfLWRxvNWU59MeeNp5Y5CAFp_YAX2dbkCTpm173FiRvtg@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).