openct ioctl in bios_wini driver, needed for sanity check in autopart
This commit is contained in:
parent
e9441a8972
commit
b52c0732d8
1 changed files with 23 additions and 8 deletions
|
@ -71,7 +71,7 @@ FORWARD _PROTOTYPE( int w_do_open, (struct driver *dp, message *m_ptr) );
|
||||||
FORWARD _PROTOTYPE( int w_do_close, (struct driver *dp, message *m_ptr) );
|
FORWARD _PROTOTYPE( int w_do_close, (struct driver *dp, message *m_ptr) );
|
||||||
FORWARD _PROTOTYPE( void w_init, (void) );
|
FORWARD _PROTOTYPE( void w_init, (void) );
|
||||||
FORWARD _PROTOTYPE( void w_geometry, (struct partition *entry));
|
FORWARD _PROTOTYPE( void w_geometry, (struct partition *entry));
|
||||||
FORWARD _PROTOTYPE( int nop_other, (struct driver *dp, message *m_ptr) );
|
FORWARD _PROTOTYPE( int w_other, (struct driver *dp, message *m_ptr) );
|
||||||
|
|
||||||
/* Entry points to this driver. */
|
/* Entry points to this driver. */
|
||||||
PRIVATE struct driver w_dtab = {
|
PRIVATE struct driver w_dtab = {
|
||||||
|
@ -87,7 +87,7 @@ PRIVATE struct driver w_dtab = {
|
||||||
nop_alarm, /* ignore leftover alarms */
|
nop_alarm, /* ignore leftover alarms */
|
||||||
nop_cancel, /* ignore CANCELs */
|
nop_cancel, /* ignore CANCELs */
|
||||||
nop_select, /* ignore selects */
|
nop_select, /* ignore selects */
|
||||||
nop_other, /* catch-all for unrecognized commands and ioctls */
|
w_other, /* catch-all for unrecognized commands and ioctls */
|
||||||
NULL /* leftover hardware interrupts */
|
NULL /* leftover hardware interrupts */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -477,13 +477,28 @@ struct partition *entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*============================================================================*
|
/*============================================================================*
|
||||||
* nop_other *
|
* w_other *
|
||||||
*============================================================================*/
|
*============================================================================*/
|
||||||
PRIVATE int nop_other(dp, m_ptr)
|
PRIVATE int w_other(dr, m)
|
||||||
struct driver *dp;
|
struct driver *dr;
|
||||||
message *m_ptr;
|
message *m;
|
||||||
{
|
{
|
||||||
printf("bios_wini: in nop_other\n");
|
int r, timeout, prev;
|
||||||
|
|
||||||
|
if (m->m_type != DEV_IOCTL ) {
|
||||||
|
return EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m->REQUEST == DIOCOPENCT) {
|
||||||
|
int count;
|
||||||
|
if (w_prepare(m->DEVICE) == NIL_DEV) return ENXIO;
|
||||||
|
count = w_wn->open_ct;
|
||||||
|
if ((r=sys_datacopy(SELF, (vir_bytes)&count,
|
||||||
|
m->PROC_NR, (vir_bytes)m->ADDRESS, sizeof(count))) != OK)
|
||||||
|
return r;
|
||||||
return OK;
|
return OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
return EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue