Jens Axboe | 3d6392c | 2007-07-09 12:38:05 +0200 | [diff] [blame] | 1 | #ifndef BSG_H |
| 2 | #define BSG_H |
| 3 | |
David Howells | 607ca46 | 2012-10-13 10:46:48 +0100 | [diff] [blame] | 4 | #include <uapi/linux/bsg.h> |
Douglas Gilbert | 4ab3b73 | 2009-03-09 10:51:38 -0400 | [diff] [blame] | 5 | |
FUJITA Tomonori | 45977d0e | 2006-12-20 11:19:32 +0100 | [diff] [blame] | 6 | |
Jens Axboe | 3d6392c | 2007-07-09 12:38:05 +0200 | [diff] [blame] | 7 | #if defined(CONFIG_BLK_DEV_BSG) |
| 8 | struct bsg_class_device { |
Tony Jones | ee959b0 | 2008-02-22 00:13:36 +0100 | [diff] [blame] | 9 | struct device *class_dev; |
FUJITA Tomonori | 97f46ae | 2008-04-19 00:43:14 +0900 | [diff] [blame] | 10 | struct device *parent; |
Jens Axboe | 3d6392c | 2007-07-09 12:38:05 +0200 | [diff] [blame] | 11 | int minor; |
FUJITA Tomonori | d351af0 | 2007-07-09 12:40:35 +0200 | [diff] [blame] | 12 | struct request_queue *queue; |
FUJITA Tomonori | 97f46ae | 2008-04-19 00:43:14 +0900 | [diff] [blame] | 13 | struct kref ref; |
| 14 | void (*release)(struct device *); |
Jens Axboe | 3d6392c | 2007-07-09 12:38:05 +0200 | [diff] [blame] | 15 | }; |
| 16 | |
FUJITA Tomonori | 97f46ae | 2008-04-19 00:43:14 +0900 | [diff] [blame] | 17 | extern int bsg_register_queue(struct request_queue *q, |
| 18 | struct device *parent, const char *name, |
| 19 | void (*release)(struct device *)); |
FUJITA Tomonori | d351af0 | 2007-07-09 12:40:35 +0200 | [diff] [blame] | 20 | extern void bsg_unregister_queue(struct request_queue *); |
Jens Axboe | 3d6392c | 2007-07-09 12:38:05 +0200 | [diff] [blame] | 21 | #else |
FUJITA Tomonori | 97f46ae | 2008-04-19 00:43:14 +0900 | [diff] [blame] | 22 | static inline int bsg_register_queue(struct request_queue *q, |
| 23 | struct device *parent, const char *name, |
| 24 | void (*release)(struct device *)) |
James Bottomley | a4ee0df | 2007-07-23 09:53:51 -0500 | [diff] [blame] | 25 | { |
| 26 | return 0; |
| 27 | } |
FUJITA Tomonori | 97f46ae | 2008-04-19 00:43:14 +0900 | [diff] [blame] | 28 | static inline void bsg_unregister_queue(struct request_queue *q) |
James Bottomley | a4ee0df | 2007-07-23 09:53:51 -0500 | [diff] [blame] | 29 | { |
| 30 | } |
Jens Axboe | 3d6392c | 2007-07-09 12:38:05 +0200 | [diff] [blame] | 31 | #endif |
| 32 | |
Jens Axboe | 3d6392c | 2007-07-09 12:38:05 +0200 | [diff] [blame] | 33 | #endif |