summaryrefslogtreecommitdiffstats
path: root/sys
Commit message (Collapse)AuthorAgeFilesLines
* Add MAC Framework and MAC policy entry point mac_check_socket_create(),rwatson2005-07-057-0/+63
| | | | | | | | | | | which is invoked from socket() and socketpair(), permitting MAC policy modules to control the creation of sockets by domain, type, and protocol. Obtained from: TrustedBSD Project Sponsored by: SPARTA, SPAWAR Approved by: re (scottl) Requested by: SCC
* Remove a || 1 that crept into the i8254 commit and was subsequentlyjhb2005-07-055-5/+5
| | | | | | | | | copied and pasted. I had actually tested without this change in my trees as had the other testers. Reported by: bde, Rostislav Krasny rosti dot bsd at gmail dot com Approved by: re (scottl) Pointy hat to: jhb
* Fix for a bug in newreno partial ack handling where if a large amountps2005-07-052-2/+10
| | | | | | | of data is partial acked, snd_cwnd underflows, causing a burst. Found, Submitted by: Noritoshi Demizu Approved by: re
* remove auto-add of IEEE80211_KEY_GROUP; all the apps that need tosam2005-07-051-3/+0
| | | | | | | set it have been fixed Reviewed by: avatar Approved by: re (scottl)
* Remove obsoleted sysctl interface for switching between standard and 3Comglebius2005-07-051-39/+1
| | | | | | | | | | PPPoE modes. The interface was declared obsoleted before 5.3-RELEASE. When running as access concentrator ng_pppoe(4) supports both modes simultanously. When running as client mode can be swicthed in ppp(8) configuration. Approved by: re (scottl)
* o when setting a wpa key, hold a ref on the bss node;sam2005-07-051-5/+17
| | | | | | | | | | fixes a ref cnt leak o make unicast key handling on delete identical to set o change legacy wep key api to reset the 802.11 state machine for backwards compatibility Reviewed by: avatar Approved by: re (scottl)
* In the splnet times, netgraph was functional and synchronous. Nowadays,glebius2005-07-054-3/+82
| | | | | | | | | | | | | | | | | | | | | | an item may be queued and processed later. While this is OK for mbufs, this is a problem for control messages. In the framework: - Add optional callback function pointer to an item. When item gets applied the callback is executed from ng_apply_item(). - Add new flag NG_PROGRESS. If this flag is supplied, then return EINPROGRESS instead of 0 in case if item failed to deliver synchronously and was queued. - Honor NG_PROGRESS in ng_snd_item(). In ng_socket: - When userland sends control message add callback to the item. - If ng_snd_item() returns EINPROGRESS, then sleep. This change fixes possible races in ngctl(8) scripts. Reviewed by: julian Approved by: re (scottl)
* Enhance ia64_flush_dirty() to handle the case in which td != curthread.marcel2005-07-052-23/+52
| | | | | | | | This case is triggered with ptrace(2) and the PT_SETREGS function. Change the return type of the function to int so that errors can be passed on to the caller. Approved by: re (scottl)
* Fix one "wrong b_bufobj" panic in reassignbuf() by moving VI_UNLOCK(vp)pjd2005-07-051-1/+1
| | | | | | | | below KASSERT()s, which means there was no real problem here, we just needed better locking for assertions. OK'ed by: jeff Approved by: re (scottl)
* when operating in ap mode, explicitly drop associated/authenticatedsam2005-07-041-19/+25
| | | | | | | stations when transitioning to INIT state (e.g. as a result of changing state at the 802.11 level) Approved by: re (scottl)
* Add support for IODATA USB-RSAQ3 USB-Serial Adapter.hrs2005-07-032-0/+3
| | | | | | Reported by: Tomokazu Hirai Approved by: re (scottl) MFC after: 3 days
* Check the alignment of the IP header before passing the packet up to thethompsa2005-07-031-0/+13
| | | | | | | | | | | | | | | packet filter. This would cause a panic on architectures that require strict alignment such as sparc64, ia64 and ppc. This uses the code block from if_bridge and the newly added macro IP_HDR_ALIGNED_P(). This /might/ be a temporary messure before all NIC drivers are educated to align the header themself. PR: ia64/81284 Obtained from: NetBSD (if_bridge) Approved by: re (dwhite), mlaier (mentor)
* - Update the CPU version check to recognize P4/EMT64 CPUs. [1]jkoshy2005-07-031-1/+1
| | | | | | | | | - Allow libpmc(3) to support P4/EMT64 PMCs on the amd64 architecture and AMD K8 PMCs on the i386. [2] Submitted by: ps [1] Pointy hat: myself [2] Approved by: re (scottl)
* Remove ambiguity from hlen. IPv4 is now indicated by is_ipv4 and we need amlaier2005-07-031-20/+17
| | | | | | | proper hlen value for IPv6 to implement O_REJECT and O_LOG. Reviewed by: glebius, brooks, gnn Approved by: re (scottl)
* o Make ipw(4) more robust against frames received with a bad length.damien2005-07-031-3/+9
| | | | | | | o Minor consistency tweaks. Reviewed by: silby (mentor) Approved by: re (scottl)
* o Add new ids for the Belkin F5D7050damien2005-07-031-3/+10
| | | | | | | | | o Indent usb ids properly o Check the return value of if_alloc() o Call if_free() in ural_detach() Reviewed by: silby (mentor) Approved by: re (scottl)
* Add another ural(4) device (Belkin F5D7050)damien2005-07-031-0/+1
| | | | | Reviewed by: silby (mentor) Approved by: re (scottl)
* MFi386: r1.221 (Use a simpler implementation for the i8254 timecounter).nyan2005-07-032-24/+70
| | | | Approved by: re (scottl)
* Switch Unicode charset name from "ISO-10646-UCS-2" to "UTF-16BE".imura2005-07-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using ISO-10646-UCS-2 will cause a problem when we use our own iconv functions in the future, or port iconv other than GNU libiconv. Each vendors treat "UCS-2" as follows, and endian issue is vendor specific: - Solaris 8 iconv Little Endian with BOM - HP-UX iconv Big Endian - NetBSD/i386 1.6 iconv Little Endian - GNU libiconv Big Endian - glibc(RedHat AS 2.1 x86) iconv Little Endian - IANA Name: ISO-10646-UCS-2 MIBenum: 1000 Source: the 2-octet Basic Multilingual Plane, aka Unicode this needs to specify network byte order: the standard does not specify (it is a 16-bit integer space) Alias: csUnicode - MSDN Little Endian http://msdn.microsoft.com/library/en-us/cpref/html/frlrfsystemtextencodingclassgetencodingtopic2.asp Now using UTF-16BE is harmless, because - same as UCS-2 with 2 byte range (U+0000 - U+FFFF) - kernel code of each file systems(cd9660, msdosfs, ntfs) believes Unicode is a 2 byte character at this time. - UDF has only 2 byte range of Unicode filenames. - It's defined at RFC2781. So I believe it's time to change before starting new RELENG_6. :) Approved by: re (scottl)
* Implement functions calls from within DDB on ia64. On ia64 a functionmarcel2005-07-024-16/+58
| | | | | | | | | | | | | | | | | | | | | | | pointer doesn't point to the first instruction of that function, but rather to a descriptor. The descriptor has the address of the first instruction, as well as the value of the global pointer. The symbol table doesn't know anything about descriptors, so if you lookup the name of a function you get the address of the first instruction. The cast from the address, which is the result of the symbol lookup, to a function pointer as is done in db_fncall is therefore invalid. Abstract this detail behind the DB_CALL macro. By default DB_CALL is defined as db_fncall_generic, which yields the old behaviour. On ia64 the macro is defined as db_fncall_ia64, in which a descriptor is constructed to yield a valid function pointer. While here, introduce DB_MAXARGS. DB_MAXARGS replaces the existing (local) MAXARGS. The DB_MAXARGS macro can be defined by platforms to create a convenient maximum. By default this will be the legacy 10. On ia64 we define this macro to be 8, for 8 is the maximum number of arguments that can be passed in registers. This avoids having to implement spilling of arguments on the memory stack. Approved by: re (dwhite)
* Check the alignment of the IP header before passing the packet up to thethompsa2005-07-025-27/+64
| | | | | | | | | | | | | | | | | | | packet filter. This would cause a panic on architectures that require strict alignment such as sparc64 (tier1) and ia64/ppc (tier2). This adds two new macros that check the alignment, these are compile time dependent on __NO_STRICT_ALIGNMENT which is set for i386 and amd64 where alignment isn't need so the cost is avoided. IP_HDR_ALIGNED_P() IP6_HDR_ALIGNED_P() Move bridge_ip_checkbasic()/bridge_ip6_checkbasic() up so that the alignment is checked for ipfw and dummynet too. PR: ia64/81284 Obtained from: NetBSD Approved by: re (dwhite), mlaier (mentor)
* Remove the CPU_ENABLE_SSE option from the i386 and pc98 architectures,delphij2005-07-0211-38/+7
| | | | | | | | | | | | | | | | | | | | | | | as they are already default for I686_CPU for almost 3 years, and CPU_DISABLE_SSE always disables it. On the other hand, CPU_ENABLE_SSE does not work for I486_CPU and I586_CPU. This commit has: - Removed the option from conf/options.* - Removed the option and comments from MD NOTES files - Simplified the CPU_ENABLE_SSE ifdef's so they don't deal with CPU_ENABLE_SSE from kernel configuration. (*) For most users, this commit should be largely no-op. If you used to place CPU_ENABLE_SSE into your kernel configuration for some reason, it is time to remove it. (*) The ifdef's of CPU_ENABLE_SSE are not removed at this point, since we need to change it to !defined(CPU_DISABLE_SSE) && defined(I686_CPU), not just !defined(CPU_DISABLE_SSE), if we really want to do so. Discussed on: -arch Approved by: re (scottl)
* Fix a buglet that was present in the ia64 code and that got inheritedmarcel2005-07-023-0/+3
| | | | | | | | | | | | | | | | | | by amd64 and i386: For buffered writes we collect data and write it out a ${DEV_BSIZE}-sized block at a time. The fragsz variable is used to keep track of how much data we have collected in the buffer so far and it's reset to zero immediately after writing a block to the dump device. When the last, possibly partially filled buffer is flushed, we didn't reset fragsz to 0 and as such would stop reflecting reality. Since we currently only need to do buffered writes once, this isn't a problem. However, when kernel dumps are made by hand (say by callling doadump from within DDB), the improperly cleared state from the first call to dumpsys causes the next call to dumpsys to create an invalid code file. This change resets fragsz after flushing the partially filled buffer so that it fixes the two problems at once. Approved by: re (scottl)
* Fix for a bug in the change that defers sack option processing untilps2005-07-014-8/+10
| | | | | | | | | | after PAWS checks. The symptom of this is an inconsistency in the cached sack state, caused by the fact that the sack scoreboard was not being updated for an ACK handled in the header prediction path. Found by: Andrey Chernov. Submitted by: Noritoshi Demizu, Raja Mukerji. Approved by: re
* Fix for a SACK crash caused by a bug in tcp_reass(). tcp_reass()ps2005-07-012-2/+6
| | | | | | | | | | | | does not clear tlen and frees the mbuf (leaving th pointing at freed memory), if the data segment is a complete duplicate. This change works around that bug. A fix for the tcp_reass() bug will appear later (that bug is benign for now, as neither th nor tlen is referenced in tcp_input() after the call to tcp_reass()). Found by: Pawel Jakub Dawidek. Submitted by: Raja Mukerji, Noritoshi Demizu. Approved by: re
* MFi386: r1.221: use simple timecounter that is aware of irq0 being off.peter2005-07-011-7/+34
| | | | Approved by: re
* Mistakingly undefined VN_KNOTE_LOCKED in my previous commit.ssouhlal2005-07-011-1/+1
| | | | | Noticed by: Antoine Brodin <antoine.brodin@laposte.net> Approved by: re (scottl)
* Fix the recent panics/LORs/hangs created by my kqueue commit by:ssouhlal2005-07-0116-75/+176
| | | | | | | | | | | | | | | | | - Introducing the possibility of using locks different than mutexes for the knlist locking. In order to do this, we add three arguments to knlist_init() to specify the functions to use to lock, unlock and check if the lock is owned. If these arguments are NULL, we assume mtx_lock, mtx_unlock and mtx_owned, respectively. - Using the vnode lock for the knlist locking, when doing kqueue operations on a vnode. This way, we don't have to lock the vnode while holding a mutex, in filt_vfsread. Reviewed by: jmg Approved by: re (scottl), scottl (mentor override) Pointyhat to: ssouhlal Will be happy: everyone
* Upon relection, we shouldn't allow the tuple structs to be modified byimp2005-07-013-11/+7
| | | | | | | the functor, so make it a const pointer, and chase down the resulting const-poisoning. Approved by: re (scottl)
* Use a simpler implementation for the i8254 timecounter when using the lapicjhb2005-07-012-24/+70
| | | | | | | | | | timer since irq0 isn't being driven at hz in that case and we don't need to try to handle edge cases with rollover, etc. that require irq0 to be firing for the timecounter to actually work. Submitted by: phk Tested by: schweikh Approved by: re (scottl)
* Fix what(1) on kernel binaries by duplicating part of version[] in sccs[]jhb2005-07-011-2/+1
| | | | | | | | | | | and stop trying to play cute games so that sccs[] shares space with version[]. Reported by: Jilles Tjoelker jilles at stack dot nl Discussed with: bde, "R. Imura" imura at ryu16 dot org Idea from: NetBSD (via bde) Approved by: re (scottl) MFC after: 1 week
* Use m_uiotombuf() instead of own implementation. This is not justglebius2005-07-011-25/+10
| | | | | | | | | | a cosmetic change. m_uiotombuf() produces a packet header mbuf, while original implementation did not. When kernel is compiled with MAC support, headerless mbuf will cause panic. Reported by: Alexander Nikiforenko <asn rambler-co.ru> Approved by: re (scottl) MFC After: 2 weeks
* - Providing fine-grained malloc statistic by replacing M_DEVBUF withavatar2005-07-019-66/+98
| | | | | | | | | | | | | module-specific malloc types. These should help us to pinpoint the possible memory leakage in the future. - Implementing xpt_alloc_ccb_nowait() and replacing all malloc/free based CCB memory management with xpt_alloc_ccb[_nowait]/xpt_free_ccb. Hopefully this would be helpful if someday we move the CCB allocator to use UMA instead of malloc(). Encouraged by: jeffr, rwatson Reviewed by: gibbs, scottl Approved by: re (scottl)
* Fix another fallout from the ifnet change that assumed that a softcharti2005-07-016-9/+9
| | | | | | | starts with an ifatm which in turns has an ifnet. Remove also a couple of unneccessary casts that could hide such things in the future. Approved by: re
* When doing ARP load balancing source IP is taken in network byte order,glebius2005-07-011-1/+1
| | | | | | | | so residue of division for all hosts on net is the same, and thus only one VHID answers. Change source IP in host byte order. Reviewed by: mlaier Approved by: re (scottl)
* Make a pass and cleanup the printfs from this driver.imp2005-07-013-21/+11
| | | | Approved by: re (scottl) blanket ep
* Minor cleanup of ep driver and pccard attachment:imp2005-07-013-45/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Grab the MAC address out of the CIS if the card has the special 3Com 0x88 tuple. Most 3Com cards don't have this tuple, but we prefer it to the eeprom since it only appears to be present when the eeprom doesn't have the info. So far, I've only observed this on my 3C362 and 3C362B cards, but the NetBSD driver implies that the 3C362C also has this tuple, and that some 3C574 cards do too (none of mine do). ep_pccard_mac was written after looking at the NetBSD code. o Store the enet addr in the softc for this device, so we can use the overridden MAC to set the station address. o Create a routine to set the station address and use it where we need it. o setup the cmd shitfs and such before we call ep_alloc(), and remove setting up the cmd shift value there. It initializes to 0, and those attachments that need to frob it do so before calling ep_alloc. o Remove some obsolete comments o No longer a need to export ep_get_macaddr, so make it static o ep_alloc already grabs the EEPROM id, so we don't need to grab it again in ep_pccard_attach. o eliminate unit, it isn't needed, fix some printfs to be device_printf instead. # All my pccards except the 3C1 work now. Didn't test ISA or cbus cards # that I have: 3C509B-TP or 3C569B-J-TPO Tested on: 3C589B, 3C589C, 3C589D, 3C589D-TP, 3C562, 3C562B/3C563B, 3C562D/3C563D, 3CCFE574BT, 3CXEM556, 3CCSH572BT, 3C574-TX, 3CCE589EC, 3CXE589EC, 3CCFEM556, 3C1 Approved by: re (scottl)
* Use correct pointer type. This should fix non-functional re(4)yongari2005-07-011-1/+1
| | | | | | driver on 64bit architectures. Approved by: re (scottl)
* Add a much-requested feature: The ability for pccard attachments toimp2005-07-014-8/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | scan the CIS for interesting tuples. 95% of what can be obtained from the CIS is harvested by the pccard layer and presented to the user in standard function calls. However, there are special needs at times where the standard stuff doesn't suffice. This is for those special cases. CARD_SCAN_CIS(device_get_parent(dev), function, argp) scans the CIS of the card, passing each tuple to function with the tuple and argp as its arguments. Returning 0 continues the scan, while returning 1 terminates the scan. The value of the last invocation of function is returned from this function. int (*pccard_scan_t)(struct pccard_tuple *tuple, void *argp) function called for each tuple. Elements of the CIS tuple can be read with pccard_tuple_read_{1,2,3,4,n}(). You are reading the actual tuple memory each time, in case your card has registers in the CIS. # I suppose these things should be documented in pccard(4) or something like # that. # I plan on unifying cardbus CIS support in a similar way. Approved by: re (scottl)
* MFP4:jkoshy2005-06-306-28/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - pmcstat(8) gprof output mode fixes: lib/libpmc/pmclog.{c,h}, sys/sys/pmclog.h: + Add a 'is_usermode' field to the PMCLOG_PCSAMPLE event + Add an 'entryaddr' field to the PMCLOG_PROCEXEC event, so that pmcstat(8) can determine where the runtime loader /libexec/ld-elf.so.1 is getting loaded. sys/kern/kern_exec.c: + Use a local struct to group the entry address of the image being exec()'ed and the process credential changed flag to the exec handling hook inside hwpmc(4). usr.sbin/pmcstat/*: + Support "-k kernelpath", "-D sampledir". + Implement the ELF bits of 'gmon.out' profile generation in a new file "pmcstat_log.c". Move all log related functions to this file. + Move local definitions and prototypes to "pmcstat.h" - Other bug fixes: + lib/libpmc/pmclog.c: correctly handle EOF in pmclog_read(). + sys/dev/hwpmc_mod.c: unconditionally log a PROCEXIT event to all attached PMCs when a process exits. + sys/sys/pmc.h: correct a function prototype. + Improve usage checks in pmcstat(8). Approved by: re (blanket hwpmc)
* Use SCTL_MASK32 to determine that the sysctl call is from a 32bitps2005-06-301-7/+2
| | | | | | binary for kern.cp_time. Approved by: re
* MFi386: revision 1.615 (change kernel crashdump format to ELF).nyan2005-06-301-20/+38
| | | | Approved by: re (scottl)
* Jumbo-commit to enhance 32 bit application support on 64 bit kernels.peter2005-06-3014-44/+908
| | | | | | | | | | | | | | | | | | | | | | | | This is good enough to be able to run a RELENG_4 gdb binary against a RELENG_4 application, along with various other tools (eg: 4.x gcore). We use this at work. ia32_reg.[ch]: handle the 32 bit register file format, used by ptrace, procfs and core dumps. procfs_*regs.c: vary the format of proc/XXX/*regs depending on the client and target application. procfs_map.c: Don't print a 64 bit value to 32 bit consumers, or their sscanf fails. They expect an unsigned long. imgact_elf.c: produce a valid 32 bit coredump for 32 bit apps. sys_process.c: handle 32 bit consumers debugging 32 bit targets. Note that 64 bit consumers can still debug 32 bit targets. IA64 has got stubs for ia32_reg.c. Known limitations: a 5.x/6.x gdb uses get/setcontext(), which isn't implemented in the 32/64 wrapper yet. We also make a tiny patch to gdb pacify it over conflicting formats of ld-elf.so.1. Approved by: re
* Begin promoting the AMD-originated feature flags to first class flags, nowpeter2005-06-303-92/+86
| | | | | | | | | | | | | | | | | that newer Intel cpu hardware implements them too. This includes things like the NX (pte no-execute) flag for execute protection. We'll need to reference this for implementing no-exec in pmap.c at some point. Some feature flags are duplicated in both the Intel-orignated bits and the AMD bits. Suppress the the duplicates correctly - the old code assumed they were a 1:1 mapping which is not correct. We can't just mask off the bits present in cpu_feature. Converge with amd64 where this originated from. Intel cpu's that implement any AMD features will report them in dmesg now. Approved by: re
* i386->amd64 syncpeter2005-06-301-0/+2
| | | | | | Add ath_hal and ichwd modules Approved by: re (blanked i386<->amd64 sync)
* Sync i386->amd64.peter2005-06-303-7/+31
| | | | | | | | | | | * Add ichwd (The Intel EM64T folks have an ICH) * Cosmetic comment syncs * Merge cpufreq change over to NOTES * add pbio (it compiles, but isn't useful since no boxes have ISA slots) * copy ath settings (note: wlan disabled here since its in global NOTES) * copy profiling, including fixing a previous i386->amd64 merge typo. Approved by: re (blanket i386 <-> amd64 sync/convergence)
* Second part of commit for moving KDB_STOP_NMI from opt_global.h topeter2005-06-301-0/+2
| | | | | | | opt_kdb.h. Found by: kris Approved by: re
* Add a special-case handler for general protection faults. It appears topeter2005-06-301-3/+26
| | | | | | | | | | be possible to get the swapgs state reversed if doreti traps during the iretq. Attempt to handle this. load_gs() might need special handling too. Running the kernel with the user's TLS and the kernel's PCPU space interchanged would be bad(TM). Discovered as a result of a conversation with: bde Approved by: re
* Conditionally weaken sys_generic.c rev 1.136 to allow certain dubiouspeter2005-06-302-2/+21
| | | | | | | | | | | | | ioctl numbers in backwards compatability mode. eg: an IOC_IN ioctl with a size of zero. Traditionally this was what you did before IOC_VOID existed, and we had some established users of this in the tree, namely procfs. Certain 3rd party drivers with binary userland components also have this too. This is necessary to have 4.x and 5.x binaries use these ioctl's. We found this at work when trying to run 4.x binaries. Approved by: re
* Add COMPAT_FREEBSD5peter2005-06-301-0/+1
| | | | Approved by: re
OpenPOWER on IntegriCloud