mfi_show.c (219717) | mfi_show.c (219722) |
---|---|
1/*- 2 * Copyright (c) 2008, 2009 Yahoo!, Inc. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 12 unchanged lines hidden (view full) --- 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * | 1/*- 2 * Copyright (c) 2008, 2009 Yahoo!, Inc. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 12 unchanged lines hidden (view full) --- 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * |
29 * $FreeBSD: head/usr.sbin/mfiutil/mfi_show.c 219717 2011-03-17 17:29:46Z jhb $ | 29 * $FreeBSD: head/usr.sbin/mfiutil/mfi_show.c 219722 2011-03-17 21:24:32Z jhb $ |
30 */ 31 32#include <sys/types.h> 33#include <sys/errno.h> 34#include <err.h> 35#include <libutil.h> 36#include <stdio.h> 37#include <stdlib.h> --- 131 unchanged lines hidden (view full) --- 169 sizeof(design), NULL, 0, NULL) < 0) { 170 error = errno; 171 warn("Failed to get design info"); 172 return (error); 173 } 174 175 if (mfi_dcmd_command(fd, MFI_DCMD_BBU_GET_STATUS, &stat, sizeof(stat), 176 NULL, 0, NULL) < 0) { | 30 */ 31 32#include <sys/types.h> 33#include <sys/errno.h> 34#include <err.h> 35#include <libutil.h> 36#include <stdio.h> 37#include <stdlib.h> --- 131 unchanged lines hidden (view full) --- 169 sizeof(design), NULL, 0, NULL) < 0) { 170 error = errno; 171 warn("Failed to get design info"); 172 return (error); 173 } 174 175 if (mfi_dcmd_command(fd, MFI_DCMD_BBU_GET_STATUS, &stat, sizeof(stat), 176 NULL, 0, NULL) < 0) { |
177 error = errno; |
|
177 warn("Failed to get status"); | 178 warn("Failed to get status"); |
178 return (errno); | 179 return (error); |
179 } 180 181 printf("mfi%d: Battery State:\n", mfi_unit); 182 printf(" Manufacture Date: %d/%d/%d\n", design.mfg_date >> 5 & 0x0f, 183 design.mfg_date & 0x1f, design.mfg_date >> 9 & 0xffff); 184 printf(" Serial Number: %d\n", design.serial_number); 185 printf(" Manufacturer: %s\n", design.mfg_name); 186 printf(" Model: %s\n", design.device_name); --- 432 unchanged lines hidden --- | 180 } 181 182 printf("mfi%d: Battery State:\n", mfi_unit); 183 printf(" Manufacture Date: %d/%d/%d\n", design.mfg_date >> 5 & 0x0f, 184 design.mfg_date & 0x1f, design.mfg_date >> 9 & 0xffff); 185 printf(" Serial Number: %d\n", design.serial_number); 186 printf(" Manufacturer: %s\n", design.mfg_name); 187 printf(" Model: %s\n", design.device_name); --- 432 unchanged lines hidden --- |