Lines Matching defs:packet
59 * Multiport packet interpretation
62 #define PACKET_FULL 0x80000000 /* packet is full */
72 #define IO_GOT_PACKET 0x0100 /* Got a packet */
76 #define IO_RETRY 0x4000 /* Try again later to get packet */
150 * Gets a 28-bit packet from the multiport.
152 * After getting a packet successfully, commands encoded by sendcode may
157 * Returns a packet status code indicating whether packet is valid, the transfer
164 static int mp_io(struct gameport* gameport, int sendflags, int sendcode, u32 *packet)
167 u8 data_mask; /* packet data bits from raw_data */
168 u32 pkt; /* packet temporary storage */
169 int bits_per_read; /* num packet bits per gameport read */
175 *packet = 0;
198 /* Determine packet transfer mode and prepare for packet construction. */
214 /* Construct a packet. Final data bits must be zero. */
242 /* Acknowledge packet receipt */
257 /* Return if we just wanted the packet or multiport wants to send more */
259 *packet = pkt;
301 static int multiport_io(struct gameport* gameport, int sendflags, int sendcode, u32 *packet)
307 status = mp_io(gameport, sendflags, sendcode, packet);
316 * Returns true if a valid digital packet was received, false otherwise.
319 static int dig_mode_start(struct gameport *gameport, u32 *packet)
333 while (tries < 64 && bads < 8) { /* Reset multiport and try getting a packet */
335 flags = multiport_io(gameport, IO_RESET, 0x27, packet);
355 * Returns the packet status.
361 u32 packet;
365 /* Get a packet and check for validity */
368 flags = multiport_io(grip->gameport, flags, 0, &packet);
371 if (packet & PACKET_MP_DONE)
381 slot = ((packet >> 21) & 0xf) - 1;
392 joytype = (packet >> 16) & 0x1f;
407 /* Interpret a grip pad packet */
411 int dir = (packet >> 8) & 0xf; /* eight way directional value */
412 port->buttons = (~packet) & 0xff;
438 printk(KERN_INFO "Got joy type 0x%x and packet 0x%x.\n", joytype, packet);
480 u32 packet;
482 dig_mode = dig_mode_start(grip->gameport, &packet);
484 dig_mode = dig_mode_start(grip->gameport, &packet);