scsi_pass.c (6cec9cad762b6476313fb1f8e931a1647822db6b) | scsi_pass.c (de2393124c0053d832da9e6de0f675e888ed61c7) |
---|---|
1/*- 2 * Copyright (c) 1997, 1998, 2000 Justin T. Gibbs. 3 * Copyright (c) 1997, 1998, 1999 Kenneth D. Merry. 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: --- 63 unchanged lines hidden (view full) --- 72#define ccb_bp ppriv_ptr1 73 74struct pass_softc { 75 pass_state state; 76 pass_flags flags; 77 u_int8_t pd_type; 78 union ccb saved_ccb; 79 int open_count; | 1/*- 2 * Copyright (c) 1997, 1998, 2000 Justin T. Gibbs. 3 * Copyright (c) 1997, 1998, 1999 Kenneth D. Merry. 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: --- 63 unchanged lines hidden (view full) --- 72#define ccb_bp ppriv_ptr1 73 74struct pass_softc { 75 pass_state state; 76 pass_flags flags; 77 u_int8_t pd_type; 78 union ccb saved_ccb; 79 int open_count; |
80 u_int maxio; |
|
80 struct devstat *device_stats; 81 struct cdev *dev; 82 struct cdev *alias_dev; 83 struct task add_physpath_task; 84}; 85 86 87static d_open_t passopen; --- 273 unchanged lines hidden (view full) --- 361 362 periph->softc = softc; 363 364 bzero(&cpi, sizeof(cpi)); 365 xpt_setup_ccb(&cpi.ccb_h, periph->path, CAM_PRIORITY_NORMAL); 366 cpi.ccb_h.func_code = XPT_PATH_INQ; 367 xpt_action((union ccb *)&cpi); 368 | 81 struct devstat *device_stats; 82 struct cdev *dev; 83 struct cdev *alias_dev; 84 struct task add_physpath_task; 85}; 86 87 88static d_open_t passopen; --- 273 unchanged lines hidden (view full) --- 362 363 periph->softc = softc; 364 365 bzero(&cpi, sizeof(cpi)); 366 xpt_setup_ccb(&cpi.ccb_h, periph->path, CAM_PRIORITY_NORMAL); 367 cpi.ccb_h.func_code = XPT_PATH_INQ; 368 xpt_action((union ccb *)&cpi); 369 |
370 if (cpi.maxio == 0) 371 softc->maxio = DFLTPHYS; /* traditional default */ 372 else if (cpi.maxio > MAXPHYS) 373 softc->maxio = MAXPHYS; /* for safety */ 374 else 375 softc->maxio = cpi.maxio; /* real value */ 376 |
|
369 /* 370 * We pass in 0 for a blocksize, since we don't 371 * know what the blocksize of this device is, if 372 * it even has a blocksize. 373 */ 374 cam_periph_unlock(periph); 375 no_tags = (cgd->inq_data.flags & SID_CmdQue) == 0; 376 softc->device_stats = devstat_new_entry("pass", --- 275 unchanged lines hidden (view full) --- 652 bzero(&mapinfo, sizeof(mapinfo)); 653 654 /* 655 * cam_periph_mapmem calls into proc and vm functions that can 656 * sleep as well as trigger I/O, so we can't hold the lock. 657 * Dropping it here is reasonably safe. 658 */ 659 cam_periph_unlock(periph); | 377 /* 378 * We pass in 0 for a blocksize, since we don't 379 * know what the blocksize of this device is, if 380 * it even has a blocksize. 381 */ 382 cam_periph_unlock(periph); 383 no_tags = (cgd->inq_data.flags & SID_CmdQue) == 0; 384 softc->device_stats = devstat_new_entry("pass", --- 275 unchanged lines hidden (view full) --- 660 bzero(&mapinfo, sizeof(mapinfo)); 661 662 /* 663 * cam_periph_mapmem calls into proc and vm functions that can 664 * sleep as well as trigger I/O, so we can't hold the lock. 665 * Dropping it here is reasonably safe. 666 */ 667 cam_periph_unlock(periph); |
660 error = cam_periph_mapmem(ccb, &mapinfo); | 668 error = cam_periph_mapmem(ccb, &mapinfo, softc->maxio); |
661 cam_periph_lock(periph); 662 663 /* 664 * cam_periph_mapmem returned an error, we can't continue. 665 * Return the error to the user. 666 */ 667 if (error) 668 return(error); --- 35 unchanged lines hidden --- | 669 cam_periph_lock(periph); 670 671 /* 672 * cam_periph_mapmem returned an error, we can't continue. 673 * Return the error to the user. 674 */ 675 if (error) 676 return(error); --- 35 unchanged lines hidden --- |