Deleted Added
full compact
tws_user.c (241762) tws_user.c (263126)
1/*
2 * Copyright (c) 2010, LSI Corp.
3 * All rights reserved.
4 * Author : Manjunath Ranganathaiah
5 * Support: freebsdraid@lsi.com
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 17 unchanged lines hidden (view full) ---

26 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.
33 *
1/*
2 * Copyright (c) 2010, LSI Corp.
3 * All rights reserved.
4 * Author : Manjunath Ranganathaiah
5 * Support: freebsdraid@lsi.com
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 17 unchanged lines hidden (view full) ---

26 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 * POSSIBILITY OF SUCH DAMAGE.
33 *
34 * $FreeBSD: stable/9/sys/dev/tws/tws_user.c 241762 2012-10-20 07:38:42Z delphij $
34 * $FreeBSD: stable/9/sys/dev/tws/tws_user.c 263126 2014-03-14 01:05:32Z delphij $
35 */
36
37#include <dev/tws/tws.h>
38#include <dev/tws/tws_services.h>
39#include <dev/tws/tws_hdm.h>
40#include <dev/tws/tws_user.h>
41
42

--- 57 unchanged lines hidden (view full) ---

100 }
101
102 //==============================================================================================
103 // Get a command
104 //
105 do {
106 req = tws_get_request(sc, TWS_REQ_TYPE_PASSTHRU);
107 if ( !req ) {
35 */
36
37#include <dev/tws/tws.h>
38#include <dev/tws/tws_services.h>
39#include <dev/tws/tws_hdm.h>
40#include <dev/tws/tws_user.h>
41
42

--- 57 unchanged lines hidden (view full) ---

100 }
101
102 //==============================================================================================
103 // Get a command
104 //
105 do {
106 req = tws_get_request(sc, TWS_REQ_TYPE_PASSTHRU);
107 if ( !req ) {
108 sc->chan = (void *)sc;
109 error = tsleep(sc->chan, 0, "tws_sleep", TWS_IOCTL_TIMEOUT*hz);
108 error = tsleep(sc, 0, "tws_sleep", TWS_IOCTL_TIMEOUT*hz);
110 if ( error == EWOULDBLOCK ) {
111 return(ETIMEDOUT);
112 }
113 } else {
114 // Make sure we are still ready for new commands...
115 if ( tws_get_state(sc) != TWS_ONLINE) {
116 return(EBUSY);
117 }

--- 82 unchanged lines hidden (view full) ---

200 if ( req->error_code != TWS_REQ_RET_SUBMIT_SUCCESS )
201 ubuf->driver_pkt.os_status = error;
202
203 //==============================================================================================
204 // Free command
205 //
206 req->state = TWS_REQ_STATE_FREE;
207
109 if ( error == EWOULDBLOCK ) {
110 return(ETIMEDOUT);
111 }
112 } else {
113 // Make sure we are still ready for new commands...
114 if ( tws_get_state(sc) != TWS_ONLINE) {
115 return(EBUSY);
116 }

--- 82 unchanged lines hidden (view full) ---

199 if ( req->error_code != TWS_REQ_RET_SUBMIT_SUCCESS )
200 ubuf->driver_pkt.os_status = error;
201
202 //==============================================================================================
203 // Free command
204 //
205 req->state = TWS_REQ_STATE_FREE;
206
208 wakeup_one(sc->chan);
207 wakeup_one(sc);
209
210 return(error);
211}
212
213void
214tws_passthru_complete(struct tws_request *req)
215{
216 req->state = TWS_REQ_STATE_COMPLETE;

--- 181 unchanged lines hidden ---
208
209 return(error);
210}
211
212void
213tws_passthru_complete(struct tws_request *req)
214{
215 req->state = TWS_REQ_STATE_COMPLETE;

--- 181 unchanged lines hidden ---