Главная страница


ru.unix.bsd

 
 - RU.UNIX.BSD ------------------------------------------------------------------
 From : Eugene Grosbein                      2:5006/1       02 May 2006  23:24:04
 To : Eugene Grosbein
 Subject : Re: panic: wrong for umass_cbi_state
 -------------------------------------------------------------------------------- 
 
 03 май 2006, среда, в 00:01 KRAST, Eugene Grosbein написал(а):
 
  EG> Прикладывать:
  EG> gunzip umass-7.0-4.11.diff.gz
  EG> cd /usr/src
  EG> patch </path/to/umass-7.0-4.11.diff
 
 Тут еще надо вставить:
 
 (cd /usr/src/sys/dev/usb && make -f Makefile.usbdevs)
 
 И только потом:
 
  EG> make kernel
 
 Если кому интересно: это просто usbdevs,1.392 и самую малось подправленный
 umass.c,1.135 (в основном, выкинут коммит 1.115),
 вот diff для umass.c,1.135:
 
 - --- umass.c  Sat Mar 18 01:16:22 2006
 +++ /usr/src/sys/dev/usb/umass.c  Wed May  3 00:10:04 2006
 @@ -116,7 +116,7 @@
  #include <dev/usb/usb.h>
  #include <dev/usb/usbdi.h>
  #include <dev/usb/usbdi_util.h>
 -#include "usbdevs.h"
 +#include <dev/usb/usbdevs.h>
  
  #include <cam/cam.h>
  #include <cam/cam_ccb.h>
 @@ -482,6 +482,10 @@
      UMASS_PROTO_RBC | UMASS_PROTO_CBI,
      NO_QUIRKS
    },
 +  { USB_VENDOR_SONY, USB_PRODUCT_SONY_HANDYCAM, 0x0500,
 +    UMASS_PROTO_RBC | UMASS_PROTO_CBI,
 +    RBC_PAD_TO_12
 +  },
    { USB_VENDOR_SONY, USB_PRODUCT_SONY_HANDYCAM, RID_WILDCARD,
      UMASS_PROTO_RBC | UMASS_PROTO_CBI,
      NO_QUIRKS
 @@ -630,7 +634,6 @@
    unsigned char      cam_scsi_command2[CAM_MAX_CDBLEN];
    struct scsi_sense  cam_scsi_sense;
    struct scsi_sense  cam_scsi_test_unit_ready;
 -  usb_callout_t   cam_scsi_rescan_ch;
  
    int     timeout;    /* in msecs */
  
 @@ -928,7 +931,6 @@
  
    sc->iface = uaa->iface;
    sc->ifaceno = uaa->ifaceno;
 -  usb_callout_init(sc->cam_scsi_rescan_ch);
  
    /* initialise the proto and drive values in the umass_softc (again) */
    (void) umass_match_proto(sc, sc->iface, uaa->device);
 @@ -1186,7 +1188,6 @@
    if (sc->intrin_pipe)
       usbd_abort_pipe(sc->intrin_pipe);
  
 -  usb_uncallout_drain(sc->cam_scsi_rescan_ch, umass_cam_rescan, sc);
    if ((sc->proto & UMASS_PROTO_SCSI) ||
        (sc->proto & UMASS_PROTO_ATAPI) ||
        (sc->proto & UMASS_PROTO_UFI) ||
 @@ -1475,6 +1476,7 @@
  umass_bbb_state(usbd_xfer_handle xfer, usbd_private_handle priv,
       usbd_status err)
  {
 +  int Residue;
    struct umass_softc *sc = (struct umass_softc *) priv;
    usbd_xfer_handle next_xfer;
  
 @@ -1661,7 +1663,6 @@
           USETDW(sc->csw.dCSWSignature, CSWSIGNATURE);
       }
  
 -     int Residue;
       Residue = UGETDW(sc->csw.dCSWDataResidue);
       if (Residue == 0 &&
           sc->transfer_datalen - sc->transfer_actlen != 0)
 @@ -2321,15 +2322,17 @@
        cam_sim_path(sc->umass_sim));
  
    if (!cold) {
 -     /* Notify CAM of the new device after a short delay. Any
 +     /* Notify CAM of the new device after 1 second delay. Any
        * failure is benign, as the user can still do it by hand
        * (camcontrol rescan <busno>). Only do this if we are not
        * booting, because CAM does a scan after booting has
        * completed, when interrupts have been enabled.
        */
  
 -     usb_callout(sc->cam_scsi_rescan_ch, MS_TO_TICKS(200),
 -         umass_cam_rescan, sc);
 +     /* XXX This will bomb if the driver is unloaded between attach
 +      * and execution of umass_cam_rescan.
 +      */
 +     timeout(umass_cam_rescan, sc, MS_TO_TICKS(200));
    }
  
    return(0);  /* always succesfull */
 @@ -2354,6 +2357,31 @@
    return(0);
  }
  
 +/*
 + * Common calculate geometry fuction
 + *
 + * Caller should set ccg->volume_size and block_size.
 + * The extended parameter should be zero if extended translation
 + * should not be used.
 + */
 +static void
 +cam_calc_geometry(struct ccb_calc_geometry *ccg, int extended)
 +{
 +  uint32_t size_mb, secs_per_cylinder;
 +
 +  size_mb = ccg->volume_size / ((1024L * 1024L) / ccg->block_size);
 +  if (size_mb > 1024 && extended) {
 +     ccg->heads = 255;
 +     ccg->secs_per_track = 63;
 +  } else {
 +     ccg->heads = 64;
 +     ccg->secs_per_track = 32;
 +  }
 +  secs_per_cylinder = ccg->heads * ccg->secs_per_track;
 +  ccg->cylinders = ccg->volume_size / secs_per_cylinder;
 +  ccg->ccb_h.status = CAM_REQ_CMP;
 +}
 +
  /* umass_cam_action
   *   CAM requests for action come through here
   */
 @@ -2967,6 +2995,16 @@
       return 0;   /* failure */
    }
  }
 +
 +#ifndef  READ_FORMAT_CAPACITIES
 +#define  READ_FORMAT_CAPACITIES  0x23
 +#endif
 +#ifndef  WRITE_AND_VERIFY
 +#define WRITE_AND_VERIFY  0x2e
 +#endif
 +#ifndef  VERIFY
 +#define VERIFY       0x2f
 +#endif
  
  /*
   * UFI specific functions
 Eugene
 -- 
 Что делают там, где воруют и сам царь, и его советник, и главный жрец? (Артха)
 --- slrn/0.9.8.0 (FreeBSD)
  * Origin: Svyaz Service JSC (2:5006/1@fidonet)
 
 

Вернуться к списку тем, сортированных по: возрастание даты  уменьшение даты  тема  автор 

 Тема:    Автор:    Дата:  
 panic: wrong for umass_cbi_state   Eugene Grosbein   02 May 2006 20:49:03 
 Re: panic: wrong for umass_cbi_state   Eugene Grosbein   02 May 2006 23:01:50 
 Re: panic: wrong for umass_cbi_state   Eugene Grosbein   02 May 2006 23:24:04 
Архивное /ru.unix.bsd/26093dc010338.html, оценка 1 из 5, голосов 10
Яндекс.Метрика
Valid HTML 4.01 Transitional