.. | .. |
---|
607 | 607 | } |
---|
608 | 608 | EXPORT_SYMBOL(at24_mac1_read); |
---|
609 | 609 | |
---|
| 610 | +ssize_t at24_mac2_read(unsigned char* mac) |
---|
| 611 | +{ |
---|
| 612 | + char buf[20]; |
---|
| 613 | + char buf_tmp[12]; |
---|
| 614 | + ssize_t ret; |
---|
| 615 | + if (at24_private == NULL) |
---|
| 616 | + { |
---|
| 617 | + printk("zcl: at24_mac_read at24_private==null error"); |
---|
| 618 | + return 0; |
---|
| 619 | + } |
---|
| 620 | + memset(buf, 0x00, 20); |
---|
| 621 | + memset(buf_tmp, 0x00, 12); |
---|
| 622 | + ret = at24_read_private(at24_private, buf, 0x20, 6); |
---|
| 623 | + if (ret > 0) |
---|
| 624 | + { |
---|
| 625 | + *mac = buf[0]; |
---|
| 626 | + *(mac + 1) = buf[1]; |
---|
| 627 | + *(mac + 2) = buf[2]; |
---|
| 628 | + *(mac + 3) = buf[3]; |
---|
| 629 | + *(mac + 4) = buf[4]; |
---|
| 630 | + *(mac + 5) = buf[5]; |
---|
| 631 | + } |
---|
| 632 | + printk("at24_mac2_read ...............\n"); |
---|
| 633 | + return ret; |
---|
| 634 | +} |
---|
| 635 | +EXPORT_SYMBOL(at24_mac2_read); |
---|
| 636 | + |
---|
| 637 | +ssize_t at24_mac3_read(unsigned char* mac) |
---|
| 638 | +{ |
---|
| 639 | + char buf[20]; |
---|
| 640 | + char buf_tmp[12]; |
---|
| 641 | + ssize_t ret; |
---|
| 642 | + if (at24_private == NULL) |
---|
| 643 | + { |
---|
| 644 | + printk("zcl: at24_mac_read at24_private==null error"); |
---|
| 645 | + return 0; |
---|
| 646 | + } |
---|
| 647 | + memset(buf, 0x00, 20); |
---|
| 648 | + memset(buf_tmp, 0x00, 12); |
---|
| 649 | + ret = at24_read_private(at24_private, buf, 0x30, 6); |
---|
| 650 | + if (ret > 0) |
---|
| 651 | + { |
---|
| 652 | + *mac = buf[0]; |
---|
| 653 | + *(mac + 1) = buf[1]; |
---|
| 654 | + *(mac + 2) = buf[2]; |
---|
| 655 | + *(mac + 3) = buf[3]; |
---|
| 656 | + *(mac + 4) = buf[4]; |
---|
| 657 | + *(mac + 5) = buf[5]; |
---|
| 658 | + } |
---|
| 659 | + printk("at24_mac3_read ...............\n"); |
---|
| 660 | + return ret; |
---|
| 661 | +} |
---|
| 662 | +EXPORT_SYMBOL(at24_mac3_read); |
---|
610 | 663 | static int at24_write(void *priv, unsigned int off, void *val, size_t count) |
---|
611 | 664 | { |
---|
612 | 665 | struct at24_data *at24; |
---|