diff options
Diffstat (limited to 'drivers/ps3/vuart.h')
-rw-r--r-- | drivers/ps3/vuart.h | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/drivers/ps3/vuart.h b/drivers/ps3/vuart.h index 34b360da9ff9..1be992d568c8 100644 --- a/drivers/ps3/vuart.h +++ b/drivers/ps3/vuart.h | |||
@@ -31,6 +31,13 @@ struct ps3_vuart_stats { | |||
31 | unsigned long disconnect_interrupts; | 31 | unsigned long disconnect_interrupts; |
32 | }; | 32 | }; |
33 | 33 | ||
34 | struct ps3_vuart_work { | ||
35 | struct work_struct work; | ||
36 | unsigned long trigger; | ||
37 | spinlock_t lock; | ||
38 | struct ps3_vuart_port_device* dev; /* to convert work to device */ | ||
39 | }; | ||
40 | |||
34 | /** | 41 | /** |
35 | * struct ps3_vuart_port_priv - private vuart device data. | 42 | * struct ps3_vuart_port_priv - private vuart device data. |
36 | */ | 43 | */ |
@@ -49,6 +56,7 @@ struct ps3_vuart_port_priv { | |||
49 | struct list_head head; | 56 | struct list_head head; |
50 | } rx_list; | 57 | } rx_list; |
51 | struct ps3_vuart_stats stats; | 58 | struct ps3_vuart_stats stats; |
59 | struct ps3_vuart_work work; | ||
52 | }; | 60 | }; |
53 | 61 | ||
54 | /** | 62 | /** |
@@ -71,10 +79,6 @@ struct ps3_vuart_port_driver { | |||
71 | int ps3_vuart_port_driver_register(struct ps3_vuart_port_driver *drv); | 79 | int ps3_vuart_port_driver_register(struct ps3_vuart_port_driver *drv); |
72 | void ps3_vuart_port_driver_unregister(struct ps3_vuart_port_driver *drv); | 80 | void ps3_vuart_port_driver_unregister(struct ps3_vuart_port_driver *drv); |
73 | 81 | ||
74 | int ps3_vuart_write(struct ps3_vuart_port_device *dev, | ||
75 | const void* buf, unsigned int bytes); | ||
76 | int ps3_vuart_read(struct ps3_vuart_port_device *dev, void* buf, | ||
77 | unsigned int bytes); | ||
78 | static inline struct ps3_vuart_port_driver *to_ps3_vuart_port_driver( | 82 | static inline struct ps3_vuart_port_driver *to_ps3_vuart_port_driver( |
79 | struct device_driver *_drv) | 83 | struct device_driver *_drv) |
80 | { | 84 | { |
@@ -85,5 +89,22 @@ static inline struct ps3_vuart_port_device *to_ps3_vuart_port_device( | |||
85 | { | 89 | { |
86 | return container_of(_dev, struct ps3_vuart_port_device, core); | 90 | return container_of(_dev, struct ps3_vuart_port_device, core); |
87 | } | 91 | } |
92 | static inline struct ps3_vuart_port_device *ps3_vuart_work_to_port_device( | ||
93 | struct work_struct *_work) | ||
94 | { | ||
95 | struct ps3_vuart_work *vw = container_of(_work, struct ps3_vuart_work, | ||
96 | work); | ||
97 | return vw->dev; | ||
98 | } | ||
99 | |||
100 | int ps3_vuart_write(struct ps3_vuart_port_device *dev, const void* buf, | ||
101 | unsigned int bytes); | ||
102 | int ps3_vuart_read(struct ps3_vuart_port_device *dev, void* buf, | ||
103 | unsigned int bytes); | ||
104 | int ps3_vuart_read_async(struct ps3_vuart_port_device *dev, work_func_t func, | ||
105 | unsigned int bytes); | ||
106 | void ps3_vuart_cancel_async(struct ps3_vuart_port_device *dev); | ||
107 | void ps3_vuart_clear_rx_bytes(struct ps3_vuart_port_device *dev, | ||
108 | unsigned int bytes); | ||
88 | 109 | ||
89 | #endif | 110 | #endif |