View | Details | Raw Unified | Return to bug 20352 | Differences between
and this patch

Collapse All | Expand All

(-)sys/isa/psm.c (+26 lines)
Lines 1546-1551 Link Here
1546
    /* Perform IOCTL command */
1546
    /* Perform IOCTL command */
1547
    switch (cmd) {
1547
    switch (cmd) {
1548
1548
1549
    case MOUSE_SENDREADCMD:
1550
	data = (mousedata_t *)addr;
1551
	if (data->len > sizeof(data->buf)/sizeof(data->buf[0]))
1552
	    return EINVAL;
1553
1554
	error = block_mouse_data(sc, &command_byte);
1555
	if (error) 
1556
            return error;
1557
	for (s=0; s<data->len && !error; s++) {
1558
            if ((send_aux_command(sc->kbdc, data->buf[s])) != PSM_ACK)
1559
        	error = EIO;
1560
	}
1561
	if (!error) {
1562
    	    for (s = 0; s < sizeof(data->buf)/sizeof(data->buf[0]); s++) {
1563
        	data->buf[s] = read_aux_data(sc->kbdc);
1564
		if (data->buf[s] < 0)
1565
	    	    break;
1566
	    }
1567
	    if (s==sizeof(data->buf)/sizeof(data->buf[0]))
1568
		error = EIO;
1569
	    else
1570
		data->len=s;
1571
	}
1572
	unblock_mouse_data(sc, command_byte);
1573
	break;
1574
1549
    case OLD_MOUSE_GETHWINFO:
1575
    case OLD_MOUSE_GETHWINFO:
1550
	s = spltty();
1576
	s = spltty();
1551
        ((old_mousehw_t *)addr)->buttons = sc->hw.buttons;
1577
        ((old_mousehw_t *)addr)->buttons = sc->hw.buttons;

Return to bug 20352