root/drivers/char/psaux.c

/* [previous][next][first][last][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. aux_write_dev
  2. aux_write_ack
  3. aux_write_cmd
  4. get_from_queue
  5. queue_empty
  6. aux_interrupt
  7. qp_interrupt
  8. release_aux
  9. release_qp
  10. fasync_aux
  11. open_aux
  12. open_qp
  13. write_aux
  14. write_qp
  15. read_aux
  16. aux_select
  17. psaux_init
  18. cleanup_module
  19. poll_aux_status
  20. poll_aux_status_nosleep
  21. poll_qp_status
  22. read_710
  23. probe_qp

   1 /*
   2  * linux/drivers/char/psaux.c
   3  *
   4  * Driver for PS/2 type mouse by Johan Myreen.
   5  *
   6  * Supports pointing devices attached to a PS/2 type
   7  * Keyboard and Auxiliary Device Controller.
   8  *
   9  * Corrections in device setup for some laptop mice & trackballs.
  10  * 02Feb93  (troyer@saifr00.cfsat.Honeywell.COM,mch@wimsey.bc.ca)
  11  *
  12  * Changed to prevent keyboard lockups on AST Power Exec.
  13  * 28Jul93  Brad Bosch - brad@lachman.com
  14  *
  15  * Modified by Johan Myreen (jem@pandora.pp.fi) 04Aug93
  16  *   to include support for QuickPort mouse.
  17  *
  18  * Changed references to "QuickPort" with "82C710" since "QuickPort"
  19  * is not what this driver is all about -- QuickPort is just a
  20  * connector type, and this driver is for the mouse port on the Chips
  21  * & Technologies 82C710 interface chip. 15Nov93 jem@pandora.pp.fi
  22  *
  23  * Added support for SIGIO. 28Jul95 jem@pandora.pp.fi
  24  *
  25  * Rearranged SIGIO support to use code from tty_io.  9Sept95 ctm@ardi.com
  26  *
  27  * Modularised 8-Sep-95 Philip Blundell <pjb27@cam.ac.uk>
  28  */
  29 
  30 /* Uncomment the following line if your mouse needs initialization. */
  31 
  32 /* #define INITIALIZE_DEVICE */
  33 
  34 #ifdef MODULE
  35 #include <linux/module.h>
  36 #include <linux/version.h>
  37 #else
  38 #define MOD_INC_USE_COUNT
  39 #define MOD_DEC_USE_COUNT
  40 #endif
  41  
  42 #include <linux/sched.h>
  43 #include <linux/kernel.h>
  44 #include <linux/fcntl.h>
  45 #include <linux/errno.h>
  46 #include <linux/timer.h>
  47 #include <linux/malloc.h>
  48 #include <linux/mouse.h>
  49 
  50 #include <asm/io.h>
  51 #include <asm/segment.h>
  52 #include <asm/system.h>
  53 
  54 #include <linux/config.h>
  55 
  56 #define PSMOUSE_MINOR      1            /* minor device # for this mouse */
  57 
  58 /* aux controller ports */
  59 #define AUX_INPUT_PORT  0x60            /* Aux device output buffer */
  60 #define AUX_OUTPUT_PORT 0x60            /* Aux device input buffer */
  61 #define AUX_COMMAND     0x64            /* Aux device command buffer */
  62 #define AUX_STATUS      0x64            /* Aux device status reg */
  63 
  64 /* aux controller status bits */
  65 #define AUX_OBUF_FULL   0x21            /* output buffer (from device) full */
  66 #define AUX_IBUF_FULL   0x02            /* input buffer (to device) full */
  67 
  68 /* aux controller commands */
  69 #define AUX_CMD_WRITE   0x60            /* value to write to controller */
  70 #define AUX_MAGIC_WRITE 0xd4            /* value to send aux device data */
  71 
  72 #define AUX_INTS_ON     0x47            /* enable controller interrupts */
  73 #define AUX_INTS_OFF    0x65            /* disable controller interrupts */
  74 
  75 #define AUX_DISABLE     0xa7            /* disable aux */
  76 #define AUX_ENABLE      0xa8            /* enable aux */
  77 
  78 /* aux device commands */
  79 #define AUX_SET_RES     0xe8            /* set resolution */
  80 #define AUX_SET_SCALE11 0xe6            /* set 1:1 scaling */
  81 #define AUX_SET_SCALE21 0xe7            /* set 2:1 scaling */
  82 #define AUX_GET_SCALE   0xe9            /* get scaling factor */
  83 #define AUX_SET_STREAM  0xea            /* set stream mode */
  84 #define AUX_SET_SAMPLE  0xf3            /* set sample rate */
  85 #define AUX_ENABLE_DEV  0xf4            /* enable aux device */
  86 #define AUX_DISABLE_DEV 0xf5            /* disable aux device */
  87 #define AUX_RESET       0xff            /* reset aux device */
  88 
  89 #define MAX_RETRIES     60              /* some aux operations take long time*/
  90 #if defined(__alpha__) && !defined(CONFIG_PCI)
  91 # define AUX_IRQ        9               /* Jensen is odd indeed */
  92 #else
  93 # define AUX_IRQ        12
  94 #endif
  95 #define AUX_BUF_SIZE    2048
  96 
  97 /* 82C710 definitions */
  98 
  99 #define QP_DATA         0x310           /* Data Port I/O Address */
 100 #define QP_STATUS       0x311           /* Status Port I/O Address */
 101 
 102 #define QP_DEV_IDLE     0x01            /* Device Idle */
 103 #define QP_RX_FULL      0x02            /* Device Char received */
 104 #define QP_TX_IDLE      0x04            /* Device XMIT Idle */
 105 #define QP_RESET        0x08            /* Device Reset */
 106 #define QP_INTS_ON      0x10            /* Device Interrupt On */
 107 #define QP_ERROR_FLAG   0x20            /* Device Error */
 108 #define QP_CLEAR        0x40            /* Device Clear */
 109 #define QP_ENABLE       0x80            /* Device Enable */
 110 
 111 #define QP_IRQ          12
 112 
 113 extern unsigned char aux_device_present;
 114 extern unsigned char kbd_read_mask;     /* from keyboard.c */
 115 
 116 struct aux_queue {
 117         unsigned long head;
 118         unsigned long tail;
 119         struct wait_queue *proc_list;
 120         struct fasync_struct *fasync;
 121         unsigned char buf[AUX_BUF_SIZE];
 122 };
 123 
 124 static struct aux_queue *queue;
 125 static int aux_ready = 0;
 126 static int aux_busy = 0;
 127 static int aux_present = 0;
 128 static int poll_aux_status(void);
 129 static int poll_aux_status_nosleep(void);
 130 static int fasync_aux(struct inode *inode, struct file *filp, int on);
 131 
 132 #ifdef CONFIG_82C710_MOUSE
 133 static int qp_present = 0;
 134 static int qp_busy = 0;
 135 static int qp_data = QP_DATA;
 136 static int qp_status = QP_STATUS;
 137 
 138 static int poll_qp_status(void);
 139 static int probe_qp(void);
 140 #endif
 141 
 142 
 143 /*
 144  * Write to aux device
 145  */
 146 
 147 static void aux_write_dev(int val)
     /* [previous][next][first][last][top][bottom][index][help] */
 148 {
 149         poll_aux_status();
 150         outb_p(AUX_MAGIC_WRITE,AUX_COMMAND);    /* write magic cookie */
 151         poll_aux_status();
 152         outb_p(val,AUX_OUTPUT_PORT);            /* write data */
 153 }
 154 
 155 /*
 156  * Write to device & handle returned ack
 157  */
 158 #if defined INITIALIZE_DEVICE
 159 static int aux_write_ack(int val)
     /* [previous][next][first][last][top][bottom][index][help] */
 160 {
 161         int retries = 0;
 162 
 163         poll_aux_status_nosleep();
 164         outb_p(AUX_MAGIC_WRITE,AUX_COMMAND);
 165         poll_aux_status_nosleep();
 166         outb_p(val,AUX_OUTPUT_PORT);
 167         poll_aux_status_nosleep();
 168 
 169         if ((inb(AUX_STATUS) & AUX_OBUF_FULL) == AUX_OBUF_FULL)
 170         {
 171                 return (inb(AUX_INPUT_PORT));
 172         }
 173         return 0;
 174 }
 175 #endif /* INITIALIZE_DEVICE */
 176 
 177 /*
 178  * Write aux device command
 179  */
 180 
 181 static void aux_write_cmd(int val)
     /* [previous][next][first][last][top][bottom][index][help] */
 182 {
 183         poll_aux_status();
 184         outb_p(AUX_CMD_WRITE,AUX_COMMAND);
 185         poll_aux_status();
 186         outb_p(val,AUX_OUTPUT_PORT);
 187 }
 188 
 189 
 190 static unsigned int get_from_queue(void)
     /* [previous][next][first][last][top][bottom][index][help] */
 191 {
 192         unsigned int result;
 193         unsigned long flags;
 194 
 195         save_flags(flags);
 196         cli();
 197         result = queue->buf[queue->tail];
 198         queue->tail = (queue->tail + 1) & (AUX_BUF_SIZE-1);
 199         restore_flags(flags);
 200         return result;
 201 }
 202 
 203 
 204 static inline int queue_empty(void)
     /* [previous][next][first][last][top][bottom][index][help] */
 205 {
 206         return queue->head == queue->tail;
 207 }
 208 
 209 
 210 
 211 /*
 212  * Interrupt from the auxiliary device: a character
 213  * is waiting in the keyboard/aux controller.
 214  */
 215 
 216 static void aux_interrupt(int cpl, struct pt_regs * regs)
     /* [previous][next][first][last][top][bottom][index][help] */
 217 {
 218         int head = queue->head;
 219         int maxhead = (queue->tail-1) & (AUX_BUF_SIZE-1);
 220 
 221         if ((inb(AUX_STATUS) & AUX_OBUF_FULL) != AUX_OBUF_FULL)
 222                 return;
 223 
 224         queue->buf[head] = inb(AUX_INPUT_PORT);
 225         if (head != maxhead) {
 226                 head++;
 227                 head &= AUX_BUF_SIZE-1;
 228         }
 229         queue->head = head;
 230         aux_ready = 1;
 231         if (queue->fasync)
 232                 kill_fasync(queue->fasync, SIGIO);
 233         wake_up_interruptible(&queue->proc_list);
 234 }
 235 
 236 /*
 237  * Interrupt handler for the 82C710 mouse port. A character
 238  * is waiting in the 82C710.
 239  */
 240 
 241 #ifdef CONFIG_82C710_MOUSE
 242 static void qp_interrupt(int cpl, struct pt_regs * regs)
     /* [previous][next][first][last][top][bottom][index][help] */
 243 {
 244         int head = queue->head;
 245         int maxhead = (queue->tail-1) & (AUX_BUF_SIZE-1);
 246 
 247         queue->buf[head] = inb(qp_data);
 248         if (head != maxhead) {
 249                 head++;
 250                 head &= AUX_BUF_SIZE-1;
 251         }
 252         queue->head = head;
 253         aux_ready = 1;
 254         if (queue->fasync)
 255                 kill_fasync(queue->fasync, SIGIO);
 256         wake_up_interruptible(&queue->proc_list);
 257 }
 258 #endif
 259 
 260 
 261 static void release_aux(struct inode * inode, struct file * file)
     /* [previous][next][first][last][top][bottom][index][help] */
 262 {
 263         aux_write_cmd(AUX_INTS_OFF);            /* disable controller ints */
 264         poll_aux_status();
 265         outb_p(AUX_DISABLE,AUX_COMMAND);        /* Disable Aux device */
 266         poll_aux_status();
 267         free_irq(AUX_IRQ);
 268         fasync_aux(inode, file, 0);
 269         aux_busy = 0;
 270 }
 271 
 272 #ifdef CONFIG_82C710_MOUSE
 273 static void release_qp(struct inode * inode, struct file * file)
     /* [previous][next][first][last][top][bottom][index][help] */
 274 {
 275         unsigned char status;
 276 
 277         if (!poll_qp_status())
 278                 printk("Warning: Mouse device busy in release_qp()\n");
 279         status = inb_p(qp_status);
 280         outb_p(status & ~(QP_ENABLE|QP_INTS_ON), qp_status);
 281         if (!poll_qp_status())
 282                 printk("Warning: Mouse device busy in release_qp()\n");
 283         free_irq(QP_IRQ);
 284         fasync_aux(inode, file, 0);
 285         qp_busy = 0;
 286 }
 287 #endif
 288 
 289 static int fasync_aux(struct inode *inode, struct file *filp, int on)
     /* [previous][next][first][last][top][bottom][index][help] */
 290 {
 291         int retval;
 292 
 293         retval = fasync_helper(inode, filp, on, &queue->fasync);
 294         if (retval < 0)
 295                 return retval;
 296         return 0;
 297 }
 298 
 299 /*
 300  * Install interrupt handler.
 301  * Enable auxiliary device.
 302  */
 303 
 304 static int open_aux(struct inode * inode, struct file * file)
     /* [previous][next][first][last][top][bottom][index][help] */
 305 {
 306         if (!aux_present)
 307                 return -EINVAL;
 308         if (aux_busy)
 309                 return -EBUSY;
 310         if (!poll_aux_status())
 311                 return -EBUSY;
 312         aux_busy = 1;
 313         queue->head = queue->tail = 0;          /* Flush input queue */
 314         if (request_irq(AUX_IRQ, aux_interrupt, 0, "PS/2 Mouse")) {
 315                 aux_busy = 0;
 316                 return -EBUSY;
 317         }
 318         poll_aux_status();
 319         outb_p(AUX_ENABLE,AUX_COMMAND);         /* Enable Aux */
 320         aux_write_dev(AUX_ENABLE_DEV);          /* enable aux device */
 321         aux_write_cmd(AUX_INTS_ON);             /* enable controller ints */
 322         poll_aux_status();
 323         aux_ready = 0;
 324         return 0;
 325 }
 326 
 327 #ifdef CONFIG_82C710_MOUSE
 328 /*
 329  * Install interrupt handler.
 330  * Enable the device, enable interrupts. Set qp_busy
 331  * (allow only one opener at a time.)
 332  */
 333 
 334 static int open_qp(struct inode * inode, struct file * file)
     /* [previous][next][first][last][top][bottom][index][help] */
 335 {
 336         unsigned char status;
 337 
 338         if (!qp_present)
 339                 return -EINVAL;
 340 
 341         if (qp_busy)
 342                 return -EBUSY;
 343 
 344         if (request_irq(QP_IRQ, qp_interrupt, 0, "PS/2 Mouse"))
 345                 return -EBUSY;
 346 
 347         qp_busy = 1;
 348 
 349         status = inb_p(qp_status);
 350         status |= (QP_ENABLE|QP_RESET);
 351         outb_p(status, qp_status);
 352         status &= ~(QP_RESET);
 353         outb_p(status, qp_status);
 354 
 355         queue->head = queue->tail = 0;          /* Flush input queue */
 356         status |= QP_INTS_ON;
 357         outb_p(status, qp_status);              /* Enable interrupts */
 358 
 359         while (!poll_qp_status()) {
 360                 printk("Error: Mouse device busy in open_qp()\n");
 361                 return -EBUSY;
 362         }
 363 
 364         outb_p(AUX_ENABLE_DEV, qp_data);        /* Wake up mouse */
 365 
 366         return 0;
 367 }
 368 #endif
 369 
 370 /*
 371  * Write to the aux device.
 372  */
 373 
 374 static int write_aux(struct inode * inode, struct file * file, const char * buffer, int count)
     /* [previous][next][first][last][top][bottom][index][help] */
 375 {
 376         int i = count;
 377 
 378         while (i--) {
 379                 if (!poll_aux_status())
 380                         return -EIO;
 381                 outb_p(AUX_MAGIC_WRITE,AUX_COMMAND);
 382                 if (!poll_aux_status())
 383                         return -EIO;
 384                 outb_p(get_user(buffer++),AUX_OUTPUT_PORT);
 385         }
 386         inode->i_mtime = CURRENT_TIME;
 387         return count;
 388 }
 389 
 390 
 391 #ifdef CONFIG_82C710_MOUSE
 392 /*
 393  * Write to the 82C710 mouse device.
 394  */
 395 
 396 static int write_qp(struct inode * inode, struct file * file, const char * buffer, int count)
     /* [previous][next][first][last][top][bottom][index][help] */
 397 {
 398         int i = count;
 399 
 400         while (i--) {
 401                 if (!poll_qp_status())
 402                         return -EIO;
 403                 outb_p(get_user(buffer++), qp_data);
 404         }
 405         inode->i_mtime = CURRENT_TIME;
 406         return count;
 407 }
 408 #endif
 409 
 410 
 411 /*
 412  * Put bytes from input queue to buffer.
 413  */
 414 
 415 static int read_aux(struct inode * inode, struct file * file, char * buffer, int count)
     /* [previous][next][first][last][top][bottom][index][help] */
 416 {
 417         struct wait_queue wait = { current, NULL };
 418         int i = count;
 419         unsigned char c;
 420 
 421         if (queue_empty()) {
 422                 if (file->f_flags & O_NONBLOCK)
 423                         return -EAGAIN;
 424                 add_wait_queue(&queue->proc_list, &wait);
 425 repeat:
 426                 current->state = TASK_INTERRUPTIBLE;
 427                 if (queue_empty() && !(current->signal & ~current->blocked)) {
 428                         schedule();
 429                         goto repeat;
 430                 }
 431                 current->state = TASK_RUNNING;
 432                 remove_wait_queue(&queue->proc_list, &wait);
 433         }
 434         while (i > 0 && !queue_empty()) {
 435                 c = get_from_queue();
 436                 put_user(c, buffer++);
 437                 i--;
 438         }
 439         aux_ready = !queue_empty();
 440         if (count-i) {
 441                 inode->i_atime = CURRENT_TIME;
 442                 return count-i;
 443         }
 444         if (current->signal & ~current->blocked)
 445                 return -ERESTARTSYS;
 446         return 0;
 447 }
 448 
 449 
 450 static int aux_select(struct inode *inode, struct file *file, int sel_type, select_table * wait)
     /* [previous][next][first][last][top][bottom][index][help] */
 451 {
 452         if (sel_type != SEL_IN)
 453                 return 0;
 454         if (aux_ready)
 455                 return 1;
 456         select_wait(&queue->proc_list, wait);
 457         return 0;
 458 }
 459 
 460 
 461 struct file_operations psaux_fops = {
 462         NULL,           /* seek */
 463         read_aux,
 464         write_aux,
 465         NULL,           /* readdir */
 466         aux_select,
 467         NULL,           /* ioctl */
 468         NULL,           /* mmap */
 469         open_aux,
 470         release_aux,
 471         NULL,
 472         fasync_aux,
 473 };
 474 
 475 
 476 /*
 477  * Initialize driver. First check for a 82C710 chip; if found
 478  * forget about the Aux port and use the *_qp functions.
 479  */
 480 static struct mouse psaux_mouse = {
 481         PSMOUSE_MINOR, "ps2aux", &psaux_fops
 482 };
 483 
 484 unsigned long psaux_init(unsigned long kmem_start)
     /* [previous][next][first][last][top][bottom][index][help] */
 485 {
 486         int qp_found = 0;
 487 
 488 #ifdef CONFIG_82C710_MOUSE
 489         if ((qp_found = probe_qp())) {
 490                 printk("82C710 type pointing device detected -- driver installed.\n");
 491 /*              printk("82C710 address = %x (should be 0x310)\n", qp_data); */
 492                 qp_present = 1;
 493                 psaux_fops.write = write_qp;
 494                 psaux_fops.open = open_qp;
 495                 psaux_fops.release = release_qp;
 496         } else
 497 #endif
 498         if (aux_device_present == 0xaa) {
 499                 printk("PS/2 auxiliary pointing device detected -- driver installed.\n");
 500                 aux_present = 1;
 501                 kbd_read_mask = AUX_OBUF_FULL;
 502                 mouse_register(&psaux_mouse);
 503         } else {
 504 #ifdef MODULE
 505                 return -EIO;
 506 #else
 507                 return kmem_start;              /* No mouse at all */
 508 #endif
 509         }
 510         queue = (struct aux_queue *) kmem_start;
 511         kmem_start += sizeof (struct aux_queue);
 512         memset(queue, 0, sizeof(*queue));
 513         queue->head = queue->tail = 0;
 514         queue->proc_list = NULL;
 515         if (!qp_found) {
 516 #if defined INITIALIZE_DEVICE
 517                 outb_p(AUX_ENABLE,AUX_COMMAND);         /* Enable Aux */
 518                 aux_write_ack(AUX_SET_SAMPLE);
 519                 aux_write_ack(100);                     /* 100 samples/sec */
 520                 aux_write_ack(AUX_SET_RES);
 521                 aux_write_ack(3);                       /* 8 counts per mm */
 522                 aux_write_ack(AUX_SET_SCALE21);         /* 2:1 scaling */
 523                 poll_aux_status_nosleep();
 524 #endif /* INITIALIZE_DEVICE */
 525                 outb_p(AUX_DISABLE,AUX_COMMAND);   /* Disable Aux device */
 526                 poll_aux_status_nosleep();
 527                 outb_p(AUX_CMD_WRITE,AUX_COMMAND);
 528                 poll_aux_status_nosleep();             /* Disable interrupts */
 529                 outb_p(AUX_INTS_OFF, AUX_OUTPUT_PORT); /*  on the controller */
 530         }
 531 #ifdef MODULE
 532         return 0;
 533 #else
 534         return kmem_start;
 535 #endif
 536 }
 537 
 538 #ifdef MODULE
 539 void cleanup_module(void)
     /* [previous][next][first][last][top][bottom][index][help] */
 540 {
 541         if (MOD_IN_USE)
 542                 printk("psaux: in use, remove delayed\n");
 543         mouse_deregister(&psaux_mouse);
 544 }
 545 #endif
 546 
 547 static int poll_aux_status(void)
     /* [previous][next][first][last][top][bottom][index][help] */
 548 {
 549         int retries=0;
 550 
 551         while ((inb(AUX_STATUS)&0x03) && retries < MAX_RETRIES) {
 552                 if ((inb_p(AUX_STATUS) & AUX_OBUF_FULL) == AUX_OBUF_FULL)
 553                         inb_p(AUX_INPUT_PORT);
 554                 current->state = TASK_INTERRUPTIBLE;
 555                 current->timeout = jiffies + (5*HZ + 99) / 100;
 556                 schedule();
 557                 retries++;
 558         }
 559         return !(retries==MAX_RETRIES);
 560 }
 561 
 562 static int poll_aux_status_nosleep(void)
     /* [previous][next][first][last][top][bottom][index][help] */
 563 {
 564         int retries = 0;
 565 
 566         while ((inb(AUX_STATUS)&0x03) && retries < 1000000) {
 567                 if ((inb_p(AUX_STATUS) & AUX_OBUF_FULL) == AUX_OBUF_FULL)
 568                         inb_p(AUX_INPUT_PORT);
 569                 retries++;
 570         }
 571         return !(retries == 1000000);
 572 }
 573 
 574 #ifdef CONFIG_82C710_MOUSE
 575 /*
 576  * Wait for device to send output char and flush any input char.
 577  */
 578 
 579 static int poll_qp_status(void)
     /* [previous][next][first][last][top][bottom][index][help] */
 580 {
 581         int retries=0;
 582 
 583         while ((inb(qp_status)&(QP_RX_FULL|QP_TX_IDLE|QP_DEV_IDLE))
 584                        != (QP_DEV_IDLE|QP_TX_IDLE)
 585                        && retries < MAX_RETRIES) {
 586 
 587                 if (inb_p(qp_status)&(QP_RX_FULL))
 588                         inb_p(qp_data);
 589                 current->state = TASK_INTERRUPTIBLE;
 590                 current->timeout = jiffies + (5*HZ + 99) / 100;
 591                 schedule();
 592                 retries++;
 593         }
 594         return !(retries==MAX_RETRIES);
 595 }
 596 
 597 /*
 598  * Function to read register in 82C710.
 599  */
 600 
 601 static inline unsigned char read_710(unsigned char index)
     /* [previous][next][first][last][top][bottom][index][help] */
 602 {
 603         outb_p(index, 0x390);                   /* Write index */
 604         return inb_p(0x391);                    /* Read the data */
 605 }
 606 
 607 /*
 608  * See if we can find a 82C710 device. Read mouse address.
 609  */
 610 
 611 static int probe_qp(void)
     /* [previous][next][first][last][top][bottom][index][help] */
 612 {
 613         outb_p(0x55, 0x2fa);                    /* Any value except 9, ff or 36 */
 614         outb_p(0xaa, 0x3fa);                    /* Inverse of 55 */
 615         outb_p(0x36, 0x3fa);                    /* Address the chip */
 616         outb_p(0xe4, 0x3fa);                    /* 390/4; 390 = config address */
 617         outb_p(0x1b, 0x2fa);                    /* Inverse of e4 */
 618         if (read_710(0x0f) != 0xe4)             /* Config address found? */
 619           return 0;                             /* No: no 82C710 here */
 620         qp_data = read_710(0x0d)*4;             /* Get mouse I/O address */
 621         qp_status = qp_data+1;
 622         outb_p(0x0f, 0x390);
 623         outb_p(0x0f, 0x391);                    /* Close config mode */
 624         return 1;
 625 }
 626 #endif

/* [previous][next][first][last][top][bottom][index][help] */