This commit is contained in:
Warner Losh 1999-12-02 05:46:22 +00:00
parent 300325c61e
commit 4ecd5f6e8c
2 changed files with 19 additions and 1 deletions

View File

@ -28,6 +28,8 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* $FreeBSD$ */
#ifndef _PCCARD_CARDINFO_H_
#define _PCCARD_CARDINFO_H_
@ -45,6 +47,7 @@
#define PIOCRWFLAG _IOW('P', 7, int) /* Set flags for drv use */
#define PIOCRWMEM _IOWR('P', 8, unsigned long) /* Set mem for drv use */
#define PIOCSPOW _IOW('P', 9, struct power) /* Set power structure */
#define PIOCSVIR _IOW('P', 10, int) /* Virtual insert/remove */
#define PIOCSBEEP _IOW('P', 11, int) /* Select Beep */
/*
* Debug codes.

View File

@ -265,7 +265,7 @@ slot_resume(void *arg)
slt->state = empty;
slt->insert_seq = 1;
untimeout(inserted, (void *)slt, slt->insert_ch);
slt->insert_ch = timeout(inserted, (void *)slt, hz/4);
inserted((void *) slt);
selwakeup(&slt->selp);
}
return (0);
@ -579,6 +579,7 @@ crdioctl(dev_t dev, u_long cmd, caddr_t data, int fflag, struct proc *p)
struct mem_desc *mp;
struct io_desc *ip;
int s, err;
int pwval;
/* beep is disabled until the 1st call of crdioctl() */
pccard_beep_select(BEEP_ON);
@ -709,6 +710,20 @@ crdioctl(dev_t dev, u_long cmd, caddr_t data, int fflag, struct proc *p)
else
pccard_failure_beep();
return err;
/*
* Virtual removal/insertion
*/
case PIOCSVIR:
pwval = *(int *)data;
if (!pwval) {
if (slt->state != filled)
return EINVAL;
} else {
if (slt->state != empty)
return EINVAL;
}
pccard_event(slt, pwval == 0 ? card_removed : card_inserted);
break;
case PIOCSBEEP:
if (pccard_beep_select(*(int *)data)) {
return EINVAL;