o Add field to dev_desc for the size of the io port range. This isn't
used yet in the committed sources, but will make the transition easier
in the future.
If you build this into your kernel, you will need to rebuild pccardd.
The cdevsw_add() function now finds the major number(s) in the
struct cdevsw passed to it. cdevsw_add_generic() is no longer
needed, cdevsw_add() does the same thing.
cdevsw_add() will print an message if the d_maj field looks bogus.
Remove nblkdev and nchrdev variables. Most places they were used
bogusly. Instead check a dev_t for validity by seeing if devsw()
or bdevsw() returns NULL.
Move bdevsw() and devsw() functions to kern/kern_conf.c
Bump __FreeBSD_version to 400006
This commit removes:
72 bogus makedev() calls
26 bogus SYSINIT functions
if_xe.c bogusly accessed cdevsw[], author/maintainer please fix.
I4b and vinum not changed. Patches emailed to authors. LINT
probably broken until they catch up.
Reformat and initialize correctly all "struct cdevsw".
Initialize the d_maj and d_bmaj fields.
The d_reset field was not removed, although it is never used.
I used a program to do most of this, so all the files now use the
same consistent format. Please keep it that way.
Vinum and i4b not modified, patches emailed to respective authors.
abuses its argument, which is supposed to be an integer unit number, as
a pointer to the head of the 'struct slot' list. When this code was
hacked^Wupdated for newbus, a new mechanism for registering slot_irq_handler()
was put in place and the significance of the unit number was overlooked.
When registering an interrupt, we have both device_id and unit. The unit
number is passed as 'unit' but /sys/i386/usa/intr_machdep.c:register_intr()
drops unit on the floor and uses device_id instead. Since pccard_alloc_intr()
always sets device_id to 0, this means the unit number is always zero, and
slot_irq_handler() is always called with 0, which becomes a NULL pointer
which slot_irq_handler() tries to dereference and the kernel explodes.
Result: if you assign a PCMCIA driver in the kernel config file like this:
device wi0 at isa? port? irq?
Then the system will panic the moment a PCMCIA device is attached and
an interrupt is triggered.
The quick fix: make pccard_alloc_intr() pass the unit number as both
the device_id and unit arguments to register_pcic_intr(). The correct fix
would be to rewrite /sys/pccard to be less disgusting.
so that the list of drivers is correct. This is a slightly
simplified version of the patch from the PR.
PR: misc/10544
Submitted by: Christophe Colle <colle@krtkg1.rug.ac.be>
1:
s/suser/suser_xxx/
2:
Add new function: suser(struct proc *), prototyped in <sys/proc.h>.
3:
s/suser_xxx(\([a-zA-Z0-9_]*\)->p_ucred, \&\1->p_acflag)/suser(\1)/
The remaining suser_xxx() calls will be scrutinized and dealt with
later.
There may be some unneeded #include <sys/cred.h>, but they are left
as an exercise for Bruce.
More changes to the suser() API will come along with the "jail" code.
however is only marginally useful until the new-style bus (pci and isa)
stuff comes onboard to give us a better shot at actually pci and isa
drivers loadable (or preloadable anyway).
computer 'suspended', although the slot was powered off. There was a
race where the slow could be powered off *after* it was assigned a
new driver when the computer was 'resumed'.
Noticed by: Brian Somers <brian@Awfulhak.org>
`void *' arg. Fixed or hid most of the resulting type mismatches.
Handlers can now be updated locally (except for reworking their
global declarations in isa_device.h).
FreeBSD/alpha. The most significant item is to change the command
argument to ioctl functions from int to u_long. This change brings us
inline with various other BSD versions. Driver writers may like to
use (__FreeBSD_version == 300003) to detect this change.
The prototype FreeBSD/alpha machdep will follow in a couple of days
time.
was really removed, or simply 'faked' by a suspend/resume. Keep track
of both current and previous state, and send that information to the
userland programs.
[
XXX - This breaks binary compatability with older pccardd programs, but
they don't work reliably. :(
]
This introduce an xxxFS_BOOT for each of the rootable filesystems.
(Presently not required, but encouraged to allow a smooth move of option *FS
to opt_dontuse.h later.)
LFS is temporarily disabled, and will be re-enabled tomorrow.
(update_intr_masks might not need to be done in 3.X, but the new generic
interrupt code is incomplete w/regard to support for the PCCARD code, so
to avoid any potential problems use it. It can't hurt).
- Correctly register pcic_imask with the system interrupt code.
- Call update_intr_masks() so that pcic_imask modifications that occur
when card interrupts are registered get updated in the system
interrupt code.
removed. Add a new state 'suspend' so we 'fake' insertion events at
resume time for the cards that have been suspended.
[
The code still works if you remove the card during suspend, switch the
card during suspend, or combinations of both.
]
Reviewed by: frf@xocolatl.com
use a Linker Set. Note, if a driver is loaded as an LKM if will have
to use the function call, but since none of the existing drivers
are loadable, this made things cleaner and boot messages nicer.
Obtained from: PAO-970616
* Kill individual drivers 'suspend' routines, since there's no simple/safe
way to suspend/resume a card w/out going through the complete probe
at initialization time.
* Default to using the apm_pccard_resume sysctl code, which basically
pretends the card was removed, and then re-inserted. Suspend/resume
is now 'emulated' with a fake insert/removal. (Hence we no longer
need the driver-specific suspend routines.)
follow.
* Rename/reorder all of the pccard structures, change many of the member
names to be descriptive, and follow more closely other 'bus' drivers
naming schemes.
* Rename a bunch of parameter and local variable names to be more
consistant in the code.
* Renamed the PCCARD 'crd' device to be the 'card' device
* KNF and make the code consistant where it was obvious.
* ifdef'd out some unused code
own definition of ISA_HOLE_START. We shouldn't need to include
bus/processor specific code in here, but it is required. At least by
doing it this way it becomes more obvious where the bogusness is.
Obtained from: email with bde
but it has too much baggage).
- create a new routine 'unregister_device_interrupt', which is now used
instead of having two routines with the same code snippet.
- Minor cleanups and commenting.
[ No functional changes, just moving things around ]
slots. Otherwise, we try to suspend drivers who have been disabled
already.
[
The only reason the drivers are still on the list is because of race
conditions where the card is removed while the driver is in use. We
leave the drivers on the slot list (leaving all of their structures in
place in case a process is using it) but set it's state to empty so that
further uses by the pccard code know not to expect active cards.
]
from the 'lower' interrupts to the 'higher' interrupts.) We need to
find a way to set the interrupt for the controller in the config file.
Determined by: handy@sag.space.lockheed.com
sysctl option 'fakes' like a card was removed and inserted when the
machine is brought up again from a suspend. It is disabled by default,
and the old code is used.
Obtained from: PAO
instead of the first available, like Win95 does. This appears to help
on some machines, and avoids potential problems with built-in serial
ports which tend to live at IRQ 3, which is usually picked with the
old method.
(pt. unused) for TI PCI1130.
2. pccard.c: PCIC_RESUME_RESET is now (also) a sysctl. (Never make it
a #ifdef if it can be made a sysctl!)
3. pcic.c: make getb() and putb() proper member functions of struct
pcic_slot. Add a couple of missing casts.
being used without ever being initialized. From examining
the rest of the routine, it looks like this is a typo,
and it really should have been "1" instead of "i".
Submitted by: mpp