e1000e: cleanup PARENTHESIS_ALIGNMENT checkpatch checks
[linux/fpc-iii.git] / drivers / staging / vt6656 / control.c
blob743ef5fb7fe748f00cc5fd6f65163ecf179c0e80
1 /*
2 * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
3 * All rights reserved.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 * File: control.c
22 * Purpose: Handle USB control endpoint
24 * Author: Jerry Chen
26 * Date: Apr. 5, 2004
28 * Functions:
29 * CONTROLnsRequestOut - Write variable length bytes to MEM/BB/MAC/EEPROM
30 * CONTROLnsRequestIn - Read variable length bytes from MEM/BB/MAC/EEPROM
31 * ControlvWriteByte - Write one byte to MEM/BB/MAC/EEPROM
32 * ControlvReadByte - Read one byte from MEM/BB/MAC/EEPROM
33 * ControlvMaskByte - Read one byte from MEM/BB/MAC/EEPROM and clear/set
34 * some bits in the same address
36 * Revision History:
37 * 04-05-2004 Jerry Chen: Initial release
38 * 11-24-2004 Warren Hsu: Add ControlvWriteByte, ControlvReadByte,
39 * ControlvMaskByte
43 #include "control.h"
44 #include "rndis.h"
46 /*--------------------- Static Definitions -------------------------*/
47 /* static int msglevel =MSG_LEVEL_INFO; */
48 /* static int msglevel =MSG_LEVEL_DEBUG; */
49 /*--------------------- Static Classes ----------------------------*/
51 /*--------------------- Static Variables --------------------------*/
53 /*--------------------- Static Functions --------------------------*/
55 /*--------------------- Export Variables --------------------------*/
57 /*--------------------- Export Functions --------------------------*/
59 void ControlvWriteByte(struct vnt_private *pDevice, u8 reg, u8 reg_off,
60 u8 data)
63 CONTROLnsRequestOut(pDevice, MESSAGE_TYPE_WRITE, reg_off, reg,
64 sizeof(u8), &data);
66 return;
69 void ControlvReadByte(struct vnt_private *pDevice, u8 reg, u8 reg_off,
70 u8 *data)
72 CONTROLnsRequestIn(pDevice, MESSAGE_TYPE_READ,
73 reg_off, reg, sizeof(u8), data);
74 return;
77 void ControlvMaskByte(struct vnt_private *pDevice, u8 reg_type, u8 reg_off,
78 u8 reg_mask, u8 data)
80 u8 reg_data[2];
82 reg_data[0] = data;
83 reg_data[1] = reg_mask;
85 CONTROLnsRequestOut(pDevice, MESSAGE_TYPE_WRITE_MASK, reg_off,
86 reg_type, ARRAY_SIZE(reg_data), reg_data);
88 return;