Commit Graph

42 Commits

Author SHA1 Message Date
Gleb Smirnoff
c8dfaf382f Mechanically convert to if_inc_counter(). 2014-09-19 03:51:26 +00:00
Hans Petter Selasky
af3b2549c4 Pull in r267961 and r267973 again. Fix for issues reported will follow. 2014-06-28 03:56:17 +00:00
Glen Barber
37a107a407 Revert r267961, r267973:
These changes prevent sysctl(8) from returning proper output,
such as:

 1) no output from sysctl(8)
 2) erroneously returning ENOMEM with tools like truss(1)
    or uname(1)
 truss: can not get etype: Cannot allocate memory
2014-06-27 22:05:21 +00:00
Hans Petter Selasky
3da1cf1e88 Extend the meaning of the CTLFLAG_TUN flag to automatically check if
there is an environment variable which shall initialize the SYSCTL
during early boot. This works for all SYSCTL types both statically and
dynamically created ones, except for the SYSCTL NODE type and SYSCTLs
which belong to VNETs. A new flag, CTLFLAG_NOFETCH, has been added to
be used in the case a tunable sysctl has a custom initialisation
function allowing the sysctl to still be marked as a tunable. The
kernel SYSCTL API is mostly the same, with a few exceptions for some
special operations like iterating childrens of a static/extern SYSCTL
node. This operation should probably be made into a factored out
common macro, hence some device drivers use this. The reason for
changing the SYSCTL API was the need for a SYSCTL parent OID pointer
and not only the SYSCTL parent OID list pointer in order to quickly
generate the sysctl path. The motivation behind this patch is to avoid
parameter loading cludges inside the OFED driver subsystem. Instead of
adding special code to the OFED driver subsystem to post-load tunables
into dynamically created sysctls, we generalize this in the kernel.

Other changes:
- Corrected a possibly incorrect sysctl name from "hw.cbb.intr_mask"
to "hw.pcic.intr_mask".
- Removed redundant TUNABLE statements throughout the kernel.
- Some minor code rewrites in connection to removing not needed
TUNABLE statements.
- Added a missing SYSCTL_DECL().
- Wrapped two very long lines.
- Avoid malloc()/free() inside sysctl string handling, in case it is
called to initialize a sysctl from a tunable, hence malloc()/free() is
not ready when sysctls from the sysctl dataset are registered.
- Bumped FreeBSD version to indicate SYSCTL API change.

MFC after:	2 weeks
Sponsored by:	Mellanox Technologies
2014-06-27 16:33:43 +00:00
Kevin Lo
5945b5f5ab Rename definition of IEEE80211_FC1_WEP to IEEE80211_FC1_PROTECTED.
The origin of WEP comes from IEEE Std 802.11-1997 where it defines
whether the frame body of MAC frame has been encrypted using WEP
algorithm or not.
IEEE Std. 802.11-2007 changes WEP to Protected Frame, indicates
whether the frame is protected by a cryptographic encapsulation
algorithm.

Reviewed by:	adrian, rpaulo
2014-01-08 08:06:56 +00:00
Gleb Smirnoff
76039bc84f The r48589 promised to remove implicit inclusion of if_var.h soon. Prepare
to this event, adding if_var.h to files that do need it. Also, include
all includes that now are included due to implicit pollution via if_var.h

Sponsored by:	Netflix
Sponsored by:	Nginx, Inc.
2013-10-26 17:58:36 +00:00
Hiren Panchasara
c2553fb9b8 Fixing a clang warning about using uninitialized variable.
PR: 176712
Suggested by:	jhb
Approved by:	sbruno (mentor)
2013-05-06 21:57:44 +00:00
Eitan Adler
114a94cc89 Revert r249800 as
- it is incorrect:  In the 'back' case you want to reuse the previous
	 mbuf.
	- it was not reviewed by wireless@

Requested by:	jhb, adrian
2013-04-23 16:33:25 +00:00
Eitan Adler
48e512f27e Avoid warning about uninitalized variable
PR:		kern/176712
Submitted by:	Hiren Panchasara <hiren.panchasara@gmail.com> (earlier vesion)
Approved by:	cperciva (mentor)
2013-04-23 13:02:57 +00:00
Gleb Smirnoff
c6499eccad Mechanically substitute flags from historic mbuf allocator with
malloc(9) flags in sys/dev.
2012-12-04 09:32:43 +00:00
Bernhard Schmidt
fcd9500f91 Fix some net80211 enum nits:
- ic_vap_create() uses an ieee80211_opmode argument
- ieee80211_rate2media() takes an ieee80211_phymode argument
- ieee80211_plcp2rate() takes an ieee80211_phytype argument
- cast to enum ieee80211_protmode and ieee80211_roamingmode to silence
  compiler warnings

Submitted by:	arundel@
2011-12-17 10:23:17 +00:00
Eitan Adler
a506169a2b - fix typo
Approved by:	kib@
2011-12-10 21:05:06 +00:00
Marius Strobl
848e30ff51 s,KOBJMETHOD_END,DEVMETHOD_END,g in order to fully hide the explicit mention
of kobj(9) from device drivers.
2011-11-22 21:55:40 +00:00
Ed Schouten
6472ac3d8a Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.
The SYSCTL_NODE macro defines a list that stores all child-elements of
that node. If there's no SYSCTL_DECL macro anywhere else, there's no
reason why it shouldn't be static.
2011-11-07 15:43:11 +00:00
Christian Brueffer
8780431854 Remove dead code, "error" doesn't change between this check and the
previous one.

CID:		3254
Found with:	Coverity Prevent(tm)
MFC after:	1 week
2011-10-08 10:50:48 +00:00
John Baldwin
3b0a4aef96 Do a sweep of the tree replacing calls to pci_find_extcap() with calls to
pci_find_cap() instead.
2011-03-23 13:10:15 +00:00
Bernhard Schmidt
bd56e71b4b Pull ieee80211_ratectl_node_init() calls from drivers into net80211.
This fixes hostap mode for at least ral(4) and run(4), because there is
no sufficient call into drivers which could be used initialize the node
related ratectl variables.

MFC after:	3 days
2011-01-17 20:15:15 +00:00
Matthew D Fleming
6dc7dc9a3e sysctl(9) cleanup checkpoint: amd64 GENERIC builds cleanly.
Commit the rest of the devices.
2011-01-12 19:53:56 +00:00
Kevin Lo
7df9d5acad Fix double ;; 2010-12-06 10:24:06 +00:00
Bernhard Schmidt
a7c6aabdc3 Instead of using the AMRR ratectl algo as default for drivers which have
the IEEE80211_C_RATECTL flag set, default to NONE for all drivers. Only if
a driver calls ieee80211_ratectl_init() check if the NONE algo is still
selected and try to use AMRR in that case. Drivers are still free to use
any other algo by calling ieee80211_ratectl_set() prior to the
ieee80211_ratectl_init() call.

After this change it is now safe to assume that a ratectl algo is always
available and selected, which renders the IEEE80211_C_RATECTL flag pretty
much useless. Therefore revert r211314 and 211546.

Reviewed by:	rpaulo
MFC after:	2 weeks
2010-11-06 18:17:20 +00:00
Joel Dahl
4e33fc946d Small grammar nit in a printf message. 2010-10-12 11:05:32 +00:00
Bernhard Schmidt
ad8e331bf2 Introduce IEEE80211_C_RATECTL, drivers which use the ratectl framework
should set this capability.

MFC after:	2 weeks
2010-08-14 20:12:10 +00:00
Weongyo Jeong
0f3801fa37 Fixes a mistake to calculate CALC_COEFF2() value that tmp[3] is
used even if it's unreachable.

PR:		kern/144505
Submitted by:	Henning Petersen <henning.petersen at t-online dot de>
MFC after:	1 week
2010-07-22 20:08:02 +00:00
Weongyo Jeong
6dcc706bc5 Fixes a bug for LP PHY that some frames have 2 padding bytes at the
start so we should adjust the mbuf if the driver is running in PIO mode.
Now it should work well with WPA authentication and association for LP
PHY devices.

Tested by:	Warren Block <wblock at wonkity.com>
MFC after:	1 month
2010-07-10 21:39:03 +00:00
Weongyo Jeong
f5101b5382 - fixes a bug that it didn't initialize the ratectl after association;
so ni_txrate returned 0 which is a invalid result.
- The fourth argument of ieee80211_ratectl_tx_complete() could be not
  NULL.

Reported by:	Gustau P?rez <gperez at entel.upc.edu>
Tested by:	Gustau P?rez <gperez at entel.upc.edu>,
		Ian FREISLICH <ianf at clue.co.za>
MFC after:	3 days
2010-05-15 21:18:15 +00:00
Maxim Sobolev
e50d35e6c6 Add new tunable 'net.link.ifqmaxlen' to set default send interface
queue length. The default value for this parameter is 50, which is
quite low for many of today's uses and the only way to modify this
parameter right now is to edit if_var.h file. Also add read-only
sysctl with the same name, so that it's possible to retrieve the
current value.

MFC after:	1 month
2010-05-03 07:32:50 +00:00
Weongyo Jeong
7d04a6be12 ifp->if_ipackets++ when RX packet interrupts are occurred.
MFC after:	3 days
2010-04-24 23:32:24 +00:00
Rui Paulo
b6108616ac net80211 rate control framework (net80211 ratectl).
This framework allows drivers to abstract the rate control algorithm and
just feed the framework with the usable parameters. The rate control
framework will now deal with passing the parameters to the selected
algorithm. Right now we have AMRR (the default) and RSSADAPT but there's
no way to select one with ifconfig, yet.
The objective is to have more rate control algorithms in the net80211
stack so all drivers[0] can use it. Ideally, we'll have the well-known
sample rate control algorithm in the net80211 at some point so all
drivers can use it (not just ath).

[0] all drivers that do rate control in software, that is.

Reviewed by:	bschmidt, thompsa, weyongo
MFC after:	1 months
2010-04-07 15:29:13 +00:00
Weongyo Jeong
2fe9b8d454 enables S/W beacon miss handler.
Reported by:	imp
2010-03-14 02:13:11 +00:00
Pyun YongHyeon
3c7703ea8b Fix build breakage introduced in r204922. 2010-03-10 21:45:40 +00:00
Weongyo Jeong
5a646f0eca uses KOBJMETHOD_END macro to indicate the end of method table.
Submitted by:	yongari
2010-03-09 20:07:41 +00:00
Weongyo Jeong
b9b64aa5b2 o uses bus accessor macros to read values from ivar so no more values
are referenced directly from ivar pointer.  It's to do like what other
  buses do. [1]
o changes exported prototypes.  It doesn't use struct siba_* structures
  anymore that instead of it it uses only device_t.
o removes duplicate code and debug messages.
o style(9)

Pointed out by:	imp [1]
2010-03-09 19:58:00 +00:00
Weongyo Jeong
37fb01d6c1 fixes an attached-at-boot issue that bwn(4) using device_identify
interface didn't be attached automatically at boot time so changes a
approach to attach children based on leveraging some newbus niceties.

Submitted by:	nwhitehorn
2010-03-03 20:06:09 +00:00
Weongyo Jeong
ae5e95fa23 calculates the integer square root if a positive integer X is larger
than 256 instead of using sqrt_table.

Reported by:	Joe Marcus Clarke <marcus at freebsd dot org>
2010-03-01 23:51:13 +00:00
Weongyo Jeong
8600d13245 fixes a bug to load firmware images for LP PHY. For LP PHY always,
`lp_' string is contained in its full image names.
2010-02-27 23:42:32 +00:00
Weongyo Jeong
7478ae9730 supports the adhoc demo mode that it's tested on modified aircrack-ng
suite and worked.

Submitted by:	Paul B Mahol <onemda at gmail dot com>
2010-02-27 23:04:29 +00:00
Weongyo Jeong
5fb654dcd1 don't need to check BWN_RX_PHYST0_SHORTPRMBL flag because it's already
handled in later.

Reported from:	imp, nwhitehorn
2010-02-27 02:20:38 +00:00
Weongyo Jeong
d2ee7771f1 o adds sysctl variables to show device statistics.
o records RTS success/fail statistics.

Pointed by:	imp
2010-02-23 19:55:54 +00:00
Weongyo Jeong
e355ad550c fixes a compile error; invalid type argument of '->'. 2010-02-23 19:44:51 +00:00
Warner Losh
0d05eee2f9 Fix compilation problems with INVARIANTS.
# also limit RX decryption attempted messages to 50

Reviewed by:	weongyo
2010-02-23 05:02:10 +00:00
Weongyo Jeong
ef0894bfd2 o print msgs with length if the frame is too short to pass to net80211.
o print key index for debugging if the frame is attempted to decrypt for
  WEP, AES or TKIP though currently HW decryption isn't supported.
2010-02-19 03:36:02 +00:00
Weongyo Jeong
45d9abdbc3 adds bwn(4) driver for supporting Broadcom BCM43xx chipsets.
o uses v4 firmware instead of v3.  A port will be committed to create
    the bwn firmware module.
  o supports B/G and LP(low power) PHYs.
  o supports 32 / 64 bits DMA operations.
  o tested on big / little endian machines so should work on all
    architectures.

It'd not connected to the build until the firmware port is committed.
2010-02-16 01:44:14 +00:00