drivers/pcmcia/o2micro.h

Source file repositories/reference/linux-study-clean/drivers/pcmcia/o2micro.h

File Facts

System
Linux kernel
Corpus path
drivers/pcmcia/o2micro.h
Extension
.h
Size
6067 bytes
Lines
184
Domain
Driver Families
Bucket
drivers/pcmcia
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

switch (socket->dev->device) {
		/*
		 * older bridges have problems with both read prefetch and write
		 * bursting depending on the combination of the chipset, bridge
		 * and the cardbus card. so disable them to be on the safe side.
		 */
		case PCI_DEVICE_ID_O2_6729:
		case PCI_DEVICE_ID_O2_6730:
		case PCI_DEVICE_ID_O2_6812:
		case PCI_DEVICE_ID_O2_6832:
		case PCI_DEVICE_ID_O2_6836:
		case PCI_DEVICE_ID_O2_6933:
			use_speedup = false;
			break;
		default:
			use_speedup = true;
			break;
		}

		/* the user may override our decision */
		if (strcasecmp(o2_speedup, "on") == 0)
			use_speedup = true;
		else if (strcasecmp(o2_speedup, "off") == 0)
			use_speedup = false;
		else if (strcasecmp(o2_speedup, "default") != 0)
			dev_warn(&socket->dev->dev,
				"O2: Unknown parameter, using 'default'");

		if (use_speedup) {
			dev_info(&socket->dev->dev,
				"O2: enabling read prefetch/write burst. If you experience problems or performance issues, use the yenta_socket parameter 'o2_speedup=off'\n");
			config_writeb(socket, O2_RESERVED1,
				      a | O2_RES_READ_PREFETCH | O2_RES_WRITE_BURST);
			config_writeb(socket, O2_RESERVED2,
				      b | O2_RES_READ_PREFETCH | O2_RES_WRITE_BURST);
		} else {
			dev_info(&socket->dev->dev,
				"O2: disabling read prefetch/write burst. If you experience problems or performance issues, use the yenta_socket parameter 'o2_speedup=on'\n");
			config_writeb(socket, O2_RESERVED1,
				      a & ~(O2_RES_READ_PREFETCH | O2_RES_WRITE_BURST));
			config_writeb(socket, O2_RESERVED2,
				      b & ~(O2_RES_READ_PREFETCH | O2_RES_WRITE_BURST));
		}
	}

	return 0;
}

static void o2micro_restore_state(struct yenta_socket *socket)
{
	/*
	 * as long as read prefetch is the only thing in
	 * o2micro_override, it's safe to call it from here
	 */
	o2micro_override(socket);
}

#endif /* _LINUX_O2MICRO_H */

Annotation

Implementation Notes