summaryrefslogtreecommitdiffstats
path: root/sys/net
Commit message (Collapse)AuthorAgeFilesLines
* Implement a mechanism by which ATM drivers can inform interestedharti2003-07-292-1/+85
| | | | | | | parts of the system about certain kinds of events, like changes in the ABR rate, changes in the carrier state, PVC changes. The main consumers of these events are the harp(4) pseudo-driver and the ILMI daemon via ng_atm(4).
* Use M_WAITOK instead of M_WAIT in sppp_attach().gj2003-07-261-1/+1
|
* add monitor modesam2003-07-211-0/+2
|
* Disabling multicast on vlan interface caused kernel panic.ume2003-07-191-0/+2
| | | | | | PR: kern/40723 Submitted by: Hideki ONO <ono@kame.net> MFC after: 1 week
* Add mutex for routing entries.hsu2003-07-191-1/+8
| | | | Reviewed by: bmilekic, silby
* Correct the device identifiers for the ProATM cards.harti2003-07-181-2/+2
|
* Implement an utility function that can be used by device drivers toharti2003-07-152-0/+59
| | | | | | | implement the ATMIOCGVCCS ioctls. This routine handles changing VCC tables (which can occure because we cannot hold the driver mutex while allocating memory) with a loop and a re-allocation, should the table not fit in the allocated memory.
* The mbuf put on the interface queue contains the 4-byte pseudoheader.harti2003-07-151-1/+2
| | | | Account for this in the byte count.
* Add identifiers for ProSum's and IDT's cards that are based onharti2003-07-151-1/+9
| | | | the IDT77252 chip. The driver will follow soon.
* ATM_PH_LLCSNAP and ATMIO_FLAG_LLCSNAP must have the same value, soharti2003-07-151-2/+4
| | | | define one in terms of the other.
* Protect a kernel structure by _KERNEL.harti2003-07-151-0/+2
|
* Move the MAC entry point to label ethernet-sourced mbufs with a MAC labelrwatson2003-07-131-4/+8
| | | | | | | | | | from the network interface earlier in ether_input(). At some point (no fingers pointed), things were restructured and the labeling operation moved later. This wasn't a problem as BPF_MTAP() relies on the ifnet label not the mbuf label, but there might have been other problems. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* - In vlan_input(), always mask off all but the VLID bits from tagswpaul2003-07-082-3/+12
| | | | | | | | | | | | extracted from received frames, both in the IFCAP_VLAN_HWTAGGING case and not. (Some drivers may already do this masking internally, but doing it here doesn't hurt and insures consistency.) - In vlan_ioctl(), don't let the user set a VLAN ID value with anything besides the VLID bits set, otherwise we will have trouble matching an interface in vlan_input() later. PR: kern/46405
* Testing VLANs with the new 8139C+ chip (which does hardware tagwpaul2003-07-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | insertion and extraction) has revealed two bugs: - In vlan_start(), we're supposed to check the underlying interface to see if it has the IFCAP_VLAN_HWTAGGING cabability set and, if so, set things up for the VLAN_OUTPUT_TAG() routine. However the code checks ifp->if_capabilities, which is the vlan pseudo-interface's capabilities when it should be checking p->if_capabilities, which relates to the underlying physical interface. Change ifp->if_capabilities to p->if_capabilities so this works. - In vlan_input(), we have to extract the 16-bit tag value from the received frame and use it to figure out which vlan interface gets the frame. The code that we use to track down the desired vlan pseudo-interface is: for (ifv = LIST_FIRST(&ifv_list); ifv != NULL; ifv = LIST_NEXT(ifv, ifv_list)) if (ifp == ifv->ifv_p && tag == ifv->ifv_tag) break; The problem is that 'tag' is not computed consistently. In the case where the interface supports hardware VLAN tag extraction and calls VLAN_INPUT_TAG(), we do this: tag = *(u_int*)(mtag+1); But in the software emulation case, we do this tag = EVL_VLANOFTAG(ntohs(evl->evl_tag)); The problem here is the EVL_VLANOFTAG() macro is only ever applied in this one case. It's never applied to ifv->ifv_tag or anwhere else. We must be consistent: either it's applied everywhere or nowhere. To see how this can be a problem, do something like ifconfig vlan0 vlan 12345 vlandev foo0 and observe the results. I'm not quite sure what the right thing is to do here. Neither the vlan(4) nor ifconfig(8) man pages suggest which way to go. For now, I've removed this use of EVL_VLANOFTAG() so that the tag will match correctly in all cases. I will not get upset if somebody makes a compelling argument for using EVL_VLANOFTAG() everywhere instead, as long as the use is consistent.
* remove old 802.11 support; replaced by new code in sys/net80211sam2003-06-282-4027/+0
|
* add "autoselect" mode and "auto" alias: these let you reset thesam2003-06-251-0/+6
| | | | | "phy mode" to an auto-selecting mode, as opposed to one where you're locked to a particular one (e.g. 11a for 802.11)
* Add the hooks for netgraph and HARP to the NATM code. This allows usharti2003-06-231-3/+64
| | | | to use one set of drivers for all ATM upper layers.
* Apply style(9) to this file. I'm going to touch large parts of this fileharti2003-06-231-30/+32
| | | | so make this beforehand.
* Now that most of this file is new, stylify the rest and correct theharti2003-06-181-59/+57
| | | | style bugs (space/tab) introduced by me.
* Add definitions for the ioctls that are used by netgraph and harp to openharti2003-06-171-0/+18
| | | | and close VCCs.
* Fix the breakage introduced by rev. 1.43 of sys/dev/midway.c (don't commitharti2003-06-161-17/+92
| | | | | | | | on friday 13th and without making a universe). This adds struct and constant definitions for ATM traffic parameters and re-enables the build of the midway driver. Tested by: make universe
* Fix a typo in an ATM media name. As this name was not use yet, no problemsharti2003-06-021-1/+1
| | | | should occur.
* Wrap macro in do {...} while(0);phk2003-05-311-1/+1
| | | | Found by: FlexeLint
* Remove break after return.phk2003-05-311-3/+0
| | | | Found by: FlexeLint
* Replace a handrolled defrag function with m_defrag. The handrolledsilby2003-05-281-22/+15
| | | | | | | | | | | | | | function couldn't handle chains of > MCLBYTES, and it had a bug which caused corruption and panics in certain low mbuf situations. Additionally, change the failure case so that looutput returns ENOBUFS rather than attempting to pass on non-defragmented mbuf chains. Finally, remove the printf which would happen every time the low memory situation occured. It served no useful purpose other than to clue me in as to what was causing the panic in question. :) MFC after: 4 days
* Define a link layer MIB for ATM. Most fields of this MIB are needed byharti2003-05-052-0/+63
| | | | | | ILMI daemons. Factor out common softc fields for all ATM interfaces that need to be externally visible into an ifatm structure and make the midway driver using this structure and fill the MIB.
* Back out rev 1.146 -- it broke the LINT build.obrien2003-05-051-1/+1
| | | | We are about to enter the 5.1 code freeze and things must be buildable.
* Fix some easy, global, lint warnings. In most cases, this meansmarkm2003-04-302-2/+2
| | | | | making some local variables static. In a couple of cases, this means removing an unused variable.
* Add media types and options for ATM. While on most ATM cards media cannotharti2003-04-292-0/+63
| | | | | | | | be changed, it is very convenient to be able to toggle SDH/Sonet, idle/unassigned cells and scrambled mode and to see the carrier state. Reviewed by: -arch (if_media.h definitions)
* Add module data and version to the atm_subr and reference this info from theharti2003-04-292-1/+26
| | | | | | | | | | | | | | | | (currently) only consumer (en). Add a sysctl node hw.atm where the atm drivers will hook on their hardware sysctl sub-trees. Make atm_ifattach call if_attach and remove the corresponding call to if_attach from en. Create atm_ifdetach and use that in en. While the last change actually changes the interface this is not a problem in practice because the only other consumer of this API is an older LANAI driver on the net, that is not ready for current anyway. Reviewed by: -atm
* o add support for multi-mode devices like 802.11 wireless cards that supportsam2003-04-283-40/+80
| | | | | | | | | 11a/b/g by adding an optional 3-bit mode field o correct the spelling of OFDM (was ODFM) o add an 802.11 subtype option for turbo mode: the phy is clocked at 2x the normal clock rate; note this can be applied to both OFDM in 11a and OFDM in 11g mode (and possibly DS11 in 11b for certain phy's) o add 802.11 CCK aliases for 11b/11g rates--the more common terminology
* Tweak to previous commit: increment ifp->if_iqdrops if the m_copy() fails.archie2003-04-231-1/+2
| | | | Suggested by: Neelkanth Natu <neelnatu@yahoo.com>
* Fix a case where the return value from m_copy() was not being checkedarchie2003-04-231-6/+6
| | | | | | | for NULL before proceeding, causing a crash if mbufs were exhausted. MFC after: 3 days Reported by: Mark Gooderum <mark@verniernetworks.com>
* Move MAC label storage for mbufs into m_tags from the m_pkthdr structure,rwatson2003-04-141-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | returning some additional room in the first mbuf in a chain, and avoiding feature-specific contents in the mbuf header. To do this: - Modify mbuf_to_label() to extract the tag, returning NULL if not found. - Introduce mac_init_mbuf_tag() which does most of the work mac_init_mbuf() used to do, except on an m_tag rather than an mbuf. - Scale back mac_init_mbuf() to perform m_tag allocation and invoke mac_init_mbuf_tag(). - Replace mac_destroy_mbuf() with mac_destroy_mbuf_tag(), since m_tag's are now GC'd deep in the m_tag/mbuf code rather than at a higher level when mbufs are directly free()'d. - Add mac_copy_mbuf_tag() to support m_copy_pkthdr() and related notions. - Generally change all references to mbuf labels so that they use mbuf_to_label() rather than &mbuf->m_pkthdr.label. This required no changes in the MAC policies (yay!). - Tweak mbuf release routines to not call mac_destroy_mbuf(), tag destruction takes care of it for us now. - Remove MAC magic from m_copy_pkthdr() and m_move_pkthdr() -- the existing m_tag support does all this for us. Note that we can no longer just zero the m_tag list on the target mbuf, rather, we have to delete the chain because m_tag's will already be hung off freshly allocated mbuf's. - Tweak m_tag copying routines so that if we're copying a MAC m_tag, we don't do a binary copy, rather, we initialize the new storage and do a deep copy of the label. - Remove use of MAC_FLAG_INITIALIZED in a few bizarre places having to do with mbuf header copies previously. - When an mbuf is copied in ip_input(), we no longer need to explicitly copy the label because it will get handled by the m_tag code now. - No longer any weird handling of MAC labels in if_loop.c during header copies. - Add MPC_LOADTIME_FLAG_LABELMBUFS flag to Biba, MLS, mac_test. In mac_test, handle the label==NULL case, since it can be dynamically loaded. In order to improve performance with this change, introduce the notion of "lazy MAC label allocation" -- only allocate m_tag storage for MAC labels if we're running with a policy that uses MAC labels on mbufs. Policies declare this intent by setting the MPC_LOADTIME_FLAG_LABELMBUFS flag in their load-time flags field during declaration. Note: this opens up the possibility of post-boot policy modules getting back NULL slot entries even though they have policy invariants of non-NULL slot entries, as the policy might have been loaded after the mbuf was allocated, leaving the mbuf without label storage. Policies that cannot handle this case must be declared as NOTLATE, or must be modified. - mac_labelmbufs holds the current cumulative status as to whether any policies require mbuf labeling or not. This is updated whenever the active policy set changes by the function mac_policy_updateflags(). The function iterates the list and checks whether any have the flag set. Write access to this variable is protected by the policy list; read access is currently not protected for performance reasons. This might change if it causes problems. - Add MAC_POLICY_LIST_ASSERT_EXCLUSIVE() to permit the flags update function to assert appropriate locks. - This makes allocation in mac_init_mbuf() conditional on the flag. Reviewed by: sam Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* No need to unlock if error detected before locking.hsu2003-04-131-2/+4
| | | | Submitted by: harti
* Introduce an M_ASSERTPKTHDR() macro which performs the very common taskdes2003-04-083-7/+5
| | | | | | | of asserting that an mbuf has a packet header. Use it instead of hand- rolled versions wherever applicable. Submitted by: Hiten Pandya <hiten@unixdaemons.com>
* Don't use ovbcopy(); use void * instead of char *.des2003-04-041-6/+3
|
* o netisr_queue() returns 1 on success and 0 on failure,maxim2003-03-271-1/+1
| | | | | | fix a typo (?) in rev. 1.90. PR: kern/50163
* - Use if_broadcastaddr from struct ifnet rather than relying onmdodd2003-03-212-3/+4
| | | | | | | extern 'etherbroadcastaddr'. - Make 'etherbroadcastaddr' static. Reviewed by: imp
* Assignment could be NULL, check.mdodd2003-03-211-1/+1
|
* Use td->td_ucred instead of td->td_proc->p_ucred.jhb2003-03-201-2/+2
|
* - Use IFP2AC().mdodd2003-03-162-5/+73
| | | | | | - Support IFF_MONITOR. - Borrow some consistency for if_input() routines from if_ethersubr.c. - Correct comments regarding fddi_input() that no longer apply.
* Fix whitespace issues.mdodd2003-03-151-20/+20
|
* Don't strip header from packets before input routine is called.mdodd2003-03-152-6/+27
|
* Use if_printf().mdodd2003-03-152-4/+3
|
* iso88025_ifattach() changes:mdodd2003-03-152-3/+22
| | | | | - Call if_attach(). - Conditionally call bpfattach() based on second function argument.
* - Style(9) changes.mdodd2003-03-151-4/+11
| | | | | | - Remove unneeded assignment. - Increment if_oerrors as per if_fddisubr.c. - Wrap ISO code with conditional.
* Stray } forgotten by manual merging.mdodd2003-03-151-1/+0
|
* - Remove stray ).mdodd2003-03-151-2/+6
| | | | | - Add missing breaks. - Add missing if_noproto++.
* Revert part of 1.37; use bcopy() like if_fddisubr.c.mdodd2003-03-151-3/+1
|
OpenPOWER on IntegriCloud