From nobody@FreeBSD.org  Fri Sep  6 19:26:03 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTP id 1239CAC0
	for <freebsd-gnats-submit@FreeBSD.org>; Fri,  6 Sep 2013 19:26:03 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id E570029C0
	for <freebsd-gnats-submit@FreeBSD.org>; Fri,  6 Sep 2013 19:26:02 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r86JQ2HD091096
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 6 Sep 2013 19:26:02 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r86JQ2gX091092;
	Fri, 6 Sep 2013 19:26:02 GMT
	(envelope-from nobody)
Message-Id: <201309061926.r86JQ2gX091092@oldred.freebsd.org>
Date: Fri, 6 Sep 2013 19:26:02 GMT
From: Johannes Jost Meixner <xmj@chaot.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Centrino Advanced-N 6235 with latest iwn(4) 
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         181898
>Category:       kern
>Synopsis:       [iwn] [patch] Centrino Advanced-N 6235 with latest iwn(4)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-wireless
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Fri Sep 06 19:30:00 UTC 2013
>Closed-Date:    Tue Feb 11 05:27:21 UTC 2014
>Last-Modified:  Tue Feb 11 05:27:21 UTC 2014
>Originator:     Johannes Jost Meixner
>Release:        10.0-CURRENT
>Organization:
Goldener Grund OUe
>Environment:
FreeBSD mx12 10.0-CURRENT FreeBSD 10.0-CURRENT #1 r255210M: Thu Sep  5 00:23:11 EEST 2013     root@mx12:/usr/obj/usr/src/sys/xmj.debug  amd64

>Description:
I submitted kern/173898 a while back, and iwn(4) has been working on my laptop
since last November. As said before, HT40 does not (yet?) work on the chip.
However, at least throughput on my box is okay.

The diff attached to this integrates 
http://people.freebsd.org/~mav/iwn6235.patch
and is compatible with the commits that touched iwn in August/September.

>How-To-Repeat:

>Fix:


Patch attached with submission follows:

Index: sys/dev/iwn/if_iwn.c
===================================================================
--- sys/dev/iwn/if_iwn.c	(revision 255210)
+++ sys/dev/iwn/if_iwn.c	(working copy)
@@ -115,6 +115,8 @@
 	{ 0x8086, IWN_DID_5x00_2, "Intel WiFi Link 5100"			},
 	{ 0x8086, IWN_DID_6x00_3, "Intel Centrino Ultimate-N 6300"		},
 	{ 0x8086, IWN_DID_6x00_4, "Intel Centrino Advanced-N 6200"		},
+    { 0x8086, IWN_DID_6235_1, "Intel Centrino Advanced-N 6235"      },
+    { 0x8086, IWN_DID_6235_2, "Intel Centrino Advanced-N 6235"      },
 	{ 0x8086, IWN_DID_5x50_1, "Intel WiMAX/WiFi Link 5350"			},
 	{ 0x8086, IWN_DID_5x50_2, "Intel WiMAX/WiFi Link 5350"			},
 	{ 0x8086, IWN_DID_5x50_3, "Intel WiMAX/WiFi Link 5150"			},
@@ -861,6 +863,9 @@
 		if (pid != 0x0082 && pid != 0x0085) {
 			sc->fwname = "iwn6000g2bfw";
 			sc->sc_flags |= IWN_FLAG_ADV_BTCOEX;
+		    /* xmj 3lines Override chains masks, ROM is known to be broken. */
+		    sc->txchainmask = IWN_ANT_AB;
+		    sc->rxchainmask = IWN_ANT_AB;
 		} else
 			sc->fwname = "iwn6000g2afw";
 		break;
@@ -5213,7 +5218,7 @@
 	cmd.energy_cck         = htole16(calib->energy_cck);
 	/* Barker modulation: use default values. */
 	cmd.corr_barker        = htole16(190);
-	cmd.corr_barker_mrc    = htole16(390);
+	cmd.corr_barker_mrc    = htole16(sc->limits->barker_mrc);
 
 	DPRINTF(sc, IWN_DEBUG_CALIBRATE,
 	    "%s: set sensitivity %d/%d/%d/%d/%d/%d/%d\n", __func__,
@@ -5799,7 +5804,7 @@
 		sc->rxon->ofdm_mask = 0;
 	} else {
 		/* Assume 802.11b/g. */
-		sc->rxon->cck_mask  = 0x0f;
+		sc->rxon->cck_mask  = 0x03;
 		sc->rxon->ofdm_mask = 0x15;
 	}
 	if (IEEE80211_IS_CHAN_HT(ni->ni_chan)) {
@@ -7059,12 +7064,11 @@
 		/* Use internal power amplifier only. */
 		IWN_WRITE(sc, IWN_GP_DRIVER, IWN_GP_DRIVER_RADIO_2X2_IPA);
 	}
-	if ((sc->hw_type == IWN_HW_REV_TYPE_6050 ||
-	     sc->hw_type == IWN_HW_REV_TYPE_6005) && sc->calib_ver >= 6) {
+	if (sc->hw_type == IWN_HW_REV_TYPE_6050 && sc->calib_ver >= 6) {
 		/* Indicate that ROM calibration version is >=6. */
 		IWN_SETBITS(sc, IWN_GP_DRIVER, IWN_GP_DRIVER_CALIB_VER6);
 	}
-	if (sc->hw_type == IWN_HW_REV_TYPE_6005)
+	if (sc->hw_type == IWN_HW_REV_TYPE_6050)
 		IWN_SETBITS(sc, IWN_GP_DRIVER, IWN_GP_DRIVER_6050_1X2);
 	return 0;
 }
Index: sys/dev/iwn/if_iwn_devid.h
===================================================================
--- sys/dev/iwn/if_iwn_devid.h	(revision 255210)
+++ sys/dev/iwn/if_iwn_devid.h	(working copy)
@@ -156,7 +156,16 @@
 #define	IWN_SDID_6035_2		0x4260
 #define	IWN_SDID_6035_3		0x4460
 #define	IWN_SDID_6035_4		0x4860
+
 /*
+ * This includes Centrino Advanced-N 6235
+ */
+
+#define IWN_DID_6235_1		0x088e 
+#define IWN_DID_6235_2		0x088f
+
+
+/*
  * --------------------------------------------------------------------------
  * Device ID for 1030 and 6030 Series
  * --------------------------------------------------------------------------
Index: sys/dev/iwn/if_iwnreg.h
===================================================================
--- sys/dev/iwn/if_iwnreg.h	(revision 255210)
+++ sys/dev/iwn/if_iwnreg.h	(working copy)
@@ -1891,6 +1891,7 @@
 	uint32_t	min_energy_cck;
 	uint32_t	energy_cck;
 	uint32_t	energy_ofdm;
+	uint32_t	barker_mrc;
 };
 
 /*
@@ -1905,7 +1906,8 @@
 	200, 400,
 	 97,
 	100,
-	100
+	100,
+	390
 };
 
 static const struct iwn_sensitivity_limits iwn5000_sensitivity_limits = {
@@ -1917,7 +1919,8 @@
 	170, 400,
 	 95,
 	 95,
-	 95
+	 95,
+	390
 };
 
 static const struct iwn_sensitivity_limits iwn5150_sensitivity_limits = {
@@ -1929,7 +1932,8 @@
 	170, 400,
 	 95,
 	 95,
-	 95
+	 95,
+	390
 };
 
 static const struct iwn_sensitivity_limits iwn1000_sensitivity_limits = {
@@ -1941,7 +1945,8 @@
 	170, 400,
 	 95,
 	 95,
-	 95
+	 95,
+	390
 };
 
 static const struct iwn_sensitivity_limits iwn6000_sensitivity_limits = {
@@ -1951,9 +1956,10 @@
 	128, 232,
 	125, 175,
 	160, 310,
-	 97,
-	 97,
-	100
+	110,
+	110,
+	110,
+	336
 };
 
 /* Get value from linux kernel 3.2.+ in Drivers/net/wireless/iwlwifi/iwl-2000.c*/
Index: sys/modules/iwnfw/iwn6000g2b/Makefile
===================================================================
--- sys/modules/iwnfw/iwn6000g2b/Makefile	(revision 255210)
+++ sys/modules/iwnfw/iwn6000g2b/Makefile	(working copy)
@@ -1,6 +1,6 @@
 # $FreeBSD$
 
 KMOD=	iwn6000g2bfw
-IMG=	iwlwifi-6000g2b-17.168.5.2
+IMG=	iwlwifi-6000g2b-18.168.6.1
 
 .include <bsd.kmod.mk>


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-wireless 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Fri Sep 6 20:15:19 UTC 2013 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=181898 
State-Changed-From-To: open->closed 
State-Changed-By: adrian 
State-Changed-When: Tue Feb 11 05:27:15 UTC 2014 
State-Changed-Why:  
fixed in -head 


http://www.freebsd.org/cgi/query-pr.cgi?pr=181898 
>Unformatted:
