hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
kernel/include/linux/bsg-lib.h
....@@ -1,24 +1,10 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 * BSG helper library
34 *
45 * Copyright (C) 2008 James Smart, Emulex Corporation
56 * Copyright (C) 2011 Red Hat, Inc. All rights reserved.
67 * Copyright (C) 2011 Mike Christie
7
- *
8
- * This program is free software; you can redistribute it and/or modify
9
- * it under the terms of the GNU General Public License as published by
10
- * the Free Software Foundation; either version 2 of the License, or
11
- * (at your option) any later version.
12
- *
13
- * This program is distributed in the hope that it will be useful,
14
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- * GNU General Public License for more details.
17
- *
18
- * You should have received a copy of the GNU General Public License
19
- * along with this program; if not, write to the Free Software
20
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
- *
228 */
239 #ifndef _BLK_BSG_
2410 #define _BLK_BSG_
....@@ -30,6 +16,9 @@
3016 struct device;
3117 struct scatterlist;
3218 struct request_queue;
19
+
20
+typedef int (bsg_job_fn) (struct bsg_job *);
21
+typedef enum blk_eh_timer_return (bsg_timeout_fn)(struct request *);
3322
3423 struct bsg_buffer {
3524 unsigned int payload_len;
....@@ -66,13 +55,18 @@
6655 int result;
6756 unsigned int reply_payload_rcv_len;
6857
58
+ /* BIDI support */
59
+ struct request *bidi_rq;
60
+ struct bio *bidi_bio;
61
+
6962 void *dd_data; /* Used for driver-specific storage */
7063 };
7164
7265 void bsg_job_done(struct bsg_job *job, int result,
7366 unsigned int reply_payload_rcv_len);
7467 struct request_queue *bsg_setup_queue(struct device *dev, const char *name,
75
- bsg_job_fn *job_fn, int dd_job_size);
68
+ bsg_job_fn *job_fn, bsg_timeout_fn *timeout, int dd_job_size);
69
+void bsg_remove_queue(struct request_queue *q);
7670 void bsg_job_put(struct bsg_job *job);
7771 int __must_check bsg_job_get(struct bsg_job *job);
7872