| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-or-later */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * BSG helper library |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (C) 2008 James Smart, Emulex Corporation |
|---|
| 5 | 6 | * Copyright (C) 2011 Red Hat, Inc. All rights reserved. |
|---|
| 6 | 7 | * 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 | | - * |
|---|
| 22 | 8 | */ |
|---|
| 23 | 9 | #ifndef _BLK_BSG_ |
|---|
| 24 | 10 | #define _BLK_BSG_ |
|---|
| .. | .. |
|---|
| 30 | 16 | struct device; |
|---|
| 31 | 17 | struct scatterlist; |
|---|
| 32 | 18 | 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 *); |
|---|
| 33 | 22 | |
|---|
| 34 | 23 | struct bsg_buffer { |
|---|
| 35 | 24 | unsigned int payload_len; |
|---|
| .. | .. |
|---|
| 66 | 55 | int result; |
|---|
| 67 | 56 | unsigned int reply_payload_rcv_len; |
|---|
| 68 | 57 | |
|---|
| 58 | + /* BIDI support */ |
|---|
| 59 | + struct request *bidi_rq; |
|---|
| 60 | + struct bio *bidi_bio; |
|---|
| 61 | + |
|---|
| 69 | 62 | void *dd_data; /* Used for driver-specific storage */ |
|---|
| 70 | 63 | }; |
|---|
| 71 | 64 | |
|---|
| 72 | 65 | void bsg_job_done(struct bsg_job *job, int result, |
|---|
| 73 | 66 | unsigned int reply_payload_rcv_len); |
|---|
| 74 | 67 | 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); |
|---|
| 76 | 70 | void bsg_job_put(struct bsg_job *job); |
|---|
| 77 | 71 | int __must_check bsg_job_get(struct bsg_job *job); |
|---|
| 78 | 72 | |
|---|