| .. | .. |
|---|
| 564 | 564 | } |
|---|
| 565 | 565 | EXPORT_SYMBOL(at24_mac1_read); |
|---|
| 566 | 566 | |
|---|
| 567 | +ssize_t at24_mac2_read(unsigned char* mac) |
|---|
| 568 | +{ |
|---|
| 569 | + char buf[20]; |
|---|
| 570 | + char buf_tmp[12]; |
|---|
| 571 | + ssize_t ret; |
|---|
| 572 | + if (at24_private == NULL) |
|---|
| 573 | + { |
|---|
| 574 | + printk("zcl: at24_mac_read at24_private==null error"); |
|---|
| 575 | + return 0; |
|---|
| 576 | + } |
|---|
| 577 | + memset(buf, 0x00, 20); |
|---|
| 578 | + memset(buf_tmp, 0x00, 12); |
|---|
| 579 | + ret = at24_read_private(at24_private, buf, 0x20, 6); |
|---|
| 580 | + if (ret > 0) |
|---|
| 581 | + { |
|---|
| 582 | + *mac = buf[0]; |
|---|
| 583 | + *(mac + 1) = buf[1]; |
|---|
| 584 | + *(mac + 2) = buf[2]; |
|---|
| 585 | + *(mac + 3) = buf[3]; |
|---|
| 586 | + *(mac + 4) = buf[4]; |
|---|
| 587 | + *(mac + 5) = buf[5]; |
|---|
| 588 | + } |
|---|
| 589 | + printk("at24_mac2_read ...............\n"); |
|---|
| 590 | + return ret; |
|---|
| 591 | +} |
|---|
| 592 | +EXPORT_SYMBOL(at24_mac2_read); |
|---|
| 593 | + |
|---|
| 567 | 594 | static int at24_write(void *priv, unsigned int off, void *val, size_t count) |
|---|
| 568 | 595 | { |
|---|
| 569 | 596 | struct at24_data *at24; |
|---|