Changeset 26e7d6d in mainline for uspace/drv/bus/usb/usbmast/usbmast.h
- Timestamp:
- 2011-09-19T16:31:00Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a347a11
- Parents:
- 3842a955 (diff), 086290d (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/usbmast/usbmast.h
r3842a955 r26e7d6d 1 1 /* 2 * Copyright (c) 20 06 Josef Cejka2 * Copyright (c) 2011 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup kbdgen 30 * @brief HelenOS generic uspace keyboard handler. 31 * @ingroup kbd 29 /** @addtogroup drvusbmast 32 30 * @{ 33 31 */ 34 32 /** @file 33 * USB mass storage commands. 35 34 */ 36 35 37 #ifndef __KEYBUFFER_H__38 #define __KEYBUFFER_H__36 #ifndef USBMAST_H_ 37 #define USBMAST_H_ 39 38 40 39 #include <sys/types.h> 41 #include <io/console.h> 42 #include <bool.h> 40 #include <usb/usb.h> 43 41 44 /** Size of buffer for pressed keys */ 45 #define KEYBUFFER_SIZE 128 42 /** Mass storage device. */ 43 typedef struct { 44 /** DDF device */ 45 ddf_dev_t *ddf_dev; 46 /** USB device */ 47 usb_device_t *usb_dev; 48 /** Number of LUNs */ 49 unsigned luns; 50 } usbmast_dev_t; 46 51 52 /** Mass storage function. 53 * 54 * Serves as soft state for function/LUN. 55 */ 47 56 typedef struct { 48 kbd_event_t fifo[KEYBUFFER_SIZE]; 49 size_t head; 50 size_t tail; 51 size_t items; 52 } keybuffer_t; 53 54 extern void keybuffer_free(keybuffer_t *); 55 extern void keybuffer_init(keybuffer_t *); 56 extern size_t keybuffer_available(keybuffer_t *); 57 extern bool keybuffer_empty(keybuffer_t *); 58 extern void keybuffer_push(keybuffer_t *, const kbd_event_t *); 59 extern bool keybuffer_pop(keybuffer_t *, kbd_event_t *); 57 /** Mass storage device the function belongs to */ 58 usbmast_dev_t *mdev; 59 /** DDF function */ 60 ddf_fun_t *ddf_fun; 61 /** LUN */ 62 unsigned lun; 63 /** Total number of blocks */ 64 uint64_t nblocks; 65 /** Block size in bytes */ 66 size_t block_size; 67 } usbmast_fun_t; 60 68 61 69 #endif
Note:
See TracChangeset
for help on using the changeset viewer.