Re: svn commit: r249115 - in head: sbin/camcontrol sys/sys

2018-12-18 Thread Alexey Dokuchaev
On Tue, Nov 27, 2018 at 01:45:14PM +, Alexey Dokuchaev wrote:
> On Thu, Apr 04, 2013 at 11:19:52PM +, Steven Hartland wrote:
> > New Revision: 249115
> > URL: http://svnweb.freebsd.org/changeset/base/249115
> > 
> > Log:
> >   Adds security options to camcontrol this includes the ability to secure
> >   erase disks such as SSD's
> >   
> >   Adds the ability to run ATA commands via the SCSI ATA Pass-Through(16)
> >   com[m]and
> > 
> > Modified: head/sbin/camcontrol/camcontrol.c
> >  
> > [...]
> > +static int
> > +ata_do_identify(struct cam_device *device, int retry_count, int timeout,
> > +   union ccb *ccb, struct ata_params** ident_bufp)
> > +{
> > [...]
> > +
> > +   error = ata_do_28bit_cmd(device,
> > +ccb,
> > +/*retries*/retry_count,
> > +/*flags*/CAM_DIR_IN,
> > +/*protocol*/AP_PROTO_PIO_IN,
> > +/*tag_action*/MSG_SIMPLE_Q_TAG,
> > +/*command*/command,
> > +/*features*/0,
> > +/*lba*/0,
> > +/*sector_count*/(u_int8_t)sizeof(struct 
> > ata_params),
> 
> This looks strange: sizeof(struct ata_params) is 512, but it is too wide
> for u_int8_t, so it would be truncated to zero.  Should it be 1 (one) here
> instead for ATA_ATA_IDENTIFY command, since it normally returns some data
> which typically fits one sector (>=512 bytes)?

Ping.

./danfe

> > +/*data_ptr*/(u_int8_t *)ptr,
> > +/*dxfer_len*/sizeof(struct ata_params),
> > +/*timeout*/timeout ? timeout : 30 * 1000,
> > +/*quiet*/1);
> >  
> > [...]
> > +   error = ata_do_28bit_cmd(device,
> > +ccb,
> > +/*retries*/retry_count,
> > +/*flags*/CAM_DIR_IN,
> > +/*protocol*/AP_PROTO_PIO_IN,
> > +/*tag_action*/MSG_SIMPLE_Q_TAG,
> > +/*command*/retry_command,
> > +/*features*/0,
> > +/*lba*/0,
> > +/*sector_count*/(u_int8_t)
> > +sizeof(struct ata_params),
> 
> Same here.
> 
> > +/*data_ptr*/(u_int8_t *)ptr,
> > +/*dxfer_len*/sizeof(struct ata_params),
> > +/*timeout*/timeout ? timeout : 30 * 
> > 1000,
> > +/*quiet*/0);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r249115 - in head: sbin/camcontrol sys/sys

2018-11-27 Thread Alexey Dokuchaev
On Thu, Apr 04, 2013 at 11:19:52PM +, Steven Hartland wrote:
> New Revision: 249115
> URL: http://svnweb.freebsd.org/changeset/base/249115
> 
> Log:
>   Adds security options to camcontrol this includes the ability to secure
>   erase disks such as SSD's
>   
>   Adds the ability to run ATA commands via the SCSI ATA Pass-Through(16)
>   com[m]and
> 
> Modified: head/sbin/camcontrol/camcontrol.c
>  
> [...]
> +static int
> +ata_do_identify(struct cam_device *device, int retry_count, int timeout,
> + union ccb *ccb, struct ata_params** ident_bufp)
> +{
> [...]
> +
> + error = ata_do_28bit_cmd(device,
> +  ccb,
> +  /*retries*/retry_count,
> +  /*flags*/CAM_DIR_IN,
> +  /*protocol*/AP_PROTO_PIO_IN,
> +  /*tag_action*/MSG_SIMPLE_Q_TAG,
> +  /*command*/command,
> +  /*features*/0,
> +  /*lba*/0,
> +  /*sector_count*/(u_int8_t)sizeof(struct 
> ata_params),

This looks strange: sizeof(struct ata_params) is 512, but it is too wide
for u_int8_t, so it would be truncated to zero.  Should it be 1 (one) here
instead for ATA_ATA_IDENTIFY command, since it normally returns some data
which typically fits one sector (>=512 bytes)?

> +  /*data_ptr*/(u_int8_t *)ptr,
> +  /*dxfer_len*/sizeof(struct ata_params),
> +  /*timeout*/timeout ? timeout : 30 * 1000,
> +  /*quiet*/1);
>  
> [...]
> + error = ata_do_28bit_cmd(device,
> +  ccb,
> +  /*retries*/retry_count,
> +  /*flags*/CAM_DIR_IN,
> +  /*protocol*/AP_PROTO_PIO_IN,
> +  /*tag_action*/MSG_SIMPLE_Q_TAG,
> +  /*command*/retry_command,
> +  /*features*/0,
> +  /*lba*/0,
> +  /*sector_count*/(u_int8_t)
> +  sizeof(struct ata_params),

Same here.

> +  /*data_ptr*/(u_int8_t *)ptr,
> +  /*dxfer_len*/sizeof(struct ata_params),
> +  /*timeout*/timeout ? timeout : 30 * 
> 1000,
> +  /*quiet*/0);

./danfe
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r249115 - in head: sbin/camcontrol sys/sys

2013-04-05 Thread Niclas Zeising
On 04/05/13 01:19, Steven Hartland wrote:
 Author: smh
 Date: Thu Apr  4 23:19:51 2013
 New Revision: 249115
 URL: http://svnweb.freebsd.org/changeset/base/249115
 
 Log:
   Adds security options to camcontrol this includes the ability to secure 
 erase
   disks such as SSD's
   
   Adds the ability to run ATA commands via the SCSI ATA Pass-Through(16) 
 comand
   
   Reviewed by:mav
   Approved by:pjd (mentor)
   MFC after:  2 weeks
 
 Modified:
   head/sbin/camcontrol/camcontrol.8

You should bump the date in the manual as well, look for .Dd.
Regards!
-- 
Niclas

___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r249115 - in head: sbin/camcontrol sys/sys

2013-04-05 Thread Steven Hartland
- Original Message - 
From: Niclas Zeising zeising+free...@daemonic.se




On 04/05/13 01:19, Steven Hartland wrote:

Author: smh
Date: Thu Apr  4 23:19:51 2013
New Revision: 249115
URL: http://svnweb.freebsd.org/changeset/base/249115

Log:
  Adds security options to camcontrol this includes the ability to secure erase
  disks such as SSD's
  
  Adds the ability to run ATA commands via the SCSI ATA Pass-Through(16) comand
  
  Reviewed by: mav

  Approved by: pjd (mentor)
  MFC after: 2 weeks

Modified:
  head/sbin/camcontrol/camcontrol.8


You should bump the date in the manual as well, look for .Dd.
Regards!


Got another patch which adds HPA support will include in that :)

   Regards
   Steve


This e.mail is private and confidential between Multiplay (UK) Ltd. and the person or entity to whom it is addressed. In the event of misdirection, the recipient is prohibited from using, copying, printing or otherwise disseminating it or any information contained in it. 


In the event of misdirection, illegible or incomplete transmission please 
telephone +44 845 868 1337
or return the E.mail to postmas...@multiplay.co.uk.

___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org