コード例 #1
0
ファイル: acm.c プロジェクト: dell-asm-ci/ipxe
/**
 * Transmit packet
 *
 * @v acm		USB RNDIS device
 * @v iobuf		I/O buffer
 * @ret rc		Return status code
 */
static int acm_out_transmit ( struct acm_device *acm,
			      struct io_buffer *iobuf ) {
	int rc;

	/* Profile transmissions */
	profile_start ( &acm_out_profiler );

	/* Enqueue I/O buffer */
	if ( ( rc = usb_stream ( &acm->usbnet.out, iobuf, 0 ) ) != 0 )
		return rc;

	profile_stop ( &acm_out_profiler );
	return 0;
}
コード例 #2
0
ファイル: dm96xx.c プロジェクト: dell-asm-ci/ipxe
/**
 * Transmit packet
 *
 * @v dm96xx		DM96xx device
 * @v iobuf		I/O buffer
 * @ret rc		Return status code
 */
static int dm96xx_out_transmit ( struct dm96xx_device *dm96xx,
				 struct io_buffer *iobuf ) {
	struct dm96xx_tx_header *header;
	size_t len = iob_len ( iobuf );
	int rc;

	/* Prepend header */
	if ( ( rc = iob_ensure_headroom ( iobuf, sizeof ( *header ) ) ) != 0 )
		return rc;
	header = iob_push ( iobuf, sizeof ( *header ) );
	header->len = cpu_to_le16 ( len );

	/* Enqueue I/O buffer */
	if ( ( rc = usb_stream ( &dm96xx->usbnet.out, iobuf, 0 ) ) != 0 )
		return rc;

	return 0;
}
コード例 #3
0
ファイル: smsc95xx.c プロジェクト: Heyvaert/ipxe-1
/**
 * Transmit packet
 *
 * @v smsc95xx		SMSC95xx device
 * @v iobuf		I/O buffer
 * @ret rc		Return status code
 */
static int smsc95xx_out_transmit ( struct smsc95xx_device *smsc95xx,
				   struct io_buffer *iobuf ) {
	struct smsc95xx_tx_header *header;
	size_t len = iob_len ( iobuf );
	int rc;

	/* Profile transmissions */
	profile_start ( &smsc95xx_out_profiler );

	/* Prepend header */
	if ( ( rc = iob_ensure_headroom ( iobuf, sizeof ( *header ) ) ) != 0 )
		return rc;
	header = iob_push ( iobuf, sizeof ( *header ) );
	header->command = cpu_to_le32 ( SMSC95XX_TX_FIRST | SMSC95XX_TX_LAST |
					SMSC95XX_TX_LEN ( len ) );
	header->len = cpu_to_le32 ( len );

	/* Enqueue I/O buffer */
	if ( ( rc = usb_stream ( &smsc95xx->usbnet.out, iobuf, 0 ) ) != 0 )
		return rc;

	profile_stop ( &smsc95xx_out_profiler );
	return 0;
}