Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Mar 2017 22:07:21 +0000 (UTC)
From:      Andriy Voskoboinyk <avos@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r315966 - head/sys/dev/iwn
Message-ID:  <201703252207.v2PM7L4Z010243@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avos
Date: Sat Mar 25 22:07:21 2017
New Revision: 315966
URL: https://svnweb.freebsd.org/changeset/base/315966

Log:
  iwn: fix return code conflict in iwn_init_locked()
  
  Do not try to use errno(2) codes here; instead, just return unique
  value (1) when radio is disabled via hardware switch and another
  one (-1) for any other error in initialization path.
  
  Tested with Intel 6205, STA mode.

Modified:
  head/sys/dev/iwn/if_iwn.c

Modified: head/sys/dev/iwn/if_iwn.c
==============================================================================
--- head/sys/dev/iwn/if_iwn.c	Sat Mar 25 21:46:02 2017	(r315965)
+++ head/sys/dev/iwn/if_iwn.c	Sat Mar 25 22:07:21 2017	(r315966)
@@ -5120,7 +5120,7 @@ iwn_parent(struct ieee80211com *ic)
 		case 0:
 			ieee80211_start_all(ic);
 			break;
-		case EAGAIN:
+		case 1:
 			/* radio is disabled via RFkill switch */
 			taskqueue_enqueue(sc->sc_tq, &sc->sc_rftoggle_task);
 			break;
@@ -8879,8 +8879,10 @@ iwn_init_locked(struct iwn_softc *sc)
 
 	/* Check that the radio is not disabled by hardware switch. */
 	if (!(IWN_READ(sc, IWN_GP_CNTRL) & IWN_GP_CNTRL_RFKILL)) {
-		error = EAGAIN;
-		goto fail;
+		iwn_stop_locked(sc);
+		DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end\n",__func__);
+
+		return (1);
 	}
 
 	/* Read firmware images from the filesystem. */
@@ -8921,7 +8923,7 @@ fail:
 
 	DPRINTF(sc, IWN_DEBUG_TRACE, "->%s: end in error\n",__func__);
 
-	return (error);
+	return (-1);
 }
 
 static int



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703252207.v2PM7L4Z010243>