blob: 7173f6e9d2dd55fbcba32070b15194f8538b9b1c [file] [log] [blame]
Jens Axboe3d6392c2007-07-09 12:38:05 +02001#ifndef BSG_H
2#define BSG_H
3
David Howells607ca462012-10-13 10:46:48 +01004#include <uapi/linux/bsg.h>
Douglas Gilbert4ab3b732009-03-09 10:51:38 -04005
FUJITA Tomonori45977d0e2006-12-20 11:19:32 +01006
Jens Axboe3d6392c2007-07-09 12:38:05 +02007#if defined(CONFIG_BLK_DEV_BSG)
8struct bsg_class_device {
Tony Jonesee959b02008-02-22 00:13:36 +01009 struct device *class_dev;
FUJITA Tomonori97f46ae2008-04-19 00:43:14 +090010 struct device *parent;
Jens Axboe3d6392c2007-07-09 12:38:05 +020011 int minor;
FUJITA Tomonorid351af02007-07-09 12:40:35 +020012 struct request_queue *queue;
FUJITA Tomonori97f46ae2008-04-19 00:43:14 +090013 struct kref ref;
14 void (*release)(struct device *);
Jens Axboe3d6392c2007-07-09 12:38:05 +020015};
16
FUJITA Tomonori97f46ae2008-04-19 00:43:14 +090017extern int bsg_register_queue(struct request_queue *q,
18 struct device *parent, const char *name,
19 void (*release)(struct device *));
FUJITA Tomonorid351af02007-07-09 12:40:35 +020020extern void bsg_unregister_queue(struct request_queue *);
Jens Axboe3d6392c2007-07-09 12:38:05 +020021#else
FUJITA Tomonori97f46ae2008-04-19 00:43:14 +090022static inline int bsg_register_queue(struct request_queue *q,
23 struct device *parent, const char *name,
24 void (*release)(struct device *))
James Bottomleya4ee0df2007-07-23 09:53:51 -050025{
26 return 0;
27}
FUJITA Tomonori97f46ae2008-04-19 00:43:14 +090028static inline void bsg_unregister_queue(struct request_queue *q)
James Bottomleya4ee0df2007-07-23 09:53:51 -050029{
30}
Jens Axboe3d6392c2007-07-09 12:38:05 +020031#endif
32
Jens Axboe3d6392c2007-07-09 12:38:05 +020033#endif