ppi needs to use a bus method to get this rather than peering inside the

1284 stuff.

Submitted by: Peter Wemm <peter@netplex.com.au>
This commit is contained in:
Nicolas Souchu 2000-01-14 08:03:15 +00:00
parent 45b8027e25
commit bdcee5cff6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=55957
3 changed files with 6 additions and 4 deletions

View File

@ -88,7 +88,7 @@ ppb_1284_reset_error(device_t bus, int state)
*
* Get IEEE1284 state
*/
static int
int
ppb_1284_get_state(device_t bus)
{
return (DEVTOSOFTC(bus)->state);
@ -99,7 +99,7 @@ ppb_1284_get_state(device_t bus)
*
* Change IEEE1284 state if no error occured
*/
static int
int
ppb_1284_set_state(device_t bus, int state)
{
struct ppb_data *ppb = DEVTOSOFTC(bus);

View File

@ -116,6 +116,8 @@ extern int ppb_1284_negociate(device_t, int, int);
extern int ppb_1284_terminate(device_t);
extern int ppb_1284_read_id(device_t, int, char *, int, int *);
extern int ppb_1284_read(device_t, int, char *, int, int *);
extern int ppb_1284_get_state(device_t bus);
extern int ppb_1284_set_state(device_t bus, int state);
extern int ppb_peripheral_terminate(device_t, int);
extern int ppb_peripheral_negociate(device_t, int, int);

View File

@ -464,10 +464,10 @@ ppiwrite(dev_t dev, struct uio *uio, int ioflag)
/* we have to be peripheral to be able to send data, so
* wait for the appropriate state
*/
if (ppb->state < PPB_PERIPHERAL_NEGOCIATION)
if (ppb_1284_get_state(ppbus) < PPB_PERIPHERAL_NEGOCIATION)
ppb_1284_terminate(ppbus);
while (ppb->state != PPB_PERIPHERAL_IDLE) {
while (ppb_1284_get_state(ppbus) != PPB_PERIPHERAL_IDLE) {
/* XXX should check a variable before sleeping */
#ifdef DEBUG_1284
printf("s");