Author: adrian
Date: Tue Apr 26 01:29:26 2016
New Revision: 298605
URL: https://svnweb.freebsd.org/changeset/base/298605

Log:
  [net80211] add the STBC ioctl support.
  
  This adds configurable STBC TX and RX support.

Modified:
  head/sys/net80211/ieee80211_ioctl.c

Modified: head/sys/net80211/ieee80211_ioctl.c
==============================================================================
--- head/sys/net80211/ieee80211_ioctl.c Tue Apr 26 01:29:03 2016        
(r298604)
+++ head/sys/net80211/ieee80211_ioctl.c Tue Apr 26 01:29:26 2016        
(r298605)
@@ -1128,6 +1128,13 @@ ieee80211_ioctl_get80211(struct ieee8021
                        ireq->i_val =
                            (vap->iv_flags_ht & IEEE80211_FHT_RIFS) != 0;
                break;
+       case IEEE80211_IOC_STBC:
+               ireq->i_val = 0;
+               if (vap->iv_flags_ht & IEEE80211_FHT_STBC_TX)
+                       ireq->i_val |= 1;
+               if (vap->iv_flags_ht & IEEE80211_FHT_STBC_RX)
+                       ireq->i_val |= 2;
+               break;
        default:
                error = ieee80211_ioctl_getdefault(vap, ireq);
                break;
@@ -3265,6 +3272,31 @@ ieee80211_ioctl_set80211(struct ieee8021
                if (isvapht(vap))
                        error = ERESTART;
                break;
+       case IEEE80211_IOC_STBC:
+               /* Check if we can do STBC TX/RX before changing the setting */
+               if ((ireq->i_val & 1) &&
+                   ((vap->iv_htcaps & IEEE80211_HTCAP_TXSTBC) == 0))
+                       return EOPNOTSUPP;
+               if ((ireq->i_val & 2) &&
+                   ((vap->iv_htcaps & IEEE80211_HTCAP_RXSTBC) == 0))
+                       return EOPNOTSUPP;
+
+               /* TX */
+               if (ireq->i_val & 1)
+                       vap->iv_flags_ht |= IEEE80211_FHT_STBC_TX;
+               else
+                       vap->iv_flags_ht &= ~IEEE80211_FHT_STBC_TX;
+
+               /* RX */
+               if (ireq->i_val & 2)
+                       vap->iv_flags_ht |= IEEE80211_FHT_STBC_RX;
+               else
+                       vap->iv_flags_ht &= ~IEEE80211_FHT_STBC_RX;
+
+               /* NB: reset only if we're operating on an 11n channel */
+               if (isvapht(vap))
+                       error = ERESTART;
+               break;
        default:
                error = ieee80211_ioctl_setdefault(vap, ireq);
                break;
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to