Changeset 5203

Show
Ignore:
Timestamp:
04/24/08 14:32:16 (7 months ago)
Author:
khali
Message:

Consistently restrict the allowed I2C device address to 0x03 - 0x77.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • i2c-tools/trunk/CHANGES

    r5201 r5203  
    88  i2cdump: Support i2c bus passed by name 
    99           Shorten the usage message 
     10           Restrict the chip address to 0x03-0x77 
    1011  i2cget: Support i2c bus passed by name 
    1112          Shorten the usage message 
    1213  i2cset: Support i2c bus passed by name 
    1314          Shorten the usage message 
     15          Restrict the chip address to 0x03-0x77 
    1416 
    15173.0.1 (2008-04-04) 
  • i2c-tools/trunk/tools/i2cdump.8

    r5195 r5203  
    4646number or name of the I2C bus to be scanned. This number should correspond to one 
    4747of the busses listed by \fIi2cdetect -l\fR. \fIaddress\fR indicates the 
    48 address to be scanned on that bus, and is an integer between 0x00 and 0x7F
     48address to be scanned on that bus, and is an integer between 0x03 and 0x77
    4949.PP 
    5050The \fImode\fR parameter, if specified, is one of the letters \fBb\fP, \fBw\fP, 
  • i2c-tools/trunk/tools/i2cdump.c

    r5201 r5203  
    3636                "Usage: i2cdump [-f] [-y] [-r first-last] I2CBUS ADDRESS [MODE] [BANK [BANKREG]]\n" 
    3737                "  I2CBUS is an integer or an I2C bus name\n" 
    38                 "  ADDRESS is an integer (0x00 - 0x7f)\n" 
     38                "  ADDRESS is an integer (0x03 - 0x77)\n" 
    3939                "  MODE is one of:\n" 
    4040                "    b (byte, default)\n" 
     
    104104                exit(1); 
    105105        } 
    106         if (address < 0 || address > 0x7f) { 
     106        if (address < 0x03 || address > 0x77) { 
    107107                fprintf(stderr, "Error: Address out of range!\n"); 
    108108                help(); 
  • i2c-tools/trunk/tools/i2cget.c

    r5201 r5203  
    11/* 
    22    i2cget.c - A user-space program to read an I2C register. 
    3     Copyright (C) 2005       Jean Delvare <khali@linux-fr.org> 
     3    Copyright (C) 2005-2008  Jean Delvare <khali@linux-fr.org> 
    44 
    55    Based on i2cset.c: 
     
    191191 
    192192        address = strtol(argv[flags+2], &end, 0); 
    193         if (*end || address < 3 || address > 0x77) { 
     193        if (*end || address < 0x03 || address > 0x77) { 
    194194                fprintf(stderr, "Error: Chip address invalid!\n"); 
    195195                help(); 
  • i2c-tools/trunk/tools/i2cset.8

    r5195 r5203  
    4343or name of the I2C bus to be scanned.  This number should correspond to one of 
    4444the busses listed by \fIi2cdetect -l\fR. \fIchip-address\fR specifies the 
    45 address of the chip on that bus, and is an integer between 0x00 and 0x7F
     45address of the chip on that bus, and is an integer between 0x03 and 0x77
    4646\fIdata-address\fR specifies the address on that chip to write to, and is an 
    4747integer between 0x00 and 0xFF. \fIvalue\fR is the value to write to that 
  • i2c-tools/trunk/tools/i2cset.c

    r5201 r5203  
    33    Copyright (C) 2001-2003  Frodo Looijaard <frodol@dds.nl>, and 
    44                             Mark D. Studebaker <mdsxyz123@yahoo.com> 
    5     Copyright (C) 2004-2005  Jean Delvare <khali@linux-fr.org> 
     5    Copyright (C) 2004-2008  Jean Delvare <khali@linux-fr.org> 
    66 
    77    This program is free software; you can redistribute it and/or modify 
     
    3838                "Usage: i2cset [-f] [-y] I2CBUS CHIP-ADDRESS DATA-ADDRESS VALUE [MODE] [MASK]\n" 
    3939                "  I2CBUS is an integer or an I2C bus name\n" 
    40                 "  ADDRESS is an integer (0x00 - 0x7f)\n" 
     40                "  ADDRESS is an integer (0x03 - 0x77)\n" 
    4141                "  MODE is one of:\n" 
    4242                "    b (byte, default)\n" 
     
    8585 
    8686        address = strtol(argv[flags+2], &end, 0); 
    87         if (*end || address < 0 || address > 0x7f) { 
     87        if (*end || address < 0x03 || address > 0x77) { 
    8888                fprintf(stderr, "Error: Chip address invalid!\n"); 
    8989                help();