tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

re: Implement mode_select for atapi tape drives - round 4



On Mon, 10 Aug 2009, matthew green wrote:


  > +        u_int select_len;
  > +        struct select {
  > +                struct scsi_mode_parameter_header_6 header;
  > +                struct scsi_general_block_descriptor blk_desc;
  > +                u_char sense_data[MAX_PAGE_0_SIZE];
  > +        } select;
  > +        struct scsipi_periph *periph = st->sc_periph;
  > +
  > +        select_len = sizeof(select.header) + sizeof(select.blk_desc) +
  > +                     st->page_0_size;
  >
  > should select be __packed?

  Yes, it should probably be. I know most hardware structures are not
  declared __packed in the scsipi code, we've been luky this didn't cause
  issues for now ...


are these structures used heavily?  __packed will significantly
slow down accesses to and from them.

These specific structures aren't used frequently, but their member structures (especially the struct scsi_general_block_descriptor) are members of many others which are more frequently used.



-------------------------------------------------------------------------
|   Paul Goyette   | PGP DSS Key fingerprint: |  E-mail addresses:      |
| Customer Service | FA29 0E3B 35AF E8AE 6651 |  paul at whooppee.com   |
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette at juniper.net |
| Kernel Developer |                          | pgoyette at netbsd.org  |
-------------------------------------------------------------------------


Home | Main Index | Thread Index | Old Index