/* gc_n64_read_packet() reads an N64 packet. Each pad uses one bit per byte. So all pads connected to this port are read in parallel.  */
static void gc_n64_read_packet(struct gc *gc, unsigned char *data)
/* gc_n64_read_packet() reads an N64 packet. Each pad uses one bit per byte. So all pads connected to this port are read in parallel.  */
static void gc_n64_read_packet(struct gc *gc, unsigned char *data)
{
	int i;
	unsigned long flags;
	local_irq_save(flags);
	for (i = 0; i < GC_N64_REQUEST_LENGTH; i++) {
		parport_write_data(gc->pd->port, GC_N64_POWER_W | ((GC_N64_REQUEST >> i) & 1 ? GC_N64_OUT : 0));
		udelay(GC_N64_DWS);
	}
	local_irq_restore(flags);
	udelay(GC_N64_DELAY);
	for (i = 0; i < GC_N64_LENGTH; i++) {
		parport_write_data(gc->pd->port, GC_N64_POWER_R);
		data[i] = parport_read_status(gc->pd->port);
		parport_write_data(gc->pd->port, GC_N64_POWER_R | GC_N64_CLOCK);
	 }
}