Deleted Added
full compact
ips_ioctl.c (119418) ips_ioctl.c (129859)
1/*-
2 * Written by: David Jeffery
3 * Copyright (c) 2002 Adaptec Inc.
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
1/*-
2 * Written by: David Jeffery
3 * Copyright (c) 2002 Adaptec Inc.
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
29__FBSDID("$FreeBSD: head/sys/dev/ips/ips_ioctl.c 119418 2003-08-24 17:55:58Z obrien $");
29__FBSDID("$FreeBSD: head/sys/dev/ips/ips_ioctl.c 129859 2004-05-30 04:01:29Z scottl $");
30
31#include <dev/ips/ips.h>
32#include <dev/ips/ips_ioctl.h>
33
34static void ips_ioctl_finish(ips_command_t *command)
35{
36 ips_ioctl_t *ioctl_cmd = command->arg;
37 if(ioctl_cmd->readwrite & IPS_IOCTL_READ){

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

134
135int ips_ioctl_request(ips_softc_t *sc, u_long ioctl_request, caddr_t addr, int32_t flags){
136 int error = EINVAL;
137 ips_ioctl_t *ioctl_cmd;
138 ips_user_request *user_request;
139 switch(ioctl_request){
140 case IPS_USER_CMD:
141 user_request = (ips_user_request *)addr;
30
31#include <dev/ips/ips.h>
32#include <dev/ips/ips_ioctl.h>
33
34static void ips_ioctl_finish(ips_command_t *command)
35{
36 ips_ioctl_t *ioctl_cmd = command->arg;
37 if(ioctl_cmd->readwrite & IPS_IOCTL_READ){

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

134
135int ips_ioctl_request(ips_softc_t *sc, u_long ioctl_request, caddr_t addr, int32_t flags){
136 int error = EINVAL;
137 ips_ioctl_t *ioctl_cmd;
138 ips_user_request *user_request;
139 switch(ioctl_request){
140 case IPS_USER_CMD:
141 user_request = (ips_user_request *)addr;
142 ioctl_cmd = malloc(sizeof(ips_ioctl_t), M_DEVBUF, M_WAITOK);
142 ioctl_cmd = malloc(sizeof(ips_ioctl_t), M_IPSBUF, M_WAITOK);
143 ioctl_cmd->command_buffer = malloc(sizeof(ips_generic_cmd),
143 ioctl_cmd->command_buffer = malloc(sizeof(ips_generic_cmd),
144 M_DEVBUF, M_WAITOK);
144 M_IPSBUF, M_WAITOK);
145 if(copyin(user_request->command_buffer,
146 ioctl_cmd->command_buffer, sizeof(ips_generic_cmd))){
145 if(copyin(user_request->command_buffer,
146 ioctl_cmd->command_buffer, sizeof(ips_generic_cmd))){
147 free(ioctl_cmd->command_buffer, M_DEVBUF);
148 free(ioctl_cmd, M_DEVBUF);
147 free(ioctl_cmd->command_buffer, M_IPSBUF);
148 free(ioctl_cmd, M_IPSBUF);
149 break;
150 }
151 ioctl_cmd->readwrite = IPS_IOCTL_READ | IPS_IOCTL_WRITE;
152 ioctl_cmd->datasize = IPS_IOCTL_BUFFER_SIZE;
153 error = ips_ioctl_cmd(sc, ioctl_cmd, user_request);
149 break;
150 }
151 ioctl_cmd->readwrite = IPS_IOCTL_READ | IPS_IOCTL_WRITE;
152 ioctl_cmd->datasize = IPS_IOCTL_BUFFER_SIZE;
153 error = ips_ioctl_cmd(sc, ioctl_cmd, user_request);
154 free(ioctl_cmd->command_buffer, M_DEVBUF);
155 free(ioctl_cmd, M_DEVBUF);
154 free(ioctl_cmd->command_buffer, M_IPSBUF);
155 free(ioctl_cmd, M_IPSBUF);
156 break;
157 }
158
159 return error;
160}
156 break;
157 }
158
159 return error;
160}