Added friendly enable/disable functions
This commit is contained in:
parent
924143661a
commit
97346a75f7
@ -155,10 +155,10 @@ void eisa_fill_nic ( struct nic *nic, struct eisa_device *eisa ) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Reset and enable an EISA device
|
* Reset and enable/disable an EISA device
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void enable_eisa_device ( struct eisa_device *eisa ) {
|
void eisa_device_enabled ( struct eisa_device *eisa, int enabled ) {
|
||||||
/* Set reset line high for 1000 µs. Spec says 500 µs, but
|
/* Set reset line high for 1000 µs. Spec says 500 µs, but
|
||||||
* this doesn't work for all cards, so we are conservative.
|
* this doesn't work for all cards, so we are conservative.
|
||||||
*/
|
*/
|
||||||
@ -168,6 +168,7 @@ void enable_eisa_device ( struct eisa_device *eisa ) {
|
|||||||
/* Set reset low and write a 1 to ENABLE. Delay again, in
|
/* Set reset low and write a 1 to ENABLE. Delay again, in
|
||||||
* case the card takes a while to wake up.
|
* case the card takes a while to wake up.
|
||||||
*/
|
*/
|
||||||
outb ( EISA_CMD_ENABLE, eisa->ioaddr + EISA_GLOBAL_CONFIG );
|
outb ( enabled ? EISA_CMD_ENABLE : 0,
|
||||||
|
eisa->ioaddr + EISA_GLOBAL_CONFIG );
|
||||||
udelay ( 1000 ); /* Must wait 800 */
|
udelay ( 1000 ); /* Must wait 800 */
|
||||||
}
|
}
|
||||||
|
@ -607,8 +607,8 @@ struct bus_driver isapnp_driver __bus_driver = {
|
|||||||
* arbitration.
|
* arbitration.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
void activate_isapnp_device ( struct isapnp_device *isapnp,
|
void isapnp_device_activation ( struct isapnp_device *isapnp,
|
||||||
int activate ) {
|
int activation ) {
|
||||||
/* Wake the card and select the logical device */
|
/* Wake the card and select the logical device */
|
||||||
isapnp_wait_for_key ();
|
isapnp_wait_for_key ();
|
||||||
isapnp_send_key ();
|
isapnp_send_key ();
|
||||||
@ -616,7 +616,7 @@ void activate_isapnp_device ( struct isapnp_device *isapnp,
|
|||||||
isapnp_logicaldevice ( isapnp->logdev );
|
isapnp_logicaldevice ( isapnp->logdev );
|
||||||
|
|
||||||
/* Activate/deactivate the logical device */
|
/* Activate/deactivate the logical device */
|
||||||
isapnp_activate ( activate );
|
isapnp_activate ( activation );
|
||||||
isapnp_delay();
|
isapnp_delay();
|
||||||
|
|
||||||
/* Return all cards to Wait for Key state */
|
/* Return all cards to Wait for Key state */
|
||||||
|
@ -75,9 +75,16 @@ struct eisa_driver {
|
|||||||
* Functions in eisa.c
|
* Functions in eisa.c
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
extern void enable_eisa_device ( struct eisa_device *eisa );
|
extern void eisa_device_enabled ( struct eisa_device *eisa, int enabled );
|
||||||
extern void fill_eisa_nic ( struct nic *nic, struct eisa_device *eisa );
|
extern void fill_eisa_nic ( struct nic *nic, struct eisa_device *eisa );
|
||||||
|
|
||||||
|
static inline void enable_eisa_device ( struct eisa_device *eisa ) {
|
||||||
|
eisa_device_enabled ( eisa, 1 );
|
||||||
|
}
|
||||||
|
static inline void disable_eisa_device ( struct eisa_device *eisa ) {
|
||||||
|
eisa_device_enabled ( eisa, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* EISA bus global definition
|
* EISA bus global definition
|
||||||
*
|
*
|
||||||
|
@ -209,10 +209,17 @@ struct isapnp_driver {
|
|||||||
* Functions in isapnp.c
|
* Functions in isapnp.c
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
extern void activate_isapnp_device ( struct isapnp_device *isapnp,
|
extern void isapnp_device_activation ( struct isapnp_device *isapnp,
|
||||||
int active );
|
int activation );
|
||||||
extern void isapnp_fill_nic ( struct nic *nic, struct isapnp_device *isapnp );
|
extern void isapnp_fill_nic ( struct nic *nic, struct isapnp_device *isapnp );
|
||||||
|
|
||||||
|
static inline void activate_isapnp_device ( struct isapnp_device *isapnp ) {
|
||||||
|
isapnp_device_activation ( isapnp, 1 );
|
||||||
|
}
|
||||||
|
static inline void deactivate_isapnp_device ( struct isapnp_device *isapnp ) {
|
||||||
|
isapnp_device_activation ( isapnp, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ISAPnP bus global definition
|
* ISAPnP bus global definition
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user