blob: 2a202e41a3af53f3da1beadd94fbe41bd5a6f157 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Jens Axboe3d6392c2007-07-09 12:38:05 +02002#ifndef BSG_H
3#define BSG_H
4
David Howells607ca462012-10-13 10:46:48 +01005#include <uapi/linux/bsg.h>
Douglas Gilbert4ab3b732009-03-09 10:51:38 -04006
FUJITA Tomonori45977d0e2006-12-20 11:19:32 +01007
Jens Axboe3d6392c2007-07-09 12:38:05 +02008#if defined(CONFIG_BLK_DEV_BSG)
9struct bsg_class_device {
Tony Jonesee959b02008-02-22 00:13:36 +010010 struct device *class_dev;
FUJITA Tomonori97f46ae2008-04-19 00:43:14 +090011 struct device *parent;
Jens Axboe3d6392c2007-07-09 12:38:05 +020012 int minor;
FUJITA Tomonorid351af02007-07-09 12:40:35 +020013 struct request_queue *queue;
FUJITA Tomonori97f46ae2008-04-19 00:43:14 +090014 struct kref ref;
15 void (*release)(struct device *);
Jens Axboe3d6392c2007-07-09 12:38:05 +020016};
17
FUJITA Tomonori97f46ae2008-04-19 00:43:14 +090018extern int bsg_register_queue(struct request_queue *q,
19 struct device *parent, const char *name,
20 void (*release)(struct device *));
FUJITA Tomonorid351af02007-07-09 12:40:35 +020021extern void bsg_unregister_queue(struct request_queue *);
Jens Axboe3d6392c2007-07-09 12:38:05 +020022#else
FUJITA Tomonori97f46ae2008-04-19 00:43:14 +090023static inline int bsg_register_queue(struct request_queue *q,
24 struct device *parent, const char *name,
25 void (*release)(struct device *))
James Bottomleya4ee0df2007-07-23 09:53:51 -050026{
27 return 0;
28}
FUJITA Tomonori97f46ae2008-04-19 00:43:14 +090029static inline void bsg_unregister_queue(struct request_queue *q)
James Bottomleya4ee0df2007-07-23 09:53:51 -050030{
31}
Jens Axboe3d6392c2007-07-09 12:38:05 +020032#endif
33
Jens Axboe3d6392c2007-07-09 12:38:05 +020034#endif