/linux-4.4.14/drivers/dma-buf/ |
H A D | Makefile | 1 obj-y := dma-buf.o fence.o reservation.o seqno-fence.o
|
/linux-4.4.14/net/bridge/ |
H A D | br_stp_bpdu.c | 85 unsigned char buf[35]; br_send_config_bpdu() local 90 buf[0] = 0; br_send_config_bpdu() 91 buf[1] = 0; br_send_config_bpdu() 92 buf[2] = 0; br_send_config_bpdu() 93 buf[3] = BPDU_TYPE_CONFIG; br_send_config_bpdu() 94 buf[4] = (bpdu->topology_change ? 0x01 : 0) | br_send_config_bpdu() 96 buf[5] = bpdu->root.prio[0]; br_send_config_bpdu() 97 buf[6] = bpdu->root.prio[1]; br_send_config_bpdu() 98 buf[7] = bpdu->root.addr[0]; br_send_config_bpdu() 99 buf[8] = bpdu->root.addr[1]; br_send_config_bpdu() 100 buf[9] = bpdu->root.addr[2]; br_send_config_bpdu() 101 buf[10] = bpdu->root.addr[3]; br_send_config_bpdu() 102 buf[11] = bpdu->root.addr[4]; br_send_config_bpdu() 103 buf[12] = bpdu->root.addr[5]; br_send_config_bpdu() 104 buf[13] = (bpdu->root_path_cost >> 24) & 0xFF; br_send_config_bpdu() 105 buf[14] = (bpdu->root_path_cost >> 16) & 0xFF; br_send_config_bpdu() 106 buf[15] = (bpdu->root_path_cost >> 8) & 0xFF; br_send_config_bpdu() 107 buf[16] = bpdu->root_path_cost & 0xFF; br_send_config_bpdu() 108 buf[17] = bpdu->bridge_id.prio[0]; br_send_config_bpdu() 109 buf[18] = bpdu->bridge_id.prio[1]; br_send_config_bpdu() 110 buf[19] = bpdu->bridge_id.addr[0]; br_send_config_bpdu() 111 buf[20] = bpdu->bridge_id.addr[1]; br_send_config_bpdu() 112 buf[21] = bpdu->bridge_id.addr[2]; br_send_config_bpdu() 113 buf[22] = bpdu->bridge_id.addr[3]; br_send_config_bpdu() 114 buf[23] = bpdu->bridge_id.addr[4]; br_send_config_bpdu() 115 buf[24] = bpdu->bridge_id.addr[5]; br_send_config_bpdu() 116 buf[25] = (bpdu->port_id >> 8) & 0xFF; br_send_config_bpdu() 117 buf[26] = bpdu->port_id & 0xFF; br_send_config_bpdu() 119 br_set_ticks(buf+27, bpdu->message_age); br_send_config_bpdu() 120 br_set_ticks(buf+29, bpdu->max_age); br_send_config_bpdu() 121 br_set_ticks(buf+31, bpdu->hello_time); br_send_config_bpdu() 122 br_set_ticks(buf+33, bpdu->forward_delay); br_send_config_bpdu() 124 br_send_bpdu(p, buf, 35); br_send_config_bpdu() 130 unsigned char buf[4]; br_send_tcn_bpdu() local 135 buf[0] = 0; br_send_tcn_bpdu() 136 buf[1] = 0; br_send_tcn_bpdu() 137 buf[2] = 0; br_send_tcn_bpdu() 138 buf[3] = BPDU_TYPE_TCN; br_send_tcn_bpdu() 139 br_send_bpdu(p, buf, 4); br_send_tcn_bpdu() 153 const unsigned char *buf; br_stp_rcv() local 159 buf = skb->data; br_stp_rcv() 160 if (buf[0] != 0 || buf[1] != 0 || buf[2] != 0) br_stp_rcv() 189 buf = skb_pull(skb, 3); br_stp_rcv() 191 if (buf[0] == BPDU_TYPE_CONFIG) { br_stp_rcv() 197 buf = skb->data; br_stp_rcv() 198 bpdu.topology_change = (buf[1] & 0x01) ? 1 : 0; br_stp_rcv() 199 bpdu.topology_change_ack = (buf[1] & 0x80) ? 1 : 0; br_stp_rcv() 201 bpdu.root.prio[0] = buf[2]; br_stp_rcv() 202 bpdu.root.prio[1] = buf[3]; br_stp_rcv() 203 bpdu.root.addr[0] = buf[4]; br_stp_rcv() 204 bpdu.root.addr[1] = buf[5]; br_stp_rcv() 205 bpdu.root.addr[2] = buf[6]; br_stp_rcv() 206 bpdu.root.addr[3] = buf[7]; br_stp_rcv() 207 bpdu.root.addr[4] = buf[8]; br_stp_rcv() 208 bpdu.root.addr[5] = buf[9]; br_stp_rcv() 210 (buf[10] << 24) | br_stp_rcv() 211 (buf[11] << 16) | br_stp_rcv() 212 (buf[12] << 8) | br_stp_rcv() 213 buf[13]; br_stp_rcv() 214 bpdu.bridge_id.prio[0] = buf[14]; br_stp_rcv() 215 bpdu.bridge_id.prio[1] = buf[15]; br_stp_rcv() 216 bpdu.bridge_id.addr[0] = buf[16]; br_stp_rcv() 217 bpdu.bridge_id.addr[1] = buf[17]; br_stp_rcv() 218 bpdu.bridge_id.addr[2] = buf[18]; br_stp_rcv() 219 bpdu.bridge_id.addr[3] = buf[19]; br_stp_rcv() 220 bpdu.bridge_id.addr[4] = buf[20]; br_stp_rcv() 221 bpdu.bridge_id.addr[5] = buf[21]; br_stp_rcv() 222 bpdu.port_id = (buf[22] << 8) | buf[23]; br_stp_rcv() 224 bpdu.message_age = br_get_ticks(buf+24); br_stp_rcv() 225 bpdu.max_age = br_get_ticks(buf+26); br_stp_rcv() 226 bpdu.hello_time = br_get_ticks(buf+28); br_stp_rcv() 227 bpdu.forward_delay = br_get_ticks(buf+30); br_stp_rcv() 241 } else if (buf[0] == BPDU_TYPE_TCN) { br_stp_rcv()
|
H A D | br_sysfs_br.c | 32 const char *buf, size_t len, store_bridge_parm() 43 val = simple_strtoul(buf, &endp, 0); store_bridge_parm() 44 if (endp == buf) store_bridge_parm() 53 struct device_attribute *attr, char *buf) forward_delay_show() 56 return sprintf(buf, "%lu\n", jiffies_to_clock_t(br->forward_delay)); forward_delay_show() 61 const char *buf, size_t len) forward_delay_store() 63 return store_bridge_parm(d, buf, len, br_set_forward_delay); forward_delay_store() 68 char *buf) hello_time_show() 70 return sprintf(buf, "%lu\n", hello_time_show() 75 struct device_attribute *attr, const char *buf, hello_time_store() 78 return store_bridge_parm(d, buf, len, br_set_hello_time); hello_time_store() 83 char *buf) max_age_show() 85 return sprintf(buf, "%lu\n", max_age_show() 90 const char *buf, size_t len) max_age_store() 92 return store_bridge_parm(d, buf, len, br_set_max_age); max_age_store() 97 struct device_attribute *attr, char *buf) ageing_time_show() 100 return sprintf(buf, "%lu\n", jiffies_to_clock_t(br->ageing_time)); ageing_time_show() 118 const char *buf, size_t len) ageing_time_store() 120 return store_bridge_parm(d, buf, len, set_ageing_time); ageing_time_store() 125 struct device_attribute *attr, char *buf) stp_state_show() 128 return sprintf(buf, "%d\n", br->stp_enabled); stp_state_show() 133 struct device_attribute *attr, const char *buf, stp_state_store() 143 val = simple_strtoul(buf, &endp, 0); stp_state_store() 144 if (endp == buf) stp_state_store() 158 char *buf) group_fwd_mask_show() 161 return sprintf(buf, "%#x\n", br->group_fwd_mask); group_fwd_mask_show() 167 const char *buf, group_fwd_mask_store() 177 val = simple_strtoul(buf, &endp, 0); group_fwd_mask_store() 178 if (endp == buf) group_fwd_mask_store() 191 char *buf) priority_show() 194 return sprintf(buf, "%d\n", priority_show() 205 const char *buf, size_t len) priority_store() 207 return store_bridge_parm(d, buf, len, set_priority); priority_store() 212 char *buf) root_id_show() 214 return br_show_bridge_id(buf, &to_bridge(d)->designated_root); root_id_show() 219 char *buf) bridge_id_show() 221 return br_show_bridge_id(buf, &to_bridge(d)->bridge_id); bridge_id_show() 226 char *buf) root_port_show() 228 return sprintf(buf, "%d\n", to_bridge(d)->root_port); root_port_show() 233 struct device_attribute *attr, char *buf) root_path_cost_show() 235 return sprintf(buf, "%d\n", to_bridge(d)->root_path_cost); root_path_cost_show() 240 struct device_attribute *attr, char *buf) topology_change_show() 242 return sprintf(buf, "%d\n", to_bridge(d)->topology_change); topology_change_show() 248 char *buf) topology_change_detected_show() 251 return sprintf(buf, "%d\n", br->topology_change_detected); topology_change_detected_show() 256 struct device_attribute *attr, char *buf) hello_timer_show() 259 return sprintf(buf, "%ld\n", br_timer_value(&br->hello_timer)); hello_timer_show() 264 char *buf) tcn_timer_show() 267 return sprintf(buf, "%ld\n", br_timer_value(&br->tcn_timer)); tcn_timer_show() 273 char *buf) topology_change_timer_show() 276 return sprintf(buf, "%ld\n", br_timer_value(&br->topology_change_timer)); topology_change_timer_show() 281 char *buf) gc_timer_show() 284 return sprintf(buf, "%ld\n", br_timer_value(&br->gc_timer)); gc_timer_show() 289 struct device_attribute *attr, char *buf) group_addr_show() 292 return sprintf(buf, "%x:%x:%x:%x:%x:%x\n", group_addr_show() 300 const char *buf, size_t len) group_addr_store() 309 if (sscanf(buf, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", group_addr_store() 342 const char *buf, size_t len) flush_store() 356 struct device_attribute *attr, char *buf) multicast_router_show() 359 return sprintf(buf, "%d\n", br->multicast_router); multicast_router_show() 364 const char *buf, size_t len) multicast_router_store() 366 return store_bridge_parm(d, buf, len, br_multicast_set_router); multicast_router_store() 372 char *buf) multicast_snooping_show() 375 return sprintf(buf, "%d\n", !br->multicast_disabled); multicast_snooping_show() 380 const char *buf, size_t len) multicast_snooping_store() 382 return store_bridge_parm(d, buf, len, br_multicast_toggle); multicast_snooping_store() 388 char *buf) multicast_query_use_ifaddr_show() 391 return sprintf(buf, "%d\n", br->multicast_query_use_ifaddr); multicast_query_use_ifaddr_show() 403 const char *buf, size_t len) multicast_query_use_ifaddr_store() 405 return store_bridge_parm(d, buf, len, set_query_use_ifaddr); multicast_query_use_ifaddr_store() 411 char *buf) multicast_querier_show() 414 return sprintf(buf, "%d\n", br->multicast_querier); multicast_querier_show() 419 const char *buf, size_t len) multicast_querier_store() 421 return store_bridge_parm(d, buf, len, br_multicast_set_querier); multicast_querier_store() 426 struct device_attribute *attr, char *buf) hash_elasticity_show() 429 return sprintf(buf, "%u\n", br->hash_elasticity); hash_elasticity_show() 440 const char *buf, size_t len) hash_elasticity_store() 442 return store_bridge_parm(d, buf, len, set_elasticity); hash_elasticity_store() 447 char *buf) hash_max_show() 450 return sprintf(buf, "%u\n", br->hash_max); hash_max_show() 454 const char *buf, size_t len) hash_max_store() 456 return store_bridge_parm(d, buf, len, br_multicast_set_hash_max); hash_max_store() 462 char *buf) multicast_last_member_count_show() 465 return sprintf(buf, "%u\n", br->multicast_last_member_count); multicast_last_member_count_show() 476 const char *buf, size_t len) multicast_last_member_count_store() 478 return store_bridge_parm(d, buf, len, set_last_member_count); multicast_last_member_count_store() 483 struct device *d, struct device_attribute *attr, char *buf) multicast_startup_query_count_show() 486 return sprintf(buf, "%u\n", br->multicast_startup_query_count); multicast_startup_query_count_show() 496 struct device *d, struct device_attribute *attr, const char *buf, multicast_startup_query_count_store() 499 return store_bridge_parm(d, buf, len, set_startup_query_count); multicast_startup_query_count_store() 504 struct device *d, struct device_attribute *attr, char *buf) multicast_last_member_interval_show() 507 return sprintf(buf, "%lu\n", multicast_last_member_interval_show() 518 struct device *d, struct device_attribute *attr, const char *buf, multicast_last_member_interval_store() 521 return store_bridge_parm(d, buf, len, set_last_member_interval); multicast_last_member_interval_store() 526 struct device *d, struct device_attribute *attr, char *buf) multicast_membership_interval_show() 529 return sprintf(buf, "%lu\n", multicast_membership_interval_show() 540 struct device *d, struct device_attribute *attr, const char *buf, multicast_membership_interval_store() 543 return store_bridge_parm(d, buf, len, set_membership_interval); multicast_membership_interval_store() 549 char *buf) multicast_querier_interval_show() 552 return sprintf(buf, "%lu\n", multicast_querier_interval_show() 564 const char *buf, size_t len) multicast_querier_interval_store() 566 return store_bridge_parm(d, buf, len, set_querier_interval); multicast_querier_interval_store() 572 char *buf) multicast_query_interval_show() 575 return sprintf(buf, "%lu\n", multicast_query_interval_show() 587 const char *buf, size_t len) multicast_query_interval_store() 589 return store_bridge_parm(d, buf, len, set_query_interval); multicast_query_interval_store() 594 struct device *d, struct device_attribute *attr, char *buf) multicast_query_response_interval_show() 598 buf, "%lu\n", multicast_query_response_interval_show() 609 struct device *d, struct device_attribute *attr, const char *buf, multicast_query_response_interval_store() 612 return store_bridge_parm(d, buf, len, set_query_response_interval); multicast_query_response_interval_store() 617 struct device *d, struct device_attribute *attr, char *buf) multicast_startup_query_interval_show() 621 buf, "%lu\n", multicast_startup_query_interval_show() 632 struct device *d, struct device_attribute *attr, const char *buf, multicast_startup_query_interval_store() 635 return store_bridge_parm(d, buf, len, set_startup_query_interval); multicast_startup_query_interval_store() 641 struct device *d, struct device_attribute *attr, char *buf) nf_call_iptables_show() 644 return sprintf(buf, "%u\n", br->nf_call_iptables); nf_call_iptables_show() 654 struct device *d, struct device_attribute *attr, const char *buf, nf_call_iptables_store() 657 return store_bridge_parm(d, buf, len, set_nf_call_iptables); nf_call_iptables_store() 662 struct device *d, struct device_attribute *attr, char *buf) nf_call_ip6tables_show() 665 return sprintf(buf, "%u\n", br->nf_call_ip6tables); nf_call_ip6tables_show() 675 struct device *d, struct device_attribute *attr, const char *buf, nf_call_ip6tables_store() 678 return store_bridge_parm(d, buf, len, set_nf_call_ip6tables); nf_call_ip6tables_store() 683 struct device *d, struct device_attribute *attr, char *buf) nf_call_arptables_show() 686 return sprintf(buf, "%u\n", br->nf_call_arptables); nf_call_arptables_show() 696 struct device *d, struct device_attribute *attr, const char *buf, nf_call_arptables_store() 699 return store_bridge_parm(d, buf, len, set_nf_call_arptables); nf_call_arptables_store() 706 char *buf) vlan_filtering_show() 709 return sprintf(buf, "%d\n", br->vlan_enabled); vlan_filtering_show() 714 const char *buf, size_t len) vlan_filtering_store() 716 return store_bridge_parm(d, buf, len, br_vlan_filter_toggle); vlan_filtering_store() 722 char *buf) vlan_protocol_show() 725 return sprintf(buf, "%#06x\n", ntohs(br->vlan_proto)); vlan_protocol_show() 730 const char *buf, size_t len) vlan_protocol_store() 732 return store_bridge_parm(d, buf, len, br_vlan_set_proto); vlan_protocol_store() 738 char *buf) default_pvid_show() 741 return sprintf(buf, "%d\n", br->default_pvid); default_pvid_show() 746 const char *buf, size_t len) default_pvid_store() 748 return store_bridge_parm(d, buf, len, br_vlan_set_default_pvid); default_pvid_store() 815 char *buf, loff_t off, size_t count) brforward_read() 825 n = br_fdb_fillbuf(br, buf, brforward_read() 31 store_bridge_parm(struct device *d, const char *buf, size_t len, int (*set)(struct net_bridge *, unsigned long)) store_bridge_parm() argument 52 forward_delay_show(struct device *d, struct device_attribute *attr, char *buf) forward_delay_show() argument 59 forward_delay_store(struct device *d, struct device_attribute *attr, const char *buf, size_t len) forward_delay_store() argument 67 hello_time_show(struct device *d, struct device_attribute *attr, char *buf) hello_time_show() argument 74 hello_time_store(struct device *d, struct device_attribute *attr, const char *buf, size_t len) hello_time_store() argument 82 max_age_show(struct device *d, struct device_attribute *attr, char *buf) max_age_show() argument 89 max_age_store(struct device *d, struct device_attribute *attr, const char *buf, size_t len) max_age_store() argument 96 ageing_time_show(struct device *d, struct device_attribute *attr, char *buf) ageing_time_show() argument 116 ageing_time_store(struct device *d, struct device_attribute *attr, const char *buf, size_t len) ageing_time_store() argument 124 stp_state_show(struct device *d, struct device_attribute *attr, char *buf) stp_state_show() argument 132 stp_state_store(struct device *d, struct device_attribute *attr, const char *buf, size_t len) stp_state_store() argument 156 group_fwd_mask_show(struct device *d, struct device_attribute *attr, char *buf) group_fwd_mask_show() argument 165 group_fwd_mask_store(struct device *d, struct device_attribute *attr, const char *buf, size_t len) group_fwd_mask_store() argument 190 priority_show(struct device *d, struct device_attribute *attr, char *buf) priority_show() argument 204 priority_store(struct device *d, struct device_attribute *attr, const char *buf, size_t len) priority_store() argument 211 root_id_show(struct device *d, struct device_attribute *attr, char *buf) root_id_show() argument 218 bridge_id_show(struct device *d, struct device_attribute *attr, char *buf) bridge_id_show() argument 225 root_port_show(struct device *d, struct device_attribute *attr, char *buf) root_port_show() argument 232 root_path_cost_show(struct device *d, struct device_attribute *attr, char *buf) root_path_cost_show() argument 239 topology_change_show(struct device *d, struct device_attribute *attr, char *buf) topology_change_show() argument 246 topology_change_detected_show(struct device *d, struct device_attribute *attr, char *buf) topology_change_detected_show() argument 255 hello_timer_show(struct device *d, struct device_attribute *attr, char *buf) hello_timer_show() argument 263 tcn_timer_show(struct device *d, struct device_attribute *attr, char *buf) tcn_timer_show() argument 271 topology_change_timer_show(struct device *d, struct device_attribute *attr, char *buf) topology_change_timer_show() argument 280 gc_timer_show(struct device *d, struct device_attribute *attr, char *buf) gc_timer_show() argument 288 group_addr_show(struct device *d, struct device_attribute *attr, char *buf) group_addr_show() argument 298 group_addr_store(struct device *d, struct device_attribute *attr, const char *buf, size_t len) group_addr_store() argument 340 flush_store(struct device *d, struct device_attribute *attr, const char *buf, size_t len) flush_store() argument 355 multicast_router_show(struct device *d, struct device_attribute *attr, char *buf) multicast_router_show() argument 362 multicast_router_store(struct device *d, struct device_attribute *attr, const char *buf, size_t len) multicast_router_store() argument 370 multicast_snooping_show(struct device *d, struct device_attribute *attr, char *buf) multicast_snooping_show() argument 378 multicast_snooping_store(struct device *d, struct device_attribute *attr, const char *buf, size_t len) multicast_snooping_store() argument 386 multicast_query_use_ifaddr_show(struct device *d, struct device_attribute *attr, char *buf) multicast_query_use_ifaddr_show() argument 401 multicast_query_use_ifaddr_store(struct device *d, struct device_attribute *attr, const char *buf, size_t len) multicast_query_use_ifaddr_store() argument 409 multicast_querier_show(struct device *d, struct device_attribute *attr, char *buf) multicast_querier_show() argument 417 multicast_querier_store(struct device *d, struct device_attribute *attr, const char *buf, size_t len) multicast_querier_store() argument 425 hash_elasticity_show(struct device *d, struct device_attribute *attr, char *buf) hash_elasticity_show() argument 438 hash_elasticity_store(struct device *d, struct device_attribute *attr, const char *buf, size_t len) hash_elasticity_store() argument 446 hash_max_show(struct device *d, struct device_attribute *attr, char *buf) hash_max_show() argument 453 hash_max_store(struct device *d, struct device_attribute *attr, const char *buf, size_t len) hash_max_store() argument 460 multicast_last_member_count_show(struct device *d, struct device_attribute *attr, char *buf) multicast_last_member_count_show() argument 474 multicast_last_member_count_store(struct device *d, struct device_attribute *attr, const char *buf, size_t len) multicast_last_member_count_store() argument 482 multicast_startup_query_count_show( struct device *d, struct device_attribute *attr, char *buf) multicast_startup_query_count_show() argument 495 multicast_startup_query_count_store( struct device *d, struct device_attribute *attr, const char *buf, size_t len) multicast_startup_query_count_store() argument 503 multicast_last_member_interval_show( struct device *d, struct device_attribute *attr, char *buf) multicast_last_member_interval_show() argument 517 multicast_last_member_interval_store( struct device *d, struct device_attribute *attr, const char *buf, size_t len) multicast_last_member_interval_store() argument 525 multicast_membership_interval_show( struct device *d, struct device_attribute *attr, char *buf) multicast_membership_interval_show() argument 539 multicast_membership_interval_store( struct device *d, struct device_attribute *attr, const char *buf, size_t len) multicast_membership_interval_store() argument 547 multicast_querier_interval_show(struct device *d, struct device_attribute *attr, char *buf) multicast_querier_interval_show() argument 562 multicast_querier_interval_store(struct device *d, struct device_attribute *attr, const char *buf, size_t len) multicast_querier_interval_store() argument 570 multicast_query_interval_show(struct device *d, struct device_attribute *attr, char *buf) multicast_query_interval_show() argument 585 multicast_query_interval_store(struct device *d, struct device_attribute *attr, const char *buf, size_t len) multicast_query_interval_store() argument 593 multicast_query_response_interval_show( struct device *d, struct device_attribute *attr, char *buf) multicast_query_response_interval_show() argument 608 multicast_query_response_interval_store( struct device *d, struct device_attribute *attr, const char *buf, size_t len) multicast_query_response_interval_store() argument 616 multicast_startup_query_interval_show( struct device *d, struct device_attribute *attr, char *buf) multicast_startup_query_interval_show() argument 631 multicast_startup_query_interval_store( struct device *d, struct device_attribute *attr, const char *buf, size_t len) multicast_startup_query_interval_store() argument 640 nf_call_iptables_show( struct device *d, struct device_attribute *attr, char *buf) nf_call_iptables_show() argument 653 nf_call_iptables_store( struct device *d, struct device_attribute *attr, const char *buf, size_t len) nf_call_iptables_store() argument 661 nf_call_ip6tables_show( struct device *d, struct device_attribute *attr, char *buf) nf_call_ip6tables_show() argument 674 nf_call_ip6tables_store( struct device *d, struct device_attribute *attr, const char *buf, size_t len) nf_call_ip6tables_store() argument 682 nf_call_arptables_show( struct device *d, struct device_attribute *attr, char *buf) nf_call_arptables_show() argument 695 nf_call_arptables_store( struct device *d, struct device_attribute *attr, const char *buf, size_t len) nf_call_arptables_store() argument 704 vlan_filtering_show(struct device *d, struct device_attribute *attr, char *buf) vlan_filtering_show() argument 712 vlan_filtering_store(struct device *d, struct device_attribute *attr, const char *buf, size_t len) vlan_filtering_store() argument 720 vlan_protocol_show(struct device *d, struct device_attribute *attr, char *buf) vlan_protocol_show() argument 728 vlan_protocol_store(struct device *d, struct device_attribute *attr, const char *buf, size_t len) vlan_protocol_store() argument 736 default_pvid_show(struct device *d, struct device_attribute *attr, char *buf) default_pvid_show() argument 744 default_pvid_store(struct device *d, struct device_attribute *attr, const char *buf, size_t len) default_pvid_store() argument 813 brforward_read(struct file *filp, struct kobject *kobj, struct bin_attribute *bin_attr, char *buf, loff_t off, size_t count) brforward_read() argument
|
H A D | br_sysfs_if.c | 38 static ssize_t show_##_name(struct net_bridge_port *p, char *buf) \ 40 return sprintf(buf, "%d\n", !!(p->flags & _mask)); \ 69 static ssize_t show_path_cost(struct net_bridge_port *p, char *buf) show_path_cost() argument 71 return sprintf(buf, "%d\n", p->path_cost); show_path_cost() 77 static ssize_t show_priority(struct net_bridge_port *p, char *buf) show_priority() argument 79 return sprintf(buf, "%d\n", p->priority); show_priority() 85 static ssize_t show_designated_root(struct net_bridge_port *p, char *buf) show_designated_root() argument 87 return br_show_bridge_id(buf, &p->designated_root); show_designated_root() 91 static ssize_t show_designated_bridge(struct net_bridge_port *p, char *buf) show_designated_bridge() argument 93 return br_show_bridge_id(buf, &p->designated_bridge); show_designated_bridge() 97 static ssize_t show_designated_port(struct net_bridge_port *p, char *buf) show_designated_port() argument 99 return sprintf(buf, "%d\n", p->designated_port); show_designated_port() 103 static ssize_t show_designated_cost(struct net_bridge_port *p, char *buf) show_designated_cost() argument 105 return sprintf(buf, "%d\n", p->designated_cost); show_designated_cost() 109 static ssize_t show_port_id(struct net_bridge_port *p, char *buf) show_port_id() argument 111 return sprintf(buf, "0x%x\n", p->port_id); show_port_id() 115 static ssize_t show_port_no(struct net_bridge_port *p, char *buf) show_port_no() argument 117 return sprintf(buf, "0x%x\n", p->port_no); show_port_no() 122 static ssize_t show_change_ack(struct net_bridge_port *p, char *buf) show_change_ack() argument 124 return sprintf(buf, "%d\n", p->topology_change_ack); show_change_ack() 128 static ssize_t show_config_pending(struct net_bridge_port *p, char *buf) show_config_pending() argument 130 return sprintf(buf, "%d\n", p->config_pending); show_config_pending() 134 static ssize_t show_port_state(struct net_bridge_port *p, char *buf) show_port_state() argument 136 return sprintf(buf, "%d\n", p->state); show_port_state() 141 char *buf) show_message_age_timer() 143 return sprintf(buf, "%ld\n", br_timer_value(&p->message_age_timer)); show_message_age_timer() 148 char *buf) show_forward_delay_timer() 150 return sprintf(buf, "%ld\n", br_timer_value(&p->forward_delay_timer)); show_forward_delay_timer() 155 char *buf) show_hold_timer() 157 return sprintf(buf, "%ld\n", br_timer_value(&p->hold_timer)); show_hold_timer() 177 static ssize_t show_multicast_router(struct net_bridge_port *p, char *buf) show_multicast_router() argument 179 return sprintf(buf, "%d\n", p->multicast_router); show_multicast_router() 227 struct attribute *attr, char *buf) brport_show() 232 return brport_attr->show(p, buf); brport_show() 237 const char *buf, size_t count) brport_store() 248 val = simple_strtoul(buf, &endp, 0); brport_store() 249 if (endp != buf) { brport_store() 140 show_message_age_timer(struct net_bridge_port *p, char *buf) show_message_age_timer() argument 147 show_forward_delay_timer(struct net_bridge_port *p, char *buf) show_forward_delay_timer() argument 154 show_hold_timer(struct net_bridge_port *p, char *buf) show_hold_timer() argument 226 brport_show(struct kobject *kobj, struct attribute *attr, char *buf) brport_show() argument 235 brport_store(struct kobject *kobj, struct attribute *attr, const char *buf, size_t count) brport_store() argument
|
/linux-4.4.14/Documentation/target/ |
H A D | tcm_mod_builder.py | 41 buf = "" 50 buf = "#define " + fabric_mod_name.upper() + "_VERSION \"v0.1\"\n" 51 buf += "#define " + fabric_mod_name.upper() + "_NAMELEN 32\n" 52 buf += "\n" 53 buf += "struct " + fabric_mod_name + "_tpg {\n" 54 buf += " /* FC lport target portal group tag for TCM */\n" 55 buf += " u16 lport_tpgt;\n" 56 buf += " /* Pointer back to " + fabric_mod_name + "_lport */\n" 57 buf += " struct " + fabric_mod_name + "_lport *lport;\n" 58 buf += " /* Returned by " + fabric_mod_name + "_make_tpg() */\n" 59 buf += " struct se_portal_group se_tpg;\n" 60 buf += "};\n" 61 buf += "\n" 62 buf += "struct " + fabric_mod_name + "_lport {\n" 63 buf += " /* Binary World Wide unique Port Name for FC Target Lport */\n" 64 buf += " u64 lport_wwpn;\n" 65 buf += " /* ASCII formatted WWPN for FC Target Lport */\n" 66 buf += " char lport_name[" + fabric_mod_name.upper() + "_NAMELEN];\n" 67 buf += " /* Returned by " + fabric_mod_name + "_make_lport() */\n" 68 buf += " struct se_wwn lport_wwn;\n" 69 buf += "};\n" 71 ret = p.write(buf) 85 buf = "" 94 buf = "#define " + fabric_mod_name.upper() + "_VERSION \"v0.1\"\n" 95 buf += "#define " + fabric_mod_name.upper() + "_NAMELEN 32\n" 96 buf += "\n" 97 buf += "struct " + fabric_mod_name + "_tpg {\n" 98 buf += " /* SAS port target portal group tag for TCM */\n" 99 buf += " u16 tport_tpgt;\n" 100 buf += " /* Pointer back to " + fabric_mod_name + "_tport */\n" 101 buf += " struct " + fabric_mod_name + "_tport *tport;\n" 102 buf += " /* Returned by " + fabric_mod_name + "_make_tpg() */\n" 103 buf += " struct se_portal_group se_tpg;\n" 104 buf += "};\n\n" 105 buf += "struct " + fabric_mod_name + "_tport {\n" 106 buf += " /* Binary World Wide unique Port Name for SAS Target port */\n" 107 buf += " u64 tport_wwpn;\n" 108 buf += " /* ASCII formatted WWPN for SAS Target port */\n" 109 buf += " char tport_name[" + fabric_mod_name.upper() + "_NAMELEN];\n" 110 buf += " /* Returned by " + fabric_mod_name + "_make_tport() */\n" 111 buf += " struct se_wwn tport_wwn;\n" 112 buf += "};\n" 114 ret = p.write(buf) 128 buf = "" 137 buf = "#define " + fabric_mod_name.upper() + "_VERSION \"v0.1\"\n" 138 buf += "#define " + fabric_mod_name.upper() + "_NAMELEN 32\n" 139 buf += "\n" 140 buf += "struct " + fabric_mod_name + "_tpg {\n" 141 buf += " /* iSCSI target portal group tag for TCM */\n" 142 buf += " u16 tport_tpgt;\n" 143 buf += " /* Pointer back to " + fabric_mod_name + "_tport */\n" 144 buf += " struct " + fabric_mod_name + "_tport *tport;\n" 145 buf += " /* Returned by " + fabric_mod_name + "_make_tpg() */\n" 146 buf += " struct se_portal_group se_tpg;\n" 147 buf += "};\n\n" 148 buf += "struct " + fabric_mod_name + "_tport {\n" 149 buf += " /* ASCII formatted TargetName for IQN */\n" 150 buf += " char tport_name[" + fabric_mod_name.upper() + "_NAMELEN];\n" 151 buf += " /* Returned by " + fabric_mod_name + "_make_tport() */\n" 152 buf += " struct se_wwn tport_wwn;\n" 153 buf += "};\n" 155 ret = p.write(buf) 181 buf = "" 190 buf = "#include <linux/module.h>\n" 191 buf += "#include <linux/moduleparam.h>\n" 192 buf += "#include <linux/version.h>\n" 193 buf += "#include <generated/utsrelease.h>\n" 194 buf += "#include <linux/utsname.h>\n" 195 buf += "#include <linux/init.h>\n" 196 buf += "#include <linux/slab.h>\n" 197 buf += "#include <linux/kthread.h>\n" 198 buf += "#include <linux/types.h>\n" 199 buf += "#include <linux/string.h>\n" 200 buf += "#include <linux/configfs.h>\n" 201 buf += "#include <linux/ctype.h>\n" 202 buf += "#include <asm/unaligned.h>\n" 203 buf += "#include <scsi/scsi_proto.h>\n\n" 204 buf += "#include <target/target_core_base.h>\n" 205 buf += "#include <target/target_core_fabric.h>\n" 206 buf += "#include \"" + fabric_mod_name + "_base.h\"\n" 207 buf += "#include \"" + fabric_mod_name + "_fabric.h\"\n\n" 209 buf += "static const struct target_core_fabric_ops " + fabric_mod_name + "_ops;\n\n" 211 buf += "static struct se_portal_group *" + fabric_mod_name + "_make_tpg(\n" 212 buf += " struct se_wwn *wwn,\n" 213 buf += " struct config_group *group,\n" 214 buf += " const char *name)\n" 215 buf += "{\n" 216 buf += " struct " + fabric_mod_name + "_" + fabric_mod_port + "*" + fabric_mod_port + " = container_of(wwn,\n" 217 buf += " struct " + fabric_mod_name + "_" + fabric_mod_port + ", " + fabric_mod_port + "_wwn);\n\n" 218 buf += " struct " + fabric_mod_name + "_tpg *tpg;\n" 219 buf += " unsigned long tpgt;\n" 220 buf += " int ret;\n\n" 221 buf += " if (strstr(name, \"tpgt_\") != name)\n" 222 buf += " return ERR_PTR(-EINVAL);\n" 223 buf += " if (kstrtoul(name + 5, 10, &tpgt) || tpgt > UINT_MAX)\n" 224 buf += " return ERR_PTR(-EINVAL);\n\n" 225 buf += " tpg = kzalloc(sizeof(struct " + fabric_mod_name + "_tpg), GFP_KERNEL);\n" 226 buf += " if (!tpg) {\n" 227 buf += " printk(KERN_ERR \"Unable to allocate struct " + fabric_mod_name + "_tpg\");\n" 228 buf += " return ERR_PTR(-ENOMEM);\n" 229 buf += " }\n" 230 buf += " tpg->" + fabric_mod_port + " = " + fabric_mod_port + ";\n" 231 buf += " tpg->" + fabric_mod_port + "_tpgt = tpgt;\n\n" 234 buf += " ret = core_tpg_register(wwn, &tpg->se_tpg, SCSI_PROTOCOL_FCP);\n" 236 buf += " ret = core_tpg_register(wwn, &tpg->se_tpg, SCSI_PROTOCOL_SAS);\n" 238 buf += " ret = core_tpg_register(wwn, &tpg->se_tpg, SCSI_PROTOCOL_ISCSI);\n" 240 buf += " if (ret < 0) {\n" 241 buf += " kfree(tpg);\n" 242 buf += " return NULL;\n" 243 buf += " }\n" 244 buf += " return &tpg->se_tpg;\n" 245 buf += "}\n\n" 246 buf += "static void " + fabric_mod_name + "_drop_tpg(struct se_portal_group *se_tpg)\n" 247 buf += "{\n" 248 buf += " struct " + fabric_mod_name + "_tpg *tpg = container_of(se_tpg,\n" 249 buf += " struct " + fabric_mod_name + "_tpg, se_tpg);\n\n" 250 buf += " core_tpg_deregister(se_tpg);\n" 251 buf += " kfree(tpg);\n" 252 buf += "}\n\n" 254 buf += "static struct se_wwn *" + fabric_mod_name + "_make_" + fabric_mod_port + "(\n" 255 buf += " struct target_fabric_configfs *tf,\n" 256 buf += " struct config_group *group,\n" 257 buf += " const char *name)\n" 258 buf += "{\n" 259 buf += " struct " + fabric_mod_name + "_" + fabric_mod_port + " *" + fabric_mod_port + ";\n" 262 buf += " u64 wwpn = 0;\n\n" 264 buf += " /* if (" + fabric_mod_name + "_parse_wwn(name, &wwpn, 1) < 0)\n" 265 buf += " return ERR_PTR(-EINVAL); */\n\n" 266 buf += " " + fabric_mod_port + " = kzalloc(sizeof(struct " + fabric_mod_name + "_" + fabric_mod_port + "), GFP_KERNEL);\n" 267 buf += " if (!" + fabric_mod_port + ") {\n" 268 buf += " printk(KERN_ERR \"Unable to allocate struct " + fabric_mod_name + "_" + fabric_mod_port + "\");\n" 269 buf += " return ERR_PTR(-ENOMEM);\n" 270 buf += " }\n" 273 buf += " " + fabric_mod_port + "->" + fabric_mod_port + "_wwpn = wwpn;\n" 275 buf += " /* " + fabric_mod_name + "_format_wwn(&" + fabric_mod_port + "->" + fabric_mod_port + "_name[0], " + fabric_mod_name.upper() + "_NAMELEN, wwpn); */\n\n" 276 buf += " return &" + fabric_mod_port + "->" + fabric_mod_port + "_wwn;\n" 277 buf += "}\n\n" 278 buf += "static void " + fabric_mod_name + "_drop_" + fabric_mod_port + "(struct se_wwn *wwn)\n" 279 buf += "{\n" 280 buf += " struct " + fabric_mod_name + "_" + fabric_mod_port + " *" + fabric_mod_port + " = container_of(wwn,\n" 281 buf += " struct " + fabric_mod_name + "_" + fabric_mod_port + ", " + fabric_mod_port + "_wwn);\n" 282 buf += " kfree(" + fabric_mod_port + ");\n" 283 buf += "}\n\n" 285 buf += "static const struct target_core_fabric_ops " + fabric_mod_name + "_ops = {\n" 286 buf += " .module = THIS_MODULE,\n" 287 buf += " .name = \"" + fabric_mod_name + "\",\n" 288 buf += " .get_fabric_name = " + fabric_mod_name + "_get_fabric_name,\n" 289 buf += " .tpg_get_wwn = " + fabric_mod_name + "_get_fabric_wwn,\n" 290 buf += " .tpg_get_tag = " + fabric_mod_name + "_get_tag,\n" 291 buf += " .tpg_check_demo_mode = " + fabric_mod_name + "_check_false,\n" 292 buf += " .tpg_check_demo_mode_cache = " + fabric_mod_name + "_check_true,\n" 293 buf += " .tpg_check_demo_mode_write_protect = " + fabric_mod_name + "_check_true,\n" 294 buf += " .tpg_check_prod_mode_write_protect = " + fabric_mod_name + "_check_false,\n" 295 buf += " .tpg_get_inst_index = " + fabric_mod_name + "_tpg_get_inst_index,\n" 296 buf += " .release_cmd = " + fabric_mod_name + "_release_cmd,\n" 297 buf += " .shutdown_session = " + fabric_mod_name + "_shutdown_session,\n" 298 buf += " .close_session = " + fabric_mod_name + "_close_session,\n" 299 buf += " .sess_get_index = " + fabric_mod_name + "_sess_get_index,\n" 300 buf += " .sess_get_initiator_sid = NULL,\n" 301 buf += " .write_pending = " + fabric_mod_name + "_write_pending,\n" 302 buf += " .write_pending_status = " + fabric_mod_name + "_write_pending_status,\n" 303 buf += " .set_default_node_attributes = " + fabric_mod_name + "_set_default_node_attrs,\n" 304 buf += " .get_cmd_state = " + fabric_mod_name + "_get_cmd_state,\n" 305 buf += " .queue_data_in = " + fabric_mod_name + "_queue_data_in,\n" 306 buf += " .queue_status = " + fabric_mod_name + "_queue_status,\n" 307 buf += " .queue_tm_rsp = " + fabric_mod_name + "_queue_tm_rsp,\n" 308 buf += " .aborted_task = " + fabric_mod_name + "_aborted_task,\n" 309 buf += " /*\n" 310 buf += " * Setup function pointers for generic logic in target_core_fabric_configfs.c\n" 311 buf += " */\n" 312 buf += " .fabric_make_wwn = " + fabric_mod_name + "_make_" + fabric_mod_port + ",\n" 313 buf += " .fabric_drop_wwn = " + fabric_mod_name + "_drop_" + fabric_mod_port + ",\n" 314 buf += " .fabric_make_tpg = " + fabric_mod_name + "_make_tpg,\n" 315 buf += " .fabric_drop_tpg = " + fabric_mod_name + "_drop_tpg,\n" 316 buf += "};\n\n" 318 buf += "static int __init " + fabric_mod_name + "_init(void)\n" 319 buf += "{\n" 320 buf += " return target_register_template(&" + fabric_mod_name + "_ops);\n" 321 buf += "};\n\n" 323 buf += "static void __exit " + fabric_mod_name + "_exit(void)\n" 324 buf += "{\n" 325 buf += " target_unregister_template(&" + fabric_mod_name + "_ops);\n" 326 buf += "};\n\n" 328 buf += "MODULE_DESCRIPTION(\"" + fabric_mod_name.upper() + " series fabric driver\");\n" 329 buf += "MODULE_LICENSE(\"GPL\");\n" 330 buf += "module_init(" + fabric_mod_name + "_init);\n" 331 buf += "module_exit(" + fabric_mod_name + "_exit);\n" 333 ret = p.write(buf) 377 buf = "" 394 buf = "#include <linux/slab.h>\n" 395 buf += "#include <linux/kthread.h>\n" 396 buf += "#include <linux/types.h>\n" 397 buf += "#include <linux/list.h>\n" 398 buf += "#include <linux/types.h>\n" 399 buf += "#include <linux/string.h>\n" 400 buf += "#include <linux/ctype.h>\n" 401 buf += "#include <asm/unaligned.h>\n" 402 buf += "#include <scsi/scsi_common.h>\n" 403 buf += "#include <scsi/scsi_proto.h>\n" 404 buf += "#include <target/target_core_base.h>\n" 405 buf += "#include <target/target_core_fabric.h>\n" 406 buf += "#include \"" + fabric_mod_name + "_base.h\"\n" 407 buf += "#include \"" + fabric_mod_name + "_fabric.h\"\n\n" 409 buf += "int " + fabric_mod_name + "_check_true(struct se_portal_group *se_tpg)\n" 410 buf += "{\n" 411 buf += " return 1;\n" 412 buf += "}\n\n" 415 buf += "int " + fabric_mod_name + "_check_false(struct se_portal_group *se_tpg)\n" 416 buf += "{\n" 417 buf += " return 0;\n" 418 buf += "}\n\n" 430 buf += "char *" + fabric_mod_name + "_get_fabric_name(void)\n" 431 buf += "{\n" 432 buf += " return \"" + fabric_mod_name + "\";\n" 433 buf += "}\n\n" 438 buf += "char *" + fabric_mod_name + "_get_fabric_wwn(struct se_portal_group *se_tpg)\n" 439 buf += "{\n" 440 buf += " struct " + fabric_mod_name + "_tpg *tpg = container_of(se_tpg,\n" 441 buf += " struct " + fabric_mod_name + "_tpg, se_tpg);\n" 442 buf += " struct " + fabric_mod_name + "_" + fabric_mod_port + " *" + fabric_mod_port + " = tpg->" + fabric_mod_port + ";\n\n" 443 buf += " return &" + fabric_mod_port + "->" + fabric_mod_port + "_name[0];\n" 444 buf += "}\n\n" 448 buf += "u16 " + fabric_mod_name + "_get_tag(struct se_portal_group *se_tpg)\n" 449 buf += "{\n" 450 buf += " struct " + fabric_mod_name + "_tpg *tpg = container_of(se_tpg,\n" 451 buf += " struct " + fabric_mod_name + "_tpg, se_tpg);\n" 452 buf += " return tpg->" + fabric_mod_port + "_tpgt;\n" 453 buf += "}\n\n" 457 buf += "u32 " + fabric_mod_name + "_tpg_get_inst_index(struct se_portal_group *se_tpg)\n" 458 buf += "{\n" 459 buf += " return 1;\n" 460 buf += "}\n\n" 464 buf += "void " + fabric_mod_name + "_release_cmd(struct se_cmd *se_cmd)\n" 465 buf += "{\n" 466 buf += " return;\n" 467 buf += "}\n\n" 471 buf += "int " + fabric_mod_name + "_shutdown_session(struct se_session *se_sess)\n" 472 buf += "{\n" 473 buf += " return 0;\n" 474 buf += "}\n\n" 478 buf += "void " + fabric_mod_name + "_close_session(struct se_session *se_sess)\n" 479 buf += "{\n" 480 buf += " return;\n" 481 buf += "}\n\n" 485 buf += "u32 " + fabric_mod_name + "_sess_get_index(struct se_session *se_sess)\n" 486 buf += "{\n" 487 buf += " return 0;\n" 488 buf += "}\n\n" 492 buf += "int " + fabric_mod_name + "_write_pending(struct se_cmd *se_cmd)\n" 493 buf += "{\n" 494 buf += " return 0;\n" 495 buf += "}\n\n" 499 buf += "int " + fabric_mod_name + "_write_pending_status(struct se_cmd *se_cmd)\n" 500 buf += "{\n" 501 buf += " return 0;\n" 502 buf += "}\n\n" 506 buf += "void " + fabric_mod_name + "_set_default_node_attrs(struct se_node_acl *nacl)\n" 507 buf += "{\n" 508 buf += " return;\n" 509 buf += "}\n\n" 513 buf += "int " + fabric_mod_name + "_get_cmd_state(struct se_cmd *se_cmd)\n" 514 buf += "{\n" 515 buf += " return 0;\n" 516 buf += "}\n\n" 520 buf += "int " + fabric_mod_name + "_queue_data_in(struct se_cmd *se_cmd)\n" 521 buf += "{\n" 522 buf += " return 0;\n" 523 buf += "}\n\n" 527 buf += "int " + fabric_mod_name + "_queue_status(struct se_cmd *se_cmd)\n" 528 buf += "{\n" 529 buf += " return 0;\n" 530 buf += "}\n\n" 534 buf += "void " + fabric_mod_name + "_queue_tm_rsp(struct se_cmd *se_cmd)\n" 535 buf += "{\n" 536 buf += " return;\n" 537 buf += "}\n\n" 541 buf += "void " + fabric_mod_name + "_aborted_task(struct se_cmd *se_cmd)\n" 542 buf += "{\n" 543 buf += " return;\n" 544 buf += "}\n\n" 547 ret = p.write(buf) 562 buf = "" 570 buf += fabric_mod_name + "-objs := " + fabric_mod_name + "_fabric.o \\\n" 571 buf += " " + fabric_mod_name + "_configfs.o\n" 572 buf += "obj-$(CONFIG_" + fabric_mod_name.upper() + ") += " + fabric_mod_name + ".o\n" 574 ret = p.write(buf) 583 buf = "" 591 buf = "config " + fabric_mod_name.upper() + "\n" 592 buf += " tristate \"" + fabric_mod_name.upper() + " fabric module\"\n" 593 buf += " depends on TARGET_CORE && CONFIGFS_FS\n" 594 buf += " default n\n" 595 buf += " ---help---\n" 596 buf += " Say Y here to enable the " + fabric_mod_name.upper() + " fabric module\n" 598 ret = p.write(buf) 606 buf = "obj-$(CONFIG_" + fabric_mod_name.upper() + ") += " + fabric_mod_name.lower() + "/\n" 610 f.write(buf) 615 buf = "source \"drivers/target/" + fabric_mod_name.lower() + "/Kconfig\"\n" 619 f.write(buf)
|
/linux-4.4.14/sound/firewire/bebob/ |
H A D | bebob_command.c | 14 u8 *buf; avc_audio_set_selector() local 17 buf = kzalloc(12, GFP_KERNEL); avc_audio_set_selector() 18 if (buf == NULL) avc_audio_set_selector() 21 buf[0] = 0x00; /* AV/C CONTROL */ avc_audio_set_selector() 22 buf[1] = 0x08 | (0x07 & subunit_id); /* AUDIO SUBUNIT ID */ avc_audio_set_selector() 23 buf[2] = 0xb8; /* FUNCTION BLOCK */ avc_audio_set_selector() 24 buf[3] = 0x80; /* type is 'selector'*/ avc_audio_set_selector() 25 buf[4] = 0xff & fb_id; /* function block id */ avc_audio_set_selector() 26 buf[5] = 0x10; /* control attribute is CURRENT */ avc_audio_set_selector() 27 buf[6] = 0x02; /* selector length is 2 */ avc_audio_set_selector() 28 buf[7] = 0xff & num; /* input function block plug number */ avc_audio_set_selector() 29 buf[8] = 0x01; /* control selector is SELECTOR_CONTROL */ avc_audio_set_selector() 31 err = fcp_avc_transaction(unit, buf, 12, buf, 12, avc_audio_set_selector() 36 else if (buf[0] == 0x08) /* NOT IMPLEMENTED */ avc_audio_set_selector() 38 else if (buf[0] == 0x0a) /* REJECTED */ avc_audio_set_selector() 43 kfree(buf); avc_audio_set_selector() 50 u8 *buf; avc_audio_get_selector() local 53 buf = kzalloc(12, GFP_KERNEL); avc_audio_get_selector() 54 if (buf == NULL) avc_audio_get_selector() 57 buf[0] = 0x01; /* AV/C STATUS */ avc_audio_get_selector() 58 buf[1] = 0x08 | (0x07 & subunit_id); /* AUDIO SUBUNIT ID */ avc_audio_get_selector() 59 buf[2] = 0xb8; /* FUNCTION BLOCK */ avc_audio_get_selector() 60 buf[3] = 0x80; /* type is 'selector'*/ avc_audio_get_selector() 61 buf[4] = 0xff & fb_id; /* function block id */ avc_audio_get_selector() 62 buf[5] = 0x10; /* control attribute is CURRENT */ avc_audio_get_selector() 63 buf[6] = 0x02; /* selector length is 2 */ avc_audio_get_selector() 64 buf[7] = 0xff; /* input function block plug number */ avc_audio_get_selector() 65 buf[8] = 0x01; /* control selector is SELECTOR_CONTROL */ avc_audio_get_selector() 67 err = fcp_avc_transaction(unit, buf, 12, buf, 12, avc_audio_get_selector() 72 else if (buf[0] == 0x08) /* NOT IMPLEMENTED */ avc_audio_get_selector() 74 else if (buf[0] == 0x0a) /* REJECTED */ avc_audio_get_selector() 76 else if (buf[0] == 0x0b) /* IN TRANSITION */ avc_audio_get_selector() 81 *num = buf[7]; avc_audio_get_selector() 84 kfree(buf); avc_audio_get_selector() 89 avc_bridgeco_fill_extension_addr(u8 *buf, u8 *addr) avc_bridgeco_fill_extension_addr() argument 91 buf[1] = addr[0]; avc_bridgeco_fill_extension_addr() 92 memcpy(buf + 4, addr + 1, 5); avc_bridgeco_fill_extension_addr() 96 avc_bridgeco_fill_plug_info_extension_command(u8 *buf, u8 *addr, avc_bridgeco_fill_plug_info_extension_command() argument 99 buf[0] = 0x01; /* AV/C STATUS */ avc_bridgeco_fill_plug_info_extension_command() 100 buf[2] = 0x02; /* AV/C GENERAL PLUG INFO */ avc_bridgeco_fill_plug_info_extension_command() 101 buf[3] = 0xc0; /* BridgeCo extension */ avc_bridgeco_fill_plug_info_extension_command() 102 avc_bridgeco_fill_extension_addr(buf, addr); avc_bridgeco_fill_plug_info_extension_command() 103 buf[9] = itype; /* info type */ avc_bridgeco_fill_plug_info_extension_command() 110 u8 *buf; avc_bridgeco_get_plug_type() local 113 buf = kzalloc(12, GFP_KERNEL); avc_bridgeco_get_plug_type() 114 if (buf == NULL) avc_bridgeco_get_plug_type() 118 avc_bridgeco_fill_plug_info_extension_command(buf, addr, 0x00); avc_bridgeco_get_plug_type() 120 err = fcp_avc_transaction(unit, buf, 12, buf, 12, avc_bridgeco_get_plug_type() 125 else if (buf[0] == 0x08) /* NOT IMPLEMENTED */ avc_bridgeco_get_plug_type() 127 else if (buf[0] == 0x0a) /* REJECTED */ avc_bridgeco_get_plug_type() 129 else if (buf[0] == 0x0b) /* IN TRANSITION */ avc_bridgeco_get_plug_type() 134 *type = buf[10]; avc_bridgeco_get_plug_type() 137 kfree(buf); avc_bridgeco_get_plug_type() 143 u8 *buf, unsigned int len) avc_bridgeco_get_plug_ch_pos() 148 avc_bridgeco_fill_plug_info_extension_command(buf, addr, 0x03); avc_bridgeco_get_plug_ch_pos() 150 err = fcp_avc_transaction(unit, buf, 12, buf, 256, avc_bridgeco_get_plug_ch_pos() 155 else if (buf[0] == 0x08) /* NOT IMPLEMENTED */ avc_bridgeco_get_plug_ch_pos() 157 else if (buf[0] == 0x0a) /* REJECTED */ avc_bridgeco_get_plug_ch_pos() 159 else if (buf[0] == 0x0b) /* IN TRANSITION */ avc_bridgeco_get_plug_ch_pos() 165 memmove(buf, buf + 10, err - 10); avc_bridgeco_get_plug_ch_pos() 175 u8 *buf; avc_bridgeco_get_plug_section_type() local 179 buf = kzalloc(12, GFP_KERNEL); avc_bridgeco_get_plug_section_type() 180 if (buf == NULL) avc_bridgeco_get_plug_section_type() 184 avc_bridgeco_fill_plug_info_extension_command(buf, addr, 0x07); avc_bridgeco_get_plug_section_type() 185 buf[10] = 0xff & ++id; /* section id */ avc_bridgeco_get_plug_section_type() 187 err = fcp_avc_transaction(unit, buf, 12, buf, 12, avc_bridgeco_get_plug_section_type() 192 else if (buf[0] == 0x08) /* NOT IMPLEMENTED */ avc_bridgeco_get_plug_section_type() 194 else if (buf[0] == 0x0a) /* REJECTED */ avc_bridgeco_get_plug_section_type() 196 else if (buf[0] == 0x0b) /* IN TRANSITION */ avc_bridgeco_get_plug_section_type() 201 *type = buf[11]; avc_bridgeco_get_plug_section_type() 204 kfree(buf); avc_bridgeco_get_plug_section_type() 212 u8 *buf; avc_bridgeco_get_plug_input() local 214 buf = kzalloc(18, GFP_KERNEL); avc_bridgeco_get_plug_input() 215 if (buf == NULL) avc_bridgeco_get_plug_input() 219 avc_bridgeco_fill_plug_info_extension_command(buf, addr, 0x05); avc_bridgeco_get_plug_input() 221 err = fcp_avc_transaction(unit, buf, 16, buf, 16, avc_bridgeco_get_plug_input() 226 else if (buf[0] == 0x08) /* NOT IMPLEMENTED */ avc_bridgeco_get_plug_input() 228 else if (buf[0] == 0x0a) /* REJECTED */ avc_bridgeco_get_plug_input() 230 else if (buf[0] == 0x0b) /* IN TRANSITION */ avc_bridgeco_get_plug_input() 235 memcpy(input, buf + 10, 5); avc_bridgeco_get_plug_input() 238 kfree(buf); avc_bridgeco_get_plug_input() 243 u8 addr[AVC_BRIDGECO_ADDR_BYTES], u8 *buf, avc_bridgeco_get_plug_strm_fmt() 249 if ((buf == NULL) || (*len < 12)) { avc_bridgeco_get_plug_strm_fmt() 254 buf[0] = 0x01; /* AV/C STATUS */ avc_bridgeco_get_plug_strm_fmt() 255 buf[2] = 0x2f; /* AV/C STREAM FORMAT SUPPORT */ avc_bridgeco_get_plug_strm_fmt() 256 buf[3] = 0xc1; /* Bridgeco extension - List Request */ avc_bridgeco_get_plug_strm_fmt() 257 avc_bridgeco_fill_extension_addr(buf, addr); avc_bridgeco_get_plug_strm_fmt() 258 buf[10] = 0xff & eid; /* Entry ID */ avc_bridgeco_get_plug_strm_fmt() 260 err = fcp_avc_transaction(unit, buf, 12, buf, *len, avc_bridgeco_get_plug_strm_fmt() 265 else if (buf[0] == 0x08) /* NOT IMPLEMENTED */ avc_bridgeco_get_plug_strm_fmt() 267 else if (buf[0] == 0x0a) /* REJECTED */ avc_bridgeco_get_plug_strm_fmt() 269 else if (buf[0] == 0x0b) /* IN TRANSITION */ avc_bridgeco_get_plug_strm_fmt() 271 else if (buf[10] != eid) avc_bridgeco_get_plug_strm_fmt() 277 memmove(buf, buf + 11, err - 11); avc_bridgeco_get_plug_strm_fmt() 141 avc_bridgeco_get_plug_ch_pos(struct fw_unit *unit, u8 addr[AVC_BRIDGECO_ADDR_BYTES], u8 *buf, unsigned int len) avc_bridgeco_get_plug_ch_pos() argument 242 avc_bridgeco_get_plug_strm_fmt(struct fw_unit *unit, u8 addr[AVC_BRIDGECO_ADDR_BYTES], u8 *buf, unsigned int *len, unsigned int eid) avc_bridgeco_get_plug_strm_fmt() argument
|
/linux-4.4.14/drivers/tty/ |
H A D | tty_audit.c | 28 struct tty_audit_buf *buf; tty_audit_buf_alloc() local 30 buf = kmalloc(sizeof(*buf), GFP_KERNEL); tty_audit_buf_alloc() 31 if (!buf) tty_audit_buf_alloc() 33 buf->data = kmalloc(N_TTY_BUF_SIZE, GFP_KERNEL); tty_audit_buf_alloc() 34 if (!buf->data) tty_audit_buf_alloc() 36 atomic_set(&buf->count, 1); tty_audit_buf_alloc() 37 mutex_init(&buf->mutex); tty_audit_buf_alloc() 38 buf->major = major; tty_audit_buf_alloc() 39 buf->minor = minor; tty_audit_buf_alloc() 40 buf->icanon = icanon; tty_audit_buf_alloc() 41 buf->valid = 0; tty_audit_buf_alloc() 42 return buf; tty_audit_buf_alloc() 45 kfree(buf); tty_audit_buf_alloc() 50 static void tty_audit_buf_free(struct tty_audit_buf *buf) tty_audit_buf_free() argument 52 WARN_ON(buf->valid != 0); tty_audit_buf_free() 53 kfree(buf->data); tty_audit_buf_free() 54 kfree(buf); tty_audit_buf_free() 57 static void tty_audit_buf_put(struct tty_audit_buf *buf) tty_audit_buf_put() argument 59 if (atomic_dec_and_test(&buf->count)) tty_audit_buf_put() 60 tty_audit_buf_free(buf); tty_audit_buf_put() 91 * Generate an audit message from the contents of @buf, which is owned by 92 * the current task. @buf->mutex must be locked. 94 static void tty_audit_buf_push(struct tty_audit_buf *buf) tty_audit_buf_push() argument 96 if (buf->valid == 0) tty_audit_buf_push() 99 buf->valid = 0; tty_audit_buf_push() 102 tty_audit_log("tty", buf->major, buf->minor, buf->data, buf->valid); tty_audit_buf_push() 103 buf->valid = 0; tty_audit_buf_push() 114 struct tty_audit_buf *buf; tty_audit_exit() local 116 buf = current->signal->tty_audit_buf; tty_audit_exit() 118 if (!buf) tty_audit_exit() 121 mutex_lock(&buf->mutex); tty_audit_exit() 122 tty_audit_buf_push(buf); tty_audit_exit() 123 mutex_unlock(&buf->mutex); tty_audit_exit() 125 tty_audit_buf_put(buf); tty_audit_exit() 144 struct tty_audit_buf *buf; tty_audit_tiocsti() local 150 buf = current->signal->tty_audit_buf; tty_audit_tiocsti() 151 if (buf) tty_audit_tiocsti() 152 atomic_inc(&buf->count); tty_audit_tiocsti() 157 if (buf) { tty_audit_tiocsti() 158 mutex_lock(&buf->mutex); tty_audit_tiocsti() 159 if (buf->major == major && buf->minor == minor) tty_audit_tiocsti() 160 tty_audit_buf_push(buf); tty_audit_tiocsti() 161 mutex_unlock(&buf->mutex); tty_audit_tiocsti() 162 tty_audit_buf_put(buf); tty_audit_tiocsti() 183 struct tty_audit_buf *buf = ERR_PTR(-EPERM); tty_audit_push_current() local 191 buf = tsk->signal->tty_audit_buf; tty_audit_push_current() 192 if (buf) tty_audit_push_current() 193 atomic_inc(&buf->count); tty_audit_push_current() 201 if (!buf || IS_ERR(buf)) tty_audit_push_current() 202 return PTR_ERR(buf); tty_audit_push_current() 204 mutex_lock(&buf->mutex); tty_audit_push_current() 205 tty_audit_buf_push(buf); tty_audit_push_current() 206 mutex_unlock(&buf->mutex); tty_audit_push_current() 208 tty_audit_buf_put(buf); tty_audit_push_current() 222 struct tty_audit_buf *buf, *buf2; tty_audit_buf_get() local 225 buf = NULL; tty_audit_buf_get() 230 buf = current->signal->tty_audit_buf; tty_audit_buf_get() 231 if (buf) { tty_audit_buf_get() 232 atomic_inc(&buf->count); tty_audit_buf_get() 248 buf = current->signal->tty_audit_buf; tty_audit_buf_get() 249 if (!buf) { tty_audit_buf_get() 251 buf = buf2; tty_audit_buf_get() 254 atomic_inc(&buf->count); tty_audit_buf_get() 260 return buf; tty_audit_buf_get() 271 struct tty_audit_buf *buf; tty_audit_add_data() local 289 buf = tty_audit_buf_get(tty, icanon); tty_audit_add_data() 290 if (!buf) tty_audit_add_data() 293 mutex_lock(&buf->mutex); tty_audit_add_data() 296 if (buf->major != major || buf->minor != minor tty_audit_add_data() 297 || buf->icanon != icanon) { tty_audit_add_data() 298 tty_audit_buf_push(buf); tty_audit_add_data() 299 buf->major = major; tty_audit_add_data() 300 buf->minor = minor; tty_audit_add_data() 301 buf->icanon = icanon; tty_audit_add_data() 306 run = N_TTY_BUF_SIZE - buf->valid; tty_audit_add_data() 309 memcpy(buf->data + buf->valid, data, run); tty_audit_add_data() 310 buf->valid += run; tty_audit_add_data() 313 if (buf->valid == N_TTY_BUF_SIZE) tty_audit_add_data() 314 tty_audit_buf_push(buf); tty_audit_add_data() 316 mutex_unlock(&buf->mutex); tty_audit_add_data() 317 tty_audit_buf_put(buf); tty_audit_add_data() 327 struct tty_audit_buf *buf; tty_audit_push() local 335 buf = current->signal->tty_audit_buf; tty_audit_push() 336 if (buf) tty_audit_push() 337 atomic_inc(&buf->count); tty_audit_push() 340 if (buf) { tty_audit_push() 345 mutex_lock(&buf->mutex); tty_audit_push() 346 if (buf->major == major && buf->minor == minor) tty_audit_push() 347 tty_audit_buf_push(buf); tty_audit_push() 348 mutex_unlock(&buf->mutex); tty_audit_push() 349 tty_audit_buf_put(buf); tty_audit_push()
|
/linux-4.4.14/drivers/media/pci/saa7164/ |
H A D | saa7164-buffer.c | 69 void saa7164_buffer_display(struct saa7164_buffer *buf) saa7164_buffer_display() argument 71 struct saa7164_dev *dev = buf->port->dev; saa7164_buffer_display() 75 __func__, buf, buf->idx); saa7164_buffer_display() 77 buf->cpu, (long long)buf->dma, buf->pci_size); saa7164_buffer_display() 79 buf->pt_cpu, (long long)buf->pt_dma, buf->pt_size); saa7164_buffer_display() 85 i, buf->pt_cpu, (u64)*(buf->pt_cpu)); saa7164_buffer_display() 96 struct saa7164_buffer *buf = NULL; saa7164_buffer_alloc() local 105 buf = kzalloc(sizeof(struct saa7164_buffer), GFP_KERNEL); saa7164_buffer_alloc() 106 if (!buf) { saa7164_buffer_alloc() 111 buf->idx = -1; saa7164_buffer_alloc() 112 buf->port = port; saa7164_buffer_alloc() 113 buf->flags = SAA7164_BUFFER_FREE; saa7164_buffer_alloc() 114 buf->pos = 0; saa7164_buffer_alloc() 115 buf->actual_size = params->pitch * params->numberoflines; saa7164_buffer_alloc() 116 buf->crc = 0; saa7164_buffer_alloc() 118 buf->pci_size = SAA7164_PT_ENTRIES * 0x1000; saa7164_buffer_alloc() 119 buf->pt_size = (SAA7164_PT_ENTRIES * sizeof(u64)) + 0x1000; saa7164_buffer_alloc() 122 buf->cpu = pci_alloc_consistent(port->dev->pci, buf->pci_size, saa7164_buffer_alloc() 123 &buf->dma); saa7164_buffer_alloc() 124 if (!buf->cpu) saa7164_buffer_alloc() 127 buf->pt_cpu = pci_alloc_consistent(port->dev->pci, buf->pt_size, saa7164_buffer_alloc() 128 &buf->pt_dma); saa7164_buffer_alloc() 129 if (!buf->pt_cpu) saa7164_buffer_alloc() 133 memset(buf->cpu, 0xff, buf->pci_size); saa7164_buffer_alloc() 134 buf->crc = crc32(0, buf->cpu, buf->actual_size); saa7164_buffer_alloc() 135 memset(buf->pt_cpu, 0xff, buf->pt_size); saa7164_buffer_alloc() 138 __func__, buf, params->numpagetables); saa7164_buffer_alloc() 140 buf->cpu, (long)buf->dma, buf->pci_size); saa7164_buffer_alloc() 142 buf->pt_cpu, (long)buf->pt_dma, buf->pt_size); saa7164_buffer_alloc() 147 *(buf->pt_cpu + i) = buf->dma + (i * 0x1000); /* TODO */ saa7164_buffer_alloc() 149 i, buf->pt_cpu, (u64)*(buf->pt_cpu)); saa7164_buffer_alloc() 156 pci_free_consistent(port->dev->pci, buf->pci_size, buf->cpu, buf->dma); saa7164_buffer_alloc() 158 kfree(buf); saa7164_buffer_alloc() 160 buf = NULL; saa7164_buffer_alloc() 162 return buf; saa7164_buffer_alloc() 165 int saa7164_buffer_dealloc(struct saa7164_buffer *buf) saa7164_buffer_dealloc() argument 169 if (!buf || !buf->port) saa7164_buffer_dealloc() 171 dev = buf->port->dev; saa7164_buffer_dealloc() 174 __func__, buf); saa7164_buffer_dealloc() 176 if (buf->flags != SAA7164_BUFFER_FREE) saa7164_buffer_dealloc() 179 pci_free_consistent(dev->pci, buf->pci_size, buf->cpu, buf->dma); saa7164_buffer_dealloc() 180 pci_free_consistent(dev->pci, buf->pt_size, buf->pt_cpu, buf->pt_dma); saa7164_buffer_dealloc() 182 kfree(buf); saa7164_buffer_dealloc() 202 int saa7164_buffer_activate(struct saa7164_buffer *buf, int i) saa7164_buffer_activate() argument 204 struct saa7164_port *port = buf->port; saa7164_buffer_activate() 212 buf->idx = i; /* Note of which buffer list index position we occupy */ saa7164_buffer_activate() 213 buf->flags = SAA7164_BUFFER_BUSY; saa7164_buffer_activate() 214 buf->pos = 0; saa7164_buffer_activate() 218 saa7164_writel(port->bufptr32h + ((sizeof(u32) * 2) * i), buf->pt_dma); saa7164_buffer_activate() 221 dprintk(DBGLVL_BUF, " buf[%d] offset 0x%llx (0x%x) " saa7164_buffer_activate() 222 "buf 0x%llx/%llx (0x%x/%x) nr=%d\n", saa7164_buffer_activate() 223 buf->idx, saa7164_buffer_activate() 230 buf->idx); saa7164_buffer_activate() 239 struct saa7164_buffer *buf; saa7164_buffer_cfg_port() local 268 buf = list_entry(c, struct saa7164_buffer, list); saa7164_buffer_cfg_port() 270 if (buf->flags != SAA7164_BUFFER_FREE) saa7164_buffer_cfg_port() 274 saa7164_buffer_activate(buf, i); saa7164_buffer_cfg_port() 289 struct saa7164_user_buffer *buf; saa7164_buffer_alloc_user() local 291 buf = kzalloc(sizeof(struct saa7164_user_buffer), GFP_KERNEL); saa7164_buffer_alloc_user() 292 if (!buf) saa7164_buffer_alloc_user() 295 buf->data = kzalloc(len, GFP_KERNEL); saa7164_buffer_alloc_user() 297 if (!buf->data) { saa7164_buffer_alloc_user() 298 kfree(buf); saa7164_buffer_alloc_user() 302 buf->actual_size = len; saa7164_buffer_alloc_user() 303 buf->pos = 0; saa7164_buffer_alloc_user() 304 buf->crc = 0; saa7164_buffer_alloc_user() 307 __func__, buf); saa7164_buffer_alloc_user() 309 return buf; saa7164_buffer_alloc_user() 312 void saa7164_buffer_dealloc_user(struct saa7164_user_buffer *buf) saa7164_buffer_dealloc_user() argument 314 if (!buf) saa7164_buffer_dealloc_user() 317 kfree(buf->data); saa7164_buffer_dealloc_user() 318 buf->data = NULL; saa7164_buffer_dealloc_user() 320 kfree(buf); saa7164_buffer_dealloc_user()
|
/linux-4.4.14/drivers/media/v4l2-core/ |
H A D | videobuf2-dma-sg.c | 61 static int vb2_dma_sg_alloc_compacted(struct vb2_dma_sg_buf *buf, vb2_dma_sg_alloc_compacted() argument 65 int size = buf->size; vb2_dma_sg_alloc_compacted() 86 __free_page(buf->pages[last_page]); vb2_dma_sg_alloc_compacted() 94 buf->pages[last_page++] = &pages[i]; vb2_dma_sg_alloc_compacted() 106 struct vb2_dma_sg_buf *buf; vb2_dma_sg_alloc() local 116 buf = kzalloc(sizeof *buf, GFP_KERNEL); vb2_dma_sg_alloc() 117 if (!buf) vb2_dma_sg_alloc() 120 buf->vaddr = NULL; vb2_dma_sg_alloc() 121 buf->dma_dir = dma_dir; vb2_dma_sg_alloc() 122 buf->offset = 0; vb2_dma_sg_alloc() 123 buf->size = size; vb2_dma_sg_alloc() 125 buf->num_pages = size >> PAGE_SHIFT; vb2_dma_sg_alloc() 126 buf->dma_sgt = &buf->sg_table; vb2_dma_sg_alloc() 128 buf->pages = kzalloc(buf->num_pages * sizeof(struct page *), vb2_dma_sg_alloc() 130 if (!buf->pages) vb2_dma_sg_alloc() 133 ret = vb2_dma_sg_alloc_compacted(buf, gfp_flags); vb2_dma_sg_alloc() 137 ret = sg_alloc_table_from_pages(buf->dma_sgt, buf->pages, vb2_dma_sg_alloc() 138 buf->num_pages, 0, size, GFP_KERNEL); vb2_dma_sg_alloc() 143 buf->dev = get_device(conf->dev); vb2_dma_sg_alloc() 145 sgt = &buf->sg_table; vb2_dma_sg_alloc() 150 sgt->nents = dma_map_sg_attrs(buf->dev, sgt->sgl, sgt->orig_nents, vb2_dma_sg_alloc() 151 buf->dma_dir, &attrs); vb2_dma_sg_alloc() 155 buf->handler.refcount = &buf->refcount; vb2_dma_sg_alloc() 156 buf->handler.put = vb2_dma_sg_put; vb2_dma_sg_alloc() 157 buf->handler.arg = buf; vb2_dma_sg_alloc() 159 atomic_inc(&buf->refcount); vb2_dma_sg_alloc() 162 __func__, buf->num_pages); vb2_dma_sg_alloc() 163 return buf; vb2_dma_sg_alloc() 166 put_device(buf->dev); vb2_dma_sg_alloc() 167 sg_free_table(buf->dma_sgt); vb2_dma_sg_alloc() 169 num_pages = buf->num_pages; vb2_dma_sg_alloc() 171 __free_page(buf->pages[num_pages]); vb2_dma_sg_alloc() 173 kfree(buf->pages); vb2_dma_sg_alloc() 175 kfree(buf); vb2_dma_sg_alloc() 181 struct vb2_dma_sg_buf *buf = buf_priv; vb2_dma_sg_put() local 182 struct sg_table *sgt = &buf->sg_table; vb2_dma_sg_put() 183 int i = buf->num_pages; vb2_dma_sg_put() 185 if (atomic_dec_and_test(&buf->refcount)) { vb2_dma_sg_put() 190 buf->num_pages); vb2_dma_sg_put() 191 dma_unmap_sg_attrs(buf->dev, sgt->sgl, sgt->orig_nents, vb2_dma_sg_put() 192 buf->dma_dir, &attrs); vb2_dma_sg_put() 193 if (buf->vaddr) vb2_dma_sg_put() 194 vm_unmap_ram(buf->vaddr, buf->num_pages); vb2_dma_sg_put() 195 sg_free_table(buf->dma_sgt); vb2_dma_sg_put() 197 __free_page(buf->pages[i]); vb2_dma_sg_put() 198 kfree(buf->pages); vb2_dma_sg_put() 199 put_device(buf->dev); vb2_dma_sg_put() 200 kfree(buf); vb2_dma_sg_put() 206 struct vb2_dma_sg_buf *buf = buf_priv; vb2_dma_sg_prepare() local 207 struct sg_table *sgt = buf->dma_sgt; vb2_dma_sg_prepare() 210 if (buf->db_attach) vb2_dma_sg_prepare() 213 dma_sync_sg_for_device(buf->dev, sgt->sgl, sgt->orig_nents, vb2_dma_sg_prepare() 214 buf->dma_dir); vb2_dma_sg_prepare() 219 struct vb2_dma_sg_buf *buf = buf_priv; vb2_dma_sg_finish() local 220 struct sg_table *sgt = buf->dma_sgt; vb2_dma_sg_finish() 223 if (buf->db_attach) vb2_dma_sg_finish() 226 dma_sync_sg_for_cpu(buf->dev, sgt->sgl, sgt->orig_nents, buf->dma_dir); vb2_dma_sg_finish() 234 struct vb2_dma_sg_buf *buf; vb2_dma_sg_get_userptr() local 240 buf = kzalloc(sizeof *buf, GFP_KERNEL); vb2_dma_sg_get_userptr() 241 if (!buf) vb2_dma_sg_get_userptr() 244 buf->vaddr = NULL; vb2_dma_sg_get_userptr() 245 buf->dev = conf->dev; vb2_dma_sg_get_userptr() 246 buf->dma_dir = dma_dir; vb2_dma_sg_get_userptr() 247 buf->offset = vaddr & ~PAGE_MASK; vb2_dma_sg_get_userptr() 248 buf->size = size; vb2_dma_sg_get_userptr() 249 buf->dma_sgt = &buf->sg_table; vb2_dma_sg_get_userptr() 250 vec = vb2_create_framevec(vaddr, size, buf->dma_dir == DMA_FROM_DEVICE); vb2_dma_sg_get_userptr() 253 buf->vec = vec; vb2_dma_sg_get_userptr() 255 buf->pages = frame_vector_pages(vec); vb2_dma_sg_get_userptr() 256 if (IS_ERR(buf->pages)) vb2_dma_sg_get_userptr() 258 buf->num_pages = frame_vector_count(vec); vb2_dma_sg_get_userptr() 260 if (sg_alloc_table_from_pages(buf->dma_sgt, buf->pages, vb2_dma_sg_get_userptr() 261 buf->num_pages, buf->offset, size, 0)) vb2_dma_sg_get_userptr() 264 sgt = &buf->sg_table; vb2_dma_sg_get_userptr() 269 sgt->nents = dma_map_sg_attrs(buf->dev, sgt->sgl, sgt->orig_nents, vb2_dma_sg_get_userptr() 270 buf->dma_dir, &attrs); vb2_dma_sg_get_userptr() 274 return buf; vb2_dma_sg_get_userptr() 277 sg_free_table(&buf->sg_table); vb2_dma_sg_get_userptr() 281 kfree(buf); vb2_dma_sg_get_userptr() 291 struct vb2_dma_sg_buf *buf = buf_priv; vb2_dma_sg_put_userptr() local 292 struct sg_table *sgt = &buf->sg_table; vb2_dma_sg_put_userptr() 293 int i = buf->num_pages; vb2_dma_sg_put_userptr() 299 __func__, buf->num_pages); vb2_dma_sg_put_userptr() 300 dma_unmap_sg_attrs(buf->dev, sgt->sgl, sgt->orig_nents, buf->dma_dir, vb2_dma_sg_put_userptr() 302 if (buf->vaddr) vb2_dma_sg_put_userptr() 303 vm_unmap_ram(buf->vaddr, buf->num_pages); vb2_dma_sg_put_userptr() 304 sg_free_table(buf->dma_sgt); vb2_dma_sg_put_userptr() 306 if (buf->dma_dir == DMA_FROM_DEVICE) vb2_dma_sg_put_userptr() 307 set_page_dirty_lock(buf->pages[i]); vb2_dma_sg_put_userptr() 309 vb2_destroy_framevec(buf->vec); vb2_dma_sg_put_userptr() 310 kfree(buf); vb2_dma_sg_put_userptr() 315 struct vb2_dma_sg_buf *buf = buf_priv; vb2_dma_sg_vaddr() local 317 BUG_ON(!buf); vb2_dma_sg_vaddr() 319 if (!buf->vaddr) { vb2_dma_sg_vaddr() 320 if (buf->db_attach) vb2_dma_sg_vaddr() 321 buf->vaddr = dma_buf_vmap(buf->db_attach->dmabuf); vb2_dma_sg_vaddr() 323 buf->vaddr = vm_map_ram(buf->pages, vb2_dma_sg_vaddr() 324 buf->num_pages, -1, PAGE_KERNEL); vb2_dma_sg_vaddr() 328 return buf->vaddr ? buf->vaddr + buf->offset : NULL; vb2_dma_sg_vaddr() 333 struct vb2_dma_sg_buf *buf = buf_priv; vb2_dma_sg_num_users() local 335 return atomic_read(&buf->refcount); vb2_dma_sg_num_users() 340 struct vb2_dma_sg_buf *buf = buf_priv; vb2_dma_sg_mmap() local 345 if (!buf) { vb2_dma_sg_mmap() 353 ret = vm_insert_page(vma, uaddr, buf->pages[i++]); vb2_dma_sg_mmap() 367 vma->vm_private_data = &buf->handler; vb2_dma_sg_mmap() 391 struct vb2_dma_sg_buf *buf = dbuf->priv; vb2_dma_sg_dmabuf_ops_attach() local 399 /* Copy the buf->base_sgt scatter list to the attachment, as we can't vb2_dma_sg_dmabuf_ops_attach() 402 ret = sg_alloc_table(sgt, buf->dma_sgt->orig_nents, GFP_KERNEL); vb2_dma_sg_dmabuf_ops_attach() 408 rd = buf->dma_sgt->sgl; vb2_dma_sg_dmabuf_ops_attach() 496 struct vb2_dma_sg_buf *buf = dbuf->priv; vb2_dma_sg_dmabuf_ops_kmap() local 498 return buf->vaddr ? buf->vaddr + pgnum * PAGE_SIZE : NULL; vb2_dma_sg_dmabuf_ops_kmap() 503 struct vb2_dma_sg_buf *buf = dbuf->priv; vb2_dma_sg_dmabuf_ops_vmap() local 505 return vb2_dma_sg_vaddr(buf); vb2_dma_sg_dmabuf_ops_vmap() 528 struct vb2_dma_sg_buf *buf = buf_priv; vb2_dma_sg_get_dmabuf() local 533 exp_info.size = buf->size; vb2_dma_sg_get_dmabuf() 535 exp_info.priv = buf; vb2_dma_sg_get_dmabuf() 537 if (WARN_ON(!buf->dma_sgt)) vb2_dma_sg_get_dmabuf() 545 atomic_inc(&buf->refcount); vb2_dma_sg_get_dmabuf() 556 struct vb2_dma_sg_buf *buf = mem_priv; vb2_dma_sg_map_dmabuf() local 559 if (WARN_ON(!buf->db_attach)) { vb2_dma_sg_map_dmabuf() 564 if (WARN_ON(buf->dma_sgt)) { vb2_dma_sg_map_dmabuf() 570 sgt = dma_buf_map_attachment(buf->db_attach, buf->dma_dir); vb2_dma_sg_map_dmabuf() 576 buf->dma_sgt = sgt; vb2_dma_sg_map_dmabuf() 577 buf->vaddr = NULL; vb2_dma_sg_map_dmabuf() 584 struct vb2_dma_sg_buf *buf = mem_priv; vb2_dma_sg_unmap_dmabuf() local 585 struct sg_table *sgt = buf->dma_sgt; vb2_dma_sg_unmap_dmabuf() 587 if (WARN_ON(!buf->db_attach)) { vb2_dma_sg_unmap_dmabuf() 597 if (buf->vaddr) { vb2_dma_sg_unmap_dmabuf() 598 dma_buf_vunmap(buf->db_attach->dmabuf, buf->vaddr); vb2_dma_sg_unmap_dmabuf() 599 buf->vaddr = NULL; vb2_dma_sg_unmap_dmabuf() 601 dma_buf_unmap_attachment(buf->db_attach, sgt, buf->dma_dir); vb2_dma_sg_unmap_dmabuf() 603 buf->dma_sgt = NULL; vb2_dma_sg_unmap_dmabuf() 608 struct vb2_dma_sg_buf *buf = mem_priv; vb2_dma_sg_detach_dmabuf() local 611 if (WARN_ON(buf->dma_sgt)) vb2_dma_sg_detach_dmabuf() 612 vb2_dma_sg_unmap_dmabuf(buf); vb2_dma_sg_detach_dmabuf() 615 dma_buf_detach(buf->db_attach->dmabuf, buf->db_attach); vb2_dma_sg_detach_dmabuf() 616 kfree(buf); vb2_dma_sg_detach_dmabuf() 623 struct vb2_dma_sg_buf *buf; vb2_dma_sg_attach_dmabuf() local 629 buf = kzalloc(sizeof(*buf), GFP_KERNEL); vb2_dma_sg_attach_dmabuf() 630 if (!buf) vb2_dma_sg_attach_dmabuf() 633 buf->dev = conf->dev; vb2_dma_sg_attach_dmabuf() 635 dba = dma_buf_attach(dbuf, buf->dev); vb2_dma_sg_attach_dmabuf() 638 kfree(buf); vb2_dma_sg_attach_dmabuf() 642 buf->dma_dir = dma_dir; vb2_dma_sg_attach_dmabuf() 643 buf->size = size; vb2_dma_sg_attach_dmabuf() 644 buf->db_attach = dba; vb2_dma_sg_attach_dmabuf() 646 return buf; vb2_dma_sg_attach_dmabuf() 651 struct vb2_dma_sg_buf *buf = buf_priv; vb2_dma_sg_cookie() local 653 return buf->dma_sgt; vb2_dma_sg_cookie()
|
H A D | videobuf2-vmalloc.c | 39 struct vb2_vmalloc_buf *buf; vb2_vmalloc_alloc() local 41 buf = kzalloc(sizeof(*buf), GFP_KERNEL | gfp_flags); vb2_vmalloc_alloc() 42 if (!buf) vb2_vmalloc_alloc() 45 buf->size = size; vb2_vmalloc_alloc() 46 buf->vaddr = vmalloc_user(buf->size); vb2_vmalloc_alloc() 47 buf->dma_dir = dma_dir; vb2_vmalloc_alloc() 48 buf->handler.refcount = &buf->refcount; vb2_vmalloc_alloc() 49 buf->handler.put = vb2_vmalloc_put; vb2_vmalloc_alloc() 50 buf->handler.arg = buf; vb2_vmalloc_alloc() 52 if (!buf->vaddr) { vb2_vmalloc_alloc() 53 pr_debug("vmalloc of size %ld failed\n", buf->size); vb2_vmalloc_alloc() 54 kfree(buf); vb2_vmalloc_alloc() 58 atomic_inc(&buf->refcount); vb2_vmalloc_alloc() 59 return buf; vb2_vmalloc_alloc() 64 struct vb2_vmalloc_buf *buf = buf_priv; vb2_vmalloc_put() local 66 if (atomic_dec_and_test(&buf->refcount)) { vb2_vmalloc_put() 67 vfree(buf->vaddr); vb2_vmalloc_put() 68 kfree(buf); vb2_vmalloc_put() 76 struct vb2_vmalloc_buf *buf; vb2_vmalloc_get_userptr() local 80 buf = kzalloc(sizeof(*buf), GFP_KERNEL); vb2_vmalloc_get_userptr() 81 if (!buf) vb2_vmalloc_get_userptr() 84 buf->dma_dir = dma_dir; vb2_vmalloc_get_userptr() 86 buf->size = size; vb2_vmalloc_get_userptr() 90 buf->vec = vec; vb2_vmalloc_get_userptr() 102 buf->vaddr = (__force void *) vb2_vmalloc_get_userptr() 105 buf->vaddr = vm_map_ram(frame_vector_pages(vec), n_pages, -1, vb2_vmalloc_get_userptr() 109 if (!buf->vaddr) vb2_vmalloc_get_userptr() 111 buf->vaddr += offset; vb2_vmalloc_get_userptr() 112 return buf; vb2_vmalloc_get_userptr() 117 kfree(buf); vb2_vmalloc_get_userptr() 124 struct vb2_vmalloc_buf *buf = buf_priv; vb2_vmalloc_put_userptr() local 125 unsigned long vaddr = (unsigned long)buf->vaddr & PAGE_MASK; vb2_vmalloc_put_userptr() 130 if (!buf->vec->is_pfns) { vb2_vmalloc_put_userptr() 131 n_pages = frame_vector_count(buf->vec); vb2_vmalloc_put_userptr() 132 pages = frame_vector_pages(buf->vec); vb2_vmalloc_put_userptr() 135 if (buf->dma_dir == DMA_FROM_DEVICE) vb2_vmalloc_put_userptr() 139 iounmap((__force void __iomem *)buf->vaddr); vb2_vmalloc_put_userptr() 141 vb2_destroy_framevec(buf->vec); vb2_vmalloc_put_userptr() 142 kfree(buf); vb2_vmalloc_put_userptr() 147 struct vb2_vmalloc_buf *buf = buf_priv; vb2_vmalloc_vaddr() local 149 if (!buf->vaddr) { vb2_vmalloc_vaddr() 155 return buf->vaddr; vb2_vmalloc_vaddr() 160 struct vb2_vmalloc_buf *buf = buf_priv; vb2_vmalloc_num_users() local 161 return atomic_read(&buf->refcount); vb2_vmalloc_num_users() 166 struct vb2_vmalloc_buf *buf = buf_priv; vb2_vmalloc_mmap() local 169 if (!buf) { vb2_vmalloc_mmap() 174 ret = remap_vmalloc_range(vma, buf->vaddr, 0); vb2_vmalloc_mmap() 188 vma->vm_private_data = &buf->handler; vb2_vmalloc_mmap() 210 struct vb2_vmalloc_buf *buf = dbuf->priv; vb2_vmalloc_dmabuf_ops_attach() local 211 int num_pages = PAGE_ALIGN(buf->size) / PAGE_SIZE; vb2_vmalloc_dmabuf_ops_attach() 214 void *vaddr = buf->vaddr; vb2_vmalloc_dmabuf_ops_attach() 319 struct vb2_vmalloc_buf *buf = dbuf->priv; vb2_vmalloc_dmabuf_ops_kmap() local 321 return buf->vaddr + pgnum * PAGE_SIZE; vb2_vmalloc_dmabuf_ops_kmap() 326 struct vb2_vmalloc_buf *buf = dbuf->priv; vb2_vmalloc_dmabuf_ops_vmap() local 328 return buf->vaddr; vb2_vmalloc_dmabuf_ops_vmap() 351 struct vb2_vmalloc_buf *buf = buf_priv; vb2_vmalloc_get_dmabuf() local 356 exp_info.size = buf->size; vb2_vmalloc_get_dmabuf() 358 exp_info.priv = buf; vb2_vmalloc_get_dmabuf() 360 if (WARN_ON(!buf->vaddr)) vb2_vmalloc_get_dmabuf() 368 atomic_inc(&buf->refcount); vb2_vmalloc_get_dmabuf() 381 struct vb2_vmalloc_buf *buf = mem_priv; vb2_vmalloc_map_dmabuf() local 383 buf->vaddr = dma_buf_vmap(buf->dbuf); vb2_vmalloc_map_dmabuf() 385 return buf->vaddr ? 0 : -EFAULT; vb2_vmalloc_map_dmabuf() 390 struct vb2_vmalloc_buf *buf = mem_priv; vb2_vmalloc_unmap_dmabuf() local 392 dma_buf_vunmap(buf->dbuf, buf->vaddr); vb2_vmalloc_unmap_dmabuf() 393 buf->vaddr = NULL; vb2_vmalloc_unmap_dmabuf() 398 struct vb2_vmalloc_buf *buf = mem_priv; vb2_vmalloc_detach_dmabuf() local 400 if (buf->vaddr) vb2_vmalloc_detach_dmabuf() 401 dma_buf_vunmap(buf->dbuf, buf->vaddr); vb2_vmalloc_detach_dmabuf() 403 kfree(buf); vb2_vmalloc_detach_dmabuf() 409 struct vb2_vmalloc_buf *buf; vb2_vmalloc_attach_dmabuf() local 414 buf = kzalloc(sizeof(*buf), GFP_KERNEL); vb2_vmalloc_attach_dmabuf() 415 if (!buf) vb2_vmalloc_attach_dmabuf() 418 buf->dbuf = dbuf; vb2_vmalloc_attach_dmabuf() 419 buf->dma_dir = dma_dir; vb2_vmalloc_attach_dmabuf() 420 buf->size = size; vb2_vmalloc_attach_dmabuf() 422 return buf; vb2_vmalloc_attach_dmabuf()
|
H A D | videobuf2-dma-contig.c | 13 #include <linux/dma-buf.h> 72 struct vb2_dc_buf *buf = buf_priv; vb2_dc_cookie() local 74 return &buf->dma_addr; vb2_dc_cookie() 79 struct vb2_dc_buf *buf = buf_priv; vb2_dc_vaddr() local 81 if (!buf->vaddr && buf->db_attach) vb2_dc_vaddr() 82 buf->vaddr = dma_buf_vmap(buf->db_attach->dmabuf); vb2_dc_vaddr() 84 return buf->vaddr; vb2_dc_vaddr() 89 struct vb2_dc_buf *buf = buf_priv; vb2_dc_num_users() local 91 return atomic_read(&buf->refcount); vb2_dc_num_users() 96 struct vb2_dc_buf *buf = buf_priv; vb2_dc_prepare() local 97 struct sg_table *sgt = buf->dma_sgt; vb2_dc_prepare() 100 if (!sgt || buf->db_attach) vb2_dc_prepare() 103 dma_sync_sg_for_device(buf->dev, sgt->sgl, sgt->orig_nents, vb2_dc_prepare() 104 buf->dma_dir); vb2_dc_prepare() 109 struct vb2_dc_buf *buf = buf_priv; vb2_dc_finish() local 110 struct sg_table *sgt = buf->dma_sgt; vb2_dc_finish() 113 if (!sgt || buf->db_attach) vb2_dc_finish() 116 dma_sync_sg_for_cpu(buf->dev, sgt->sgl, sgt->orig_nents, buf->dma_dir); vb2_dc_finish() 125 struct vb2_dc_buf *buf = buf_priv; vb2_dc_put() local 127 if (!atomic_dec_and_test(&buf->refcount)) vb2_dc_put() 130 if (buf->sgt_base) { vb2_dc_put() 131 sg_free_table(buf->sgt_base); vb2_dc_put() 132 kfree(buf->sgt_base); vb2_dc_put() 134 dma_free_coherent(buf->dev, buf->size, buf->vaddr, buf->dma_addr); vb2_dc_put() 135 put_device(buf->dev); vb2_dc_put() 136 kfree(buf); vb2_dc_put() 144 struct vb2_dc_buf *buf; vb2_dc_alloc() local 146 buf = kzalloc(sizeof *buf, GFP_KERNEL); vb2_dc_alloc() 147 if (!buf) vb2_dc_alloc() 150 buf->vaddr = dma_alloc_coherent(dev, size, &buf->dma_addr, vb2_dc_alloc() 152 if (!buf->vaddr) { vb2_dc_alloc() 154 kfree(buf); vb2_dc_alloc() 159 buf->dev = get_device(dev); vb2_dc_alloc() 160 buf->size = size; vb2_dc_alloc() 161 buf->dma_dir = dma_dir; vb2_dc_alloc() 163 buf->handler.refcount = &buf->refcount; vb2_dc_alloc() 164 buf->handler.put = vb2_dc_put; vb2_dc_alloc() 165 buf->handler.arg = buf; vb2_dc_alloc() 167 atomic_inc(&buf->refcount); vb2_dc_alloc() 169 return buf; vb2_dc_alloc() 174 struct vb2_dc_buf *buf = buf_priv; vb2_dc_mmap() local 177 if (!buf) { vb2_dc_mmap() 188 ret = dma_mmap_coherent(buf->dev, vma, buf->vaddr, vb2_dc_mmap() 189 buf->dma_addr, buf->size); vb2_dc_mmap() 197 vma->vm_private_data = &buf->handler; vb2_dc_mmap() 203 __func__, (unsigned long)buf->dma_addr, vma->vm_start, vb2_dc_mmap() 204 buf->size); vb2_dc_mmap() 225 struct vb2_dc_buf *buf = dbuf->priv; vb2_dc_dmabuf_ops_attach() local 233 /* Copy the buf->base_sgt scatter list to the attachment, as we can't vb2_dc_dmabuf_ops_attach() 236 ret = sg_alloc_table(sgt, buf->sgt_base->orig_nents, GFP_KERNEL); vb2_dc_dmabuf_ops_attach() 242 rd = buf->sgt_base->sgl; vb2_dc_dmabuf_ops_attach() 330 struct vb2_dc_buf *buf = dbuf->priv; vb2_dc_dmabuf_ops_kmap() local 332 return buf->vaddr + pgnum * PAGE_SIZE; vb2_dc_dmabuf_ops_kmap() 337 struct vb2_dc_buf *buf = dbuf->priv; vb2_dc_dmabuf_ops_vmap() local 339 return buf->vaddr; vb2_dc_dmabuf_ops_vmap() 360 static struct sg_table *vb2_dc_get_base_sgt(struct vb2_dc_buf *buf) vb2_dc_get_base_sgt() argument 367 dev_err(buf->dev, "failed to alloc sg table\n"); vb2_dc_get_base_sgt() 371 ret = dma_get_sgtable(buf->dev, sgt, buf->vaddr, buf->dma_addr, vb2_dc_get_base_sgt() 372 buf->size); vb2_dc_get_base_sgt() 374 dev_err(buf->dev, "failed to get scatterlist from DMA API\n"); vb2_dc_get_base_sgt() 384 struct vb2_dc_buf *buf = buf_priv; vb2_dc_get_dmabuf() local 389 exp_info.size = buf->size; vb2_dc_get_dmabuf() 391 exp_info.priv = buf; vb2_dc_get_dmabuf() 393 if (!buf->sgt_base) vb2_dc_get_dmabuf() 394 buf->sgt_base = vb2_dc_get_base_sgt(buf); vb2_dc_get_dmabuf() 396 if (WARN_ON(!buf->sgt_base)) vb2_dc_get_dmabuf() 404 atomic_inc(&buf->refcount); vb2_dc_get_dmabuf() 415 struct vb2_dc_buf *buf = buf_priv; vb2_dc_put_userptr() local 416 struct sg_table *sgt = buf->dma_sgt; vb2_dc_put_userptr() 428 dma_unmap_sg_attrs(buf->dev, sgt->sgl, sgt->orig_nents, vb2_dc_put_userptr() 429 buf->dma_dir, &attrs); vb2_dc_put_userptr() 430 pages = frame_vector_pages(buf->vec); vb2_dc_put_userptr() 433 for (i = 0; i < frame_vector_count(buf->vec); i++) vb2_dc_put_userptr() 438 vb2_destroy_framevec(buf->vec); vb2_dc_put_userptr() 439 kfree(buf); vb2_dc_put_userptr() 477 struct vb2_dc_buf *buf; vb2_dc_get_userptr() local 500 buf = kzalloc(sizeof *buf, GFP_KERNEL); vb2_dc_get_userptr() 501 if (!buf) vb2_dc_get_userptr() 504 buf->dev = conf->dev; vb2_dc_get_userptr() 505 buf->dma_dir = dma_dir; vb2_dc_get_userptr() 513 buf->vec = vec; vb2_dc_get_userptr() 526 buf->dma_addr = vb2_dc_pfn_to_dma(buf->dev, nums[0]); vb2_dc_get_userptr() 548 sgt->nents = dma_map_sg_attrs(buf->dev, sgt->sgl, sgt->orig_nents, vb2_dc_get_userptr() 549 buf->dma_dir, &attrs); vb2_dc_get_userptr() 564 buf->dma_addr = sg_dma_address(sgt->sgl); vb2_dc_get_userptr() 565 buf->dma_sgt = sgt; vb2_dc_get_userptr() 567 buf->size = size; vb2_dc_get_userptr() 569 return buf; vb2_dc_get_userptr() 572 dma_unmap_sg_attrs(buf->dev, sgt->sgl, sgt->orig_nents, vb2_dc_get_userptr() 573 buf->dma_dir, &attrs); vb2_dc_get_userptr() 585 kfree(buf); vb2_dc_get_userptr() 596 struct vb2_dc_buf *buf = mem_priv; vb2_dc_map_dmabuf() local 600 if (WARN_ON(!buf->db_attach)) { vb2_dc_map_dmabuf() 605 if (WARN_ON(buf->dma_sgt)) { vb2_dc_map_dmabuf() 611 sgt = dma_buf_map_attachment(buf->db_attach, buf->dma_dir); vb2_dc_map_dmabuf() 619 if (contig_size < buf->size) { vb2_dc_map_dmabuf() 621 contig_size, buf->size); vb2_dc_map_dmabuf() 622 dma_buf_unmap_attachment(buf->db_attach, sgt, buf->dma_dir); vb2_dc_map_dmabuf() 626 buf->dma_addr = sg_dma_address(sgt->sgl); vb2_dc_map_dmabuf() 627 buf->dma_sgt = sgt; vb2_dc_map_dmabuf() 628 buf->vaddr = NULL; vb2_dc_map_dmabuf() 635 struct vb2_dc_buf *buf = mem_priv; vb2_dc_unmap_dmabuf() local 636 struct sg_table *sgt = buf->dma_sgt; vb2_dc_unmap_dmabuf() 638 if (WARN_ON(!buf->db_attach)) { vb2_dc_unmap_dmabuf() 648 if (buf->vaddr) { vb2_dc_unmap_dmabuf() 649 dma_buf_vunmap(buf->db_attach->dmabuf, buf->vaddr); vb2_dc_unmap_dmabuf() 650 buf->vaddr = NULL; vb2_dc_unmap_dmabuf() 652 dma_buf_unmap_attachment(buf->db_attach, sgt, buf->dma_dir); vb2_dc_unmap_dmabuf() 654 buf->dma_addr = 0; vb2_dc_unmap_dmabuf() 655 buf->dma_sgt = NULL; vb2_dc_unmap_dmabuf() 660 struct vb2_dc_buf *buf = mem_priv; vb2_dc_detach_dmabuf() local 663 if (WARN_ON(buf->dma_addr)) vb2_dc_detach_dmabuf() 664 vb2_dc_unmap_dmabuf(buf); vb2_dc_detach_dmabuf() 667 dma_buf_detach(buf->db_attach->dmabuf, buf->db_attach); vb2_dc_detach_dmabuf() 668 kfree(buf); vb2_dc_detach_dmabuf() 675 struct vb2_dc_buf *buf; vb2_dc_attach_dmabuf() local 681 buf = kzalloc(sizeof(*buf), GFP_KERNEL); vb2_dc_attach_dmabuf() 682 if (!buf) vb2_dc_attach_dmabuf() 685 buf->dev = conf->dev; vb2_dc_attach_dmabuf() 687 dba = dma_buf_attach(dbuf, buf->dev); vb2_dc_attach_dmabuf() 690 kfree(buf); vb2_dc_attach_dmabuf() 694 buf->dma_dir = dma_dir; vb2_dc_attach_dmabuf() 695 buf->size = size; vb2_dc_attach_dmabuf() 696 buf->db_attach = dba; vb2_dc_attach_dmabuf() 698 return buf; vb2_dc_attach_dmabuf()
|
/linux-4.4.14/sound/firewire/oxfw/ |
H A D | oxfw-command.c | 14 u8 *buf; avc_stream_set_format() local 17 buf = kmalloc(len + 10, GFP_KERNEL); avc_stream_set_format() 18 if (buf == NULL) avc_stream_set_format() 21 buf[0] = 0x00; /* CONTROL */ avc_stream_set_format() 22 buf[1] = 0xff; /* UNIT */ avc_stream_set_format() 23 buf[2] = 0xbf; /* EXTENDED STREAM FORMAT INFORMATION */ avc_stream_set_format() 24 buf[3] = 0xc0; /* SINGLE subfunction */ avc_stream_set_format() 25 buf[4] = dir; /* Plug Direction */ avc_stream_set_format() 26 buf[5] = 0x00; /* UNIT */ avc_stream_set_format() 27 buf[6] = 0x00; /* PCR (Isochronous Plug) */ avc_stream_set_format() 28 buf[7] = 0xff & pid; /* Plug ID */ avc_stream_set_format() 29 buf[8] = 0xff; /* Padding */ avc_stream_set_format() 30 buf[9] = 0xff; /* Support status in response */ avc_stream_set_format() 31 memcpy(buf + 10, format, len); avc_stream_set_format() 33 /* do transaction and check buf[1-8] are the same against command */ avc_stream_set_format() 34 err = fcp_avc_transaction(unit, buf, len + 10, buf, len + 10, avc_stream_set_format() 39 else if (buf[0] == 0x08) /* NOT IMPLEMENTED */ avc_stream_set_format() 41 else if (buf[0] == 0x0a) /* REJECTED */ avc_stream_set_format() 46 kfree(buf); avc_stream_set_format() 53 u8 *buf, unsigned int *len, unsigned int eid) avc_stream_get_format() 63 buf[0] = 0x01; /* STATUS */ avc_stream_get_format() 64 buf[1] = 0xff; /* UNIT */ avc_stream_get_format() 65 buf[2] = 0xbf; /* EXTENDED STREAM FORMAT INFORMATION */ avc_stream_get_format() 66 buf[3] = subfunc; /* SINGLE or LIST */ avc_stream_get_format() 67 buf[4] = dir; /* Plug Direction */ avc_stream_get_format() 68 buf[5] = 0x00; /* Unit */ avc_stream_get_format() 69 buf[6] = 0x00; /* PCR (Isochronous Plug) */ avc_stream_get_format() 70 buf[7] = 0xff & pid; /* Plug ID */ avc_stream_get_format() 71 buf[8] = 0xff; /* Padding */ avc_stream_get_format() 72 buf[9] = 0xff; /* support status in response */ avc_stream_get_format() 73 buf[10] = 0xff & eid; /* entry ID for LIST subfunction */ avc_stream_get_format() 74 buf[11] = 0xff; /* padding */ avc_stream_get_format() 76 /* do transaction and check buf[1-7] are the same against command */ avc_stream_get_format() 77 err = fcp_avc_transaction(unit, buf, 12, buf, *len, avc_stream_get_format() 82 else if (buf[0] == 0x08) /* NOT IMPLEMENTED */ avc_stream_get_format() 84 else if (buf[0] == 0x0a) /* REJECTED */ avc_stream_get_format() 86 else if (buf[0] == 0x0b) /* IN TRANSITION */ avc_stream_get_format() 89 else if ((subfunc == 0xc1) && (buf[10] != eid)) avc_stream_get_format() 96 memmove(buf, buf + 10, err - 10); avc_stream_get_format() 99 memmove(buf, buf + 11, err - 11); avc_stream_get_format() 113 u8 *buf; avc_general_inquiry_sig_fmt() local 123 buf = kzalloc(8, GFP_KERNEL); avc_general_inquiry_sig_fmt() 124 if (buf == NULL) avc_general_inquiry_sig_fmt() 127 buf[0] = 0x02; /* SPECIFIC INQUIRY */ avc_general_inquiry_sig_fmt() 128 buf[1] = 0xff; /* UNIT */ avc_general_inquiry_sig_fmt() 130 buf[2] = 0x19; /* INPUT PLUG SIGNAL FORMAT */ avc_general_inquiry_sig_fmt() 132 buf[2] = 0x18; /* OUTPUT PLUG SIGNAL FORMAT */ avc_general_inquiry_sig_fmt() 133 buf[3] = 0xff & pid; /* plug id */ avc_general_inquiry_sig_fmt() 134 buf[4] = 0x90; /* EOH_1, Form_1, FMT. AM824 */ avc_general_inquiry_sig_fmt() 135 buf[5] = 0x07 & sfc; /* FDF-hi. AM824, frequency */ avc_general_inquiry_sig_fmt() 136 buf[6] = 0xff; /* FDF-mid. AM824, SYT hi (not used) */ avc_general_inquiry_sig_fmt() 137 buf[7] = 0xff; /* FDF-low. AM824, SYT lo (not used) */ avc_general_inquiry_sig_fmt() 139 /* do transaction and check buf[1-5] are the same against command */ avc_general_inquiry_sig_fmt() 140 err = fcp_avc_transaction(unit, buf, 8, buf, 8, avc_general_inquiry_sig_fmt() 144 else if (buf[0] == 0x08) /* NOT IMPLEMENTED */ avc_general_inquiry_sig_fmt() 151 kfree(buf); avc_general_inquiry_sig_fmt() 51 avc_stream_get_format(struct fw_unit *unit, enum avc_general_plug_dir dir, unsigned int pid, u8 *buf, unsigned int *len, unsigned int eid) avc_stream_get_format() argument
|
H A D | oxfw-control.c | 20 u8 *buf; oxfw_mute_command() local 24 buf = kmalloc(11, GFP_KERNEL); oxfw_mute_command() 25 if (!buf) oxfw_mute_command() 29 buf[0] = 0x01; /* AV/C, STATUS */ oxfw_mute_command() 32 buf[0] = 0x00; /* AV/C, CONTROL */ oxfw_mute_command() 35 buf[1] = 0x08; /* audio unit 0 */ oxfw_mute_command() 36 buf[2] = 0xb8; /* FUNCTION BLOCK */ oxfw_mute_command() 37 buf[3] = 0x81; /* function block type: feature */ oxfw_mute_command() 38 buf[4] = oxfw->device_info->mute_fb_id; /* function block ID */ oxfw_mute_command() 39 buf[5] = 0x10; /* control attribute: current */ oxfw_mute_command() 40 buf[6] = 0x02; /* selector length */ oxfw_mute_command() 41 buf[7] = 0x00; /* audio channel number */ oxfw_mute_command() 42 buf[8] = 0x01; /* control selector: mute */ oxfw_mute_command() 43 buf[9] = 0x01; /* control data length */ oxfw_mute_command() 45 buf[10] = 0xff; oxfw_mute_command() 47 buf[10] = *value ? 0x70 : 0x60; oxfw_mute_command() 49 err = fcp_avc_transaction(oxfw->unit, buf, 11, buf, 11, 0x3fe); oxfw_mute_command() 57 if (buf[0] != response_ok) { oxfw_mute_command() 63 *value = buf[10] == 0x70; oxfw_mute_command() 68 kfree(buf); oxfw_mute_command() 78 u8 *buf; oxfw_volume_command() local 82 buf = kmalloc(12, GFP_KERNEL); oxfw_volume_command() 83 if (!buf) oxfw_volume_command() 87 buf[0] = 0x01; /* AV/C, STATUS */ oxfw_volume_command() 90 buf[0] = 0x00; /* AV/C, CONTROL */ oxfw_volume_command() 93 buf[1] = 0x08; /* audio unit 0 */ oxfw_volume_command() 94 buf[2] = 0xb8; /* FUNCTION BLOCK */ oxfw_volume_command() 95 buf[3] = 0x81; /* function block type: feature */ oxfw_volume_command() 96 buf[4] = oxfw->device_info->volume_fb_id; /* function block ID */ oxfw_volume_command() 97 buf[5] = attribute; /* control attribute */ oxfw_volume_command() 98 buf[6] = 0x02; /* selector length */ oxfw_volume_command() 99 buf[7] = channel; /* audio channel number */ oxfw_volume_command() 100 buf[8] = 0x02; /* control selector: volume */ oxfw_volume_command() 101 buf[9] = 0x02; /* control data length */ oxfw_volume_command() 103 buf[10] = 0xff; oxfw_volume_command() 104 buf[11] = 0xff; oxfw_volume_command() 106 buf[10] = *value >> 8; oxfw_volume_command() 107 buf[11] = *value; oxfw_volume_command() 110 err = fcp_avc_transaction(oxfw->unit, buf, 12, buf, 12, 0x3fe); oxfw_volume_command() 118 if (buf[0] != response_ok) { oxfw_volume_command() 124 *value = (buf[10] << 8) | buf[11]; oxfw_volume_command() 129 kfree(buf); oxfw_volume_command()
|
/linux-4.4.14/drivers/media/pci/ttpci/ |
H A D | av7110_ipack.c | 24 void (*func)(u8 *buf, int size, void *priv)) av7110_ipack_init() 26 if (!(p->buf = vmalloc(size*sizeof(u8)))) { av7110_ipack_init() 40 vfree(p->buf); av7110_ipack_free() 57 p->buf[3] = p->cid; send_ipack() 58 p->buf[4] = (u8)(((p->count - 6) & 0xff00) >> 8); send_ipack() 59 p->buf[5] = (u8)((p->count - 6) & 0x00ff); send_ipack() 61 off = 9 + p->buf[8]; send_ipack() 62 streamid = p->buf[off]; send_ipack() 65 ac3_off = ((p->buf[off + 2] << 8)| send_ipack() 66 p->buf[off + 3]); send_ipack() 68 f = dvb_filter_get_ac3info(p->buf + off + 3 + ac3_off, send_ipack() 73 p->buf[off + 2] = (ac3_off >> 8) & 0xff; send_ipack() 74 p->buf[off + 3] = (ac3_off) & 0xff; send_ipack() 75 p->buf[off + 1] = nframes; send_ipack() 80 p->func(p->buf, p->count, p->data); send_ipack() 82 p->buf[6] = 0x80; send_ipack() 83 p->buf[7] = 0x00; send_ipack() 84 p->buf[8] = 0x00; send_ipack() 89 p->buf[9] = streamid; send_ipack() 90 p->buf[10] = (ac3_off >> 8) & 0xff; send_ipack() 91 p->buf[11] = (ac3_off) & 0xff; send_ipack() 92 p->buf[12] = 0; send_ipack() 99 p->buf[3] = p->cid; send_ipack() 100 p->buf[4] = (u8)(((p->count - 6) & 0xff00) >> 8); send_ipack() 101 p->buf[5] = (u8)((p->count - 6) & 0x00ff); send_ipack() 102 p->func(p->buf, p->count, p->data); send_ipack() 104 p->buf[6] = 0x0f; send_ipack() 127 memcpy(p->buf, headr, 3); write_ipack() 132 memcpy(p->buf+p->count, data, count); write_ipack() 136 memcpy(p->buf+p->count, data, rest); write_ipack() 145 int av7110_ipack_instant_repack (const u8 *buf, int count, struct ipack *p) av7110_ipack_instant_repack() argument 157 if (buf[c] == 0x00) av7110_ipack_instant_repack() 164 if (buf[c] == 0x01) av7110_ipack_instant_repack() 166 else if (buf[c] == 0) av7110_ipack_instant_repack() 174 switch (buf[c]) { av7110_ipack_instant_repack() 189 p->cid = buf[c]; av7110_ipack_instant_repack() 200 p->plen[0] = buf[c]; av7110_ipack_instant_repack() 202 p->plen[1] = buf[c]; av7110_ipack_instant_repack() 207 p->plen[0] = buf[c]; av7110_ipack_instant_repack() 213 p->plen[1] = buf[c]; av7110_ipack_instant_repack() 220 p->flag1 = buf[c]; av7110_ipack_instant_repack() 236 p->flag2 = buf[c]; av7110_ipack_instant_repack() 244 p->hlength = buf[c]; av7110_ipack_instant_repack() 276 p->pts[p->found - 9] = buf[c]; av7110_ipack_instant_repack() 277 write_ipack(p, buf + c, 1); av7110_ipack_instant_repack() 294 p->check = buf[c]; av7110_ipack_instant_repack() 295 write_ipack(p, buf + c, 1); av7110_ipack_instant_repack() 305 p->check = buf[c]; av7110_ipack_instant_repack() 306 write_ipack(p, buf + c, 1); av7110_ipack_instant_repack() 314 p->check = buf[c]; av7110_ipack_instant_repack() 315 write_ipack(p, buf + c, 1); av7110_ipack_instant_repack() 325 p->check = buf[c]; av7110_ipack_instant_repack() 326 write_ipack(p, buf + c, 1); av7110_ipack_instant_repack() 346 p->pts[p->which - 2] = buf[c]; av7110_ipack_instant_repack() 347 write_ipack(p, buf + c, 1); av7110_ipack_instant_repack() 358 p->pts[p->which - 2] = buf[c]; av7110_ipack_instant_repack() 359 write_ipack(p, buf + c, 1); av7110_ipack_instant_repack() 377 write_ipack(p, buf + c, l); av7110_ipack_instant_repack() 399 av7110_ipack_instant_repack(buf + c, count - c, p); av7110_ipack_instant_repack() 23 av7110_ipack_init(struct ipack *p, int size, void (*func)(u8 *buf, int size, void *priv)) av7110_ipack_init() argument
|
H A D | av7110_ipack.h | 5 void (*func)(u8 *buf, int size, void *priv)); 8 extern int av7110_ipack_instant_repack(const u8 *buf, int count, struct ipack *p);
|
/linux-4.4.14/fs/ |
H A D | statfs.c | 49 static int statfs_by_dentry(struct dentry *dentry, struct kstatfs *buf) statfs_by_dentry() argument 56 memset(buf, 0, sizeof(*buf)); statfs_by_dentry() 60 retval = dentry->d_sb->s_op->statfs(dentry, buf); statfs_by_dentry() 61 if (retval == 0 && buf->f_frsize == 0) statfs_by_dentry() 62 buf->f_frsize = buf->f_bsize; statfs_by_dentry() 66 int vfs_statfs(struct path *path, struct kstatfs *buf) vfs_statfs() argument 70 error = statfs_by_dentry(path->dentry, buf); vfs_statfs() 72 buf->f_flags = calculate_f_flags(path->mnt); vfs_statfs() 108 struct statfs buf; do_statfs_native() local 110 if (sizeof(buf) == sizeof(*st)) do_statfs_native() 111 memcpy(&buf, st, sizeof(*st)); do_statfs_native() 113 if (sizeof buf.f_blocks == 4) { do_statfs_native() 130 buf.f_type = st->f_type; do_statfs_native() 131 buf.f_bsize = st->f_bsize; do_statfs_native() 132 buf.f_blocks = st->f_blocks; do_statfs_native() 133 buf.f_bfree = st->f_bfree; do_statfs_native() 134 buf.f_bavail = st->f_bavail; do_statfs_native() 135 buf.f_files = st->f_files; do_statfs_native() 136 buf.f_ffree = st->f_ffree; do_statfs_native() 137 buf.f_fsid = st->f_fsid; do_statfs_native() 138 buf.f_namelen = st->f_namelen; do_statfs_native() 139 buf.f_frsize = st->f_frsize; do_statfs_native() 140 buf.f_flags = st->f_flags; do_statfs_native() 141 memset(buf.f_spare, 0, sizeof(buf.f_spare)); do_statfs_native() 143 if (copy_to_user(p, &buf, sizeof(buf))) do_statfs_native() 150 struct statfs64 buf; do_statfs64() local 151 if (sizeof(buf) == sizeof(*st)) do_statfs64() 152 memcpy(&buf, st, sizeof(*st)); do_statfs64() 154 buf.f_type = st->f_type; do_statfs64() 155 buf.f_bsize = st->f_bsize; do_statfs64() 156 buf.f_blocks = st->f_blocks; do_statfs64() 157 buf.f_bfree = st->f_bfree; do_statfs64() 158 buf.f_bavail = st->f_bavail; do_statfs64() 159 buf.f_files = st->f_files; do_statfs64() 160 buf.f_ffree = st->f_ffree; do_statfs64() 161 buf.f_fsid = st->f_fsid; do_statfs64() 162 buf.f_namelen = st->f_namelen; do_statfs64() 163 buf.f_frsize = st->f_frsize; do_statfs64() 164 buf.f_flags = st->f_flags; do_statfs64() 165 memset(buf.f_spare, 0, sizeof(buf.f_spare)); do_statfs64() 167 if (copy_to_user(p, &buf, sizeof(buf))) do_statfs64() 172 SYSCALL_DEFINE2(statfs, const char __user *, pathname, struct statfs __user *, buf) SYSCALL_DEFINE2() 177 error = do_statfs_native(&st, buf); SYSCALL_DEFINE2() 181 SYSCALL_DEFINE3(statfs64, const char __user *, pathname, size_t, sz, struct statfs64 __user *, buf) SYSCALL_DEFINE3() 185 if (sz != sizeof(*buf)) SYSCALL_DEFINE3() 189 error = do_statfs64(&st, buf); SYSCALL_DEFINE3() 193 SYSCALL_DEFINE2(fstatfs, unsigned int, fd, struct statfs __user *, buf) SYSCALL_DEFINE2() 198 error = do_statfs_native(&st, buf); SYSCALL_DEFINE2() 202 SYSCALL_DEFINE3(fstatfs64, unsigned int, fd, size_t, sz, struct statfs64 __user *, buf) SYSCALL_DEFINE3() 207 if (sz != sizeof(*buf)) SYSCALL_DEFINE3() 212 error = do_statfs64(&st, buf); SYSCALL_DEFINE3()
|
H A D | readdir.c | 80 struct readdir_callback *buf = fillonedir() local 85 if (buf->result) fillonedir() 89 buf->result = -EOVERFLOW; fillonedir() 92 buf->result++; fillonedir() 93 dirent = buf->dirent; fillonedir() 106 buf->result = -EFAULT; fillonedir() 115 struct readdir_callback buf = { SYSCALL_DEFINE3() local 123 error = iterate_dir(f.file, &buf.ctx); SYSCALL_DEFINE3() 124 if (buf.result) SYSCALL_DEFINE3() 125 error = buf.result; SYSCALL_DEFINE3() 156 struct getdents_callback *buf = filldir() local 162 buf->error = -EINVAL; /* only used if we fail.. */ filldir() 163 if (reclen > buf->count) filldir() 167 buf->error = -EOVERFLOW; filldir() 170 dirent = buf->previous; filldir() 175 dirent = buf->current_dir; filldir() 186 buf->previous = dirent; filldir() 188 buf->current_dir = dirent; filldir() 189 buf->count -= reclen; filldir() 192 buf->error = -EFAULT; filldir() 201 struct getdents_callback buf = { SYSCALL_DEFINE3() local 215 error = iterate_dir(f.file, &buf.ctx); SYSCALL_DEFINE3() 217 error = buf.error; SYSCALL_DEFINE3() 218 lastdirent = buf.previous; SYSCALL_DEFINE3() 220 if (put_user(buf.ctx.pos, &lastdirent->d_off)) SYSCALL_DEFINE3() 223 error = count - buf.count; SYSCALL_DEFINE3() 241 struct getdents_callback64 *buf = filldir64() local 246 buf->error = -EINVAL; /* only used if we fail.. */ filldir64() 247 if (reclen > buf->count) filldir64() 249 dirent = buf->previous; filldir64() 254 dirent = buf->current_dir; filldir64() 267 buf->previous = dirent; filldir64() 269 buf->current_dir = dirent; filldir64() 270 buf->count -= reclen; filldir64() 273 buf->error = -EFAULT; filldir64() 282 struct getdents_callback64 buf = { SYSCALL_DEFINE3() local 296 error = iterate_dir(f.file, &buf.ctx); SYSCALL_DEFINE3() 298 error = buf.error; SYSCALL_DEFINE3() 299 lastdirent = buf.previous; SYSCALL_DEFINE3() 301 typeof(lastdirent->d_off) d_off = buf.ctx.pos; SYSCALL_DEFINE3() 305 error = count - buf.count; SYSCALL_DEFINE3()
|
/linux-4.4.14/drivers/usb/gadget/ |
H A D | u_os_desc.h | 38 static inline u8 *__usb_ext_prop_ptr(u8 *buf, size_t offset) __usb_ext_prop_ptr() argument 40 return buf + offset; __usb_ext_prop_ptr() 43 static inline u8 *usb_ext_prop_size_ptr(u8 *buf) usb_ext_prop_size_ptr() argument 45 return __usb_ext_prop_ptr(buf, USB_EXT_PROP_DW_SIZE); usb_ext_prop_size_ptr() 48 static inline u8 *usb_ext_prop_type_ptr(u8 *buf) usb_ext_prop_type_ptr() argument 50 return __usb_ext_prop_ptr(buf, USB_EXT_PROP_DW_PROPERTY_DATA_TYPE); usb_ext_prop_type_ptr() 53 static inline u8 *usb_ext_prop_name_len_ptr(u8 *buf) usb_ext_prop_name_len_ptr() argument 55 return __usb_ext_prop_ptr(buf, USB_EXT_PROP_W_PROPERTY_NAME_LENGTH); usb_ext_prop_name_len_ptr() 58 static inline u8 *usb_ext_prop_name_ptr(u8 *buf) usb_ext_prop_name_ptr() argument 60 return __usb_ext_prop_ptr(buf, USB_EXT_PROP_B_PROPERTY_NAME); usb_ext_prop_name_ptr() 63 static inline u8 *usb_ext_prop_data_len_ptr(u8 *buf, size_t off) usb_ext_prop_data_len_ptr() argument 65 return __usb_ext_prop_ptr(buf, usb_ext_prop_data_len_ptr() 69 static inline u8 *usb_ext_prop_data_ptr(u8 *buf, size_t off) usb_ext_prop_data_ptr() argument 71 return __usb_ext_prop_ptr(buf, USB_EXT_PROP_B_PROPERTY_DATA + off); usb_ext_prop_data_ptr() 74 static inline void usb_ext_prop_put_size(u8 *buf, int dw_size) usb_ext_prop_put_size() argument 76 put_unaligned_le32(dw_size, usb_ext_prop_size_ptr(buf)); usb_ext_prop_put_size() 79 static inline void usb_ext_prop_put_type(u8 *buf, int type) usb_ext_prop_put_type() argument 81 put_unaligned_le32(type, usb_ext_prop_type_ptr(buf)); usb_ext_prop_put_type() 84 static inline int usb_ext_prop_put_name(u8 *buf, const char *name, int pnl) usb_ext_prop_put_name() argument 88 put_unaligned_le16(pnl, usb_ext_prop_name_len_ptr(buf)); usb_ext_prop_put_name() 90 (wchar_t *) usb_ext_prop_name_ptr(buf), pnl - 2); usb_ext_prop_put_name() 94 put_unaligned_le16(0, &buf[USB_EXT_PROP_B_PROPERTY_NAME + pnl - 2]); usb_ext_prop_put_name() 99 static inline void usb_ext_prop_put_binary(u8 *buf, int pnl, const u8 *data, usb_ext_prop_put_binary() argument 102 put_unaligned_le32(data_len, usb_ext_prop_data_len_ptr(buf, pnl)); usb_ext_prop_put_binary() 103 memcpy(usb_ext_prop_data_ptr(buf, pnl), data, data_len); usb_ext_prop_put_binary() 106 static inline int usb_ext_prop_put_unicode(u8 *buf, int pnl, const char *string, usb_ext_prop_put_unicode() argument 110 put_unaligned_le32(data_len, usb_ext_prop_data_len_ptr(buf, pnl)); usb_ext_prop_put_unicode() 112 (wchar_t *) usb_ext_prop_data_ptr(buf, pnl), usb_ext_prop_put_unicode() 118 &buf[USB_EXT_PROP_B_PROPERTY_DATA + pnl + data_len - 2]); usb_ext_prop_put_unicode()
|
/linux-4.4.14/drivers/ata/ |
H A D | sata_promise.h | 46 unsigned int devno, u8 *buf) pdc_pkt_header() 49 __le32 *buf32 = (__le32 *) buf; pdc_pkt_header() 80 buf[12] = (1 << 5) | PDC_PKT_CLEAR_BSY | ATA_REG_DEVICE; pdc_pkt_header() 81 buf[13] = dev_reg; pdc_pkt_header() 84 buf[14] = (1 << 5) | PDC_REG_DEVCTL; pdc_pkt_header() 85 buf[15] = tf->ctl; pdc_pkt_header() 90 static inline unsigned int pdc_pkt_footer(struct ata_taskfile *tf, u8 *buf, pdc_pkt_footer() argument 94 buf[i++] = (1 << 5) | ATA_REG_DEVICE; pdc_pkt_footer() 95 buf[i++] = tf->device; pdc_pkt_footer() 99 buf[i++] = (1 << 5) | PDC_LAST_REG | ATA_REG_CMD; pdc_pkt_footer() 100 buf[i++] = tf->command; pdc_pkt_footer() 105 static inline unsigned int pdc_prep_lba28(struct ata_taskfile *tf, u8 *buf, unsigned int i) pdc_prep_lba28() argument 110 buf[i++] = (1 << 5) | ATA_REG_FEATURE; pdc_prep_lba28() 111 buf[i++] = tf->feature; pdc_prep_lba28() 113 buf[i++] = (1 << 5) | ATA_REG_NSECT; pdc_prep_lba28() 114 buf[i++] = tf->nsect; pdc_prep_lba28() 116 buf[i++] = (1 << 5) | ATA_REG_LBAL; pdc_prep_lba28() 117 buf[i++] = tf->lbal; pdc_prep_lba28() 119 buf[i++] = (1 << 5) | ATA_REG_LBAM; pdc_prep_lba28() 120 buf[i++] = tf->lbam; pdc_prep_lba28() 122 buf[i++] = (1 << 5) | ATA_REG_LBAH; pdc_prep_lba28() 123 buf[i++] = tf->lbah; pdc_prep_lba28() 128 static inline unsigned int pdc_prep_lba48(struct ata_taskfile *tf, u8 *buf, unsigned int i) pdc_prep_lba48() argument 133 buf[i++] = (2 << 5) | ATA_REG_FEATURE; pdc_prep_lba48() 134 buf[i++] = tf->hob_feature; pdc_prep_lba48() 135 buf[i++] = tf->feature; pdc_prep_lba48() 137 buf[i++] = (2 << 5) | ATA_REG_NSECT; pdc_prep_lba48() 138 buf[i++] = tf->hob_nsect; pdc_prep_lba48() 139 buf[i++] = tf->nsect; pdc_prep_lba48() 141 buf[i++] = (2 << 5) | ATA_REG_LBAL; pdc_prep_lba48() 142 buf[i++] = tf->hob_lbal; pdc_prep_lba48() 143 buf[i++] = tf->lbal; pdc_prep_lba48() 145 buf[i++] = (2 << 5) | ATA_REG_LBAM; pdc_prep_lba48() 146 buf[i++] = tf->hob_lbam; pdc_prep_lba48() 147 buf[i++] = tf->lbam; pdc_prep_lba48() 149 buf[i++] = (2 << 5) | ATA_REG_LBAH; pdc_prep_lba48() 150 buf[i++] = tf->hob_lbah; pdc_prep_lba48() 151 buf[i++] = tf->lbah; pdc_prep_lba48() 44 pdc_pkt_header(struct ata_taskfile *tf, dma_addr_t sg_table, unsigned int devno, u8 *buf) pdc_pkt_header() argument
|
/linux-4.4.14/drivers/media/common/siano/ |
H A D | smsdvb-debugfs.c | 53 char *buf; smsdvb_print_dvb_stats() local 61 buf = debug_data->stats_data; smsdvb_print_dvb_stats() 63 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_dvb_stats() 65 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_dvb_stats() 67 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_dvb_stats() 69 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_dvb_stats() 71 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_dvb_stats() 73 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_dvb_stats() 75 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_dvb_stats() 77 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_dvb_stats() 79 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_dvb_stats() 81 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_dvb_stats() 83 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_dvb_stats() 85 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_dvb_stats() 87 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_dvb_stats() 89 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_dvb_stats() 91 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_dvb_stats() 93 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_dvb_stats() 95 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_dvb_stats() 97 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_dvb_stats() 99 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_dvb_stats() 101 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_dvb_stats() 103 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_dvb_stats() 105 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_dvb_stats() 107 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_dvb_stats() 109 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_dvb_stats() 111 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_dvb_stats() 114 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_dvb_stats() 116 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_dvb_stats() 118 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_dvb_stats() 120 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_dvb_stats() 122 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_dvb_stats() 124 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_dvb_stats() 126 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_dvb_stats() 128 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_dvb_stats() 130 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_dvb_stats() 132 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_dvb_stats() 134 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_dvb_stats() 136 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_dvb_stats() 138 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_dvb_stats() 140 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_dvb_stats() 142 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_dvb_stats() 144 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_dvb_stats() 156 char *buf; smsdvb_print_isdb_stats() local 164 buf = debug_data->stats_data; smsdvb_print_isdb_stats() 166 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_isdb_stats() 168 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_isdb_stats() 171 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_isdb_stats() 173 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_isdb_stats() 175 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_isdb_stats() 177 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_isdb_stats() 179 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_isdb_stats() 181 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_isdb_stats() 183 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_isdb_stats() 185 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_isdb_stats() 187 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_isdb_stats() 189 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_isdb_stats() 191 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_isdb_stats() 193 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_isdb_stats() 195 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_isdb_stats() 197 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_isdb_stats() 199 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_isdb_stats() 201 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_isdb_stats() 209 n += snprintf(&buf[n], PAGE_SIZE - n, "\nLayer %d\n", i); smsdvb_print_isdb_stats() 210 n += snprintf(&buf[n], PAGE_SIZE - n, "\tcode_rate = %d\t", smsdvb_print_isdb_stats() 212 n += snprintf(&buf[n], PAGE_SIZE - n, "constellation = %d\n", smsdvb_print_isdb_stats() 214 n += snprintf(&buf[n], PAGE_SIZE - n, "\tber = %-5d\t", smsdvb_print_isdb_stats() 216 n += snprintf(&buf[n], PAGE_SIZE - n, "\tber_error_count = %-5d\t", smsdvb_print_isdb_stats() 218 n += snprintf(&buf[n], PAGE_SIZE - n, "ber_bit_count = %-5d\n", smsdvb_print_isdb_stats() 220 n += snprintf(&buf[n], PAGE_SIZE - n, "\tpre_ber = %-5d\t", smsdvb_print_isdb_stats() 222 n += snprintf(&buf[n], PAGE_SIZE - n, "\tts_per = %-5d\n", smsdvb_print_isdb_stats() 224 n += snprintf(&buf[n], PAGE_SIZE - n, "\terror_ts_packets = %-5d\t", smsdvb_print_isdb_stats() 226 n += snprintf(&buf[n], PAGE_SIZE - n, "total_ts_packets = %-5d\t", smsdvb_print_isdb_stats() 228 n += snprintf(&buf[n], PAGE_SIZE - n, "ti_ldepth_i = %d\n", smsdvb_print_isdb_stats() 230 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_isdb_stats() 233 n += snprintf(&buf[n], PAGE_SIZE - n, "tmcc_errors = %d\n", smsdvb_print_isdb_stats() 246 char *buf; smsdvb_print_isdb_stats_ex() local 254 buf = debug_data->stats_data; smsdvb_print_isdb_stats_ex() 256 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_isdb_stats_ex() 258 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_isdb_stats_ex() 261 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_isdb_stats_ex() 263 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_isdb_stats_ex() 265 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_isdb_stats_ex() 267 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_isdb_stats_ex() 269 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_isdb_stats_ex() 271 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_isdb_stats_ex() 273 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_isdb_stats_ex() 275 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_isdb_stats_ex() 277 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_isdb_stats_ex() 279 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_isdb_stats_ex() 281 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_isdb_stats_ex() 283 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_isdb_stats_ex() 285 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_isdb_stats_ex() 287 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_isdb_stats_ex() 289 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_isdb_stats_ex() 291 n += snprintf(&buf[n], PAGE_SIZE - n, "segment_number = %d\t", smsdvb_print_isdb_stats_ex() 293 n += snprintf(&buf[n], PAGE_SIZE - n, "tune_bw = %d\n", smsdvb_print_isdb_stats_ex() 301 n += snprintf(&buf[n], PAGE_SIZE - n, "\nLayer %d\n", i); smsdvb_print_isdb_stats_ex() 302 n += snprintf(&buf[n], PAGE_SIZE - n, "\tcode_rate = %d\t", smsdvb_print_isdb_stats_ex() 304 n += snprintf(&buf[n], PAGE_SIZE - n, "constellation = %d\n", smsdvb_print_isdb_stats_ex() 306 n += snprintf(&buf[n], PAGE_SIZE - n, "\tber = %-5d\t", smsdvb_print_isdb_stats_ex() 308 n += snprintf(&buf[n], PAGE_SIZE - n, "\tber_error_count = %-5d\t", smsdvb_print_isdb_stats_ex() 310 n += snprintf(&buf[n], PAGE_SIZE - n, "ber_bit_count = %-5d\n", smsdvb_print_isdb_stats_ex() 312 n += snprintf(&buf[n], PAGE_SIZE - n, "\tpre_ber = %-5d\t", smsdvb_print_isdb_stats_ex() 314 n += snprintf(&buf[n], PAGE_SIZE - n, "\tts_per = %-5d\n", smsdvb_print_isdb_stats_ex() 316 n += snprintf(&buf[n], PAGE_SIZE - n, "\terror_ts_packets = %-5d\t", smsdvb_print_isdb_stats_ex() 318 n += snprintf(&buf[n], PAGE_SIZE - n, "total_ts_packets = %-5d\t", smsdvb_print_isdb_stats_ex() 320 n += snprintf(&buf[n], PAGE_SIZE - n, "ti_ldepth_i = %d\n", smsdvb_print_isdb_stats_ex() 322 n += snprintf(&buf[n], PAGE_SIZE - n, smsdvb_print_isdb_stats_ex() 325 n += snprintf(&buf[n], PAGE_SIZE - n, "tmcc_errors = %d\n", smsdvb_print_isdb_stats_ex()
|
/linux-4.4.14/drivers/media/dvb-frontends/ |
H A D | nxt200x.c | 72 static int i2c_writebytes (struct nxt200x_state* state, u8 addr, u8 *buf, u8 len) i2c_writebytes() argument 75 struct i2c_msg msg = { .addr = addr, .flags = 0, .buf = buf, .len = len }; i2c_writebytes() 85 static int i2c_readbytes(struct nxt200x_state *state, u8 addr, u8 *buf, u8 len) i2c_readbytes() argument 88 struct i2c_msg msg = { .addr = addr, .flags = I2C_M_RD, .buf = buf, .len = len }; i2c_readbytes() 99 const u8 *buf, u8 len) nxt200x_writebytes() 103 struct i2c_msg msg = { .addr = state->config->demod_address, .flags = 0, .buf = buf2, .len = len + 1 }; nxt200x_writebytes() 112 memcpy(&buf2[1], buf, len); nxt200x_writebytes() 122 static int nxt200x_readbytes(struct nxt200x_state *state, u8 reg, u8 *buf, u8 len) nxt200x_readbytes() argument 126 struct i2c_msg msg [] = { { .addr = state->config->demod_address, .flags = 0, .buf = reg2, .len = 1 }, nxt200x_readbytes() 127 { .addr = state->config->demod_address, .flags = I2C_M_RD, .buf = buf, .len = len } }; nxt200x_readbytes() 157 u8 attr, len2, buf; nxt200x_writereg_multibyte() local 169 buf = 0x02; nxt200x_writereg_multibyte() 181 buf = 0x80; nxt200x_writereg_multibyte() 192 nxt200x_writebytes(state, 0x21, &buf, 1); nxt200x_writereg_multibyte() 194 nxt200x_readbytes(state, 0x21, &buf, 1); nxt200x_writereg_multibyte() 198 if ((buf & 0x02) == 0) nxt200x_writereg_multibyte() 202 if (buf == 0) nxt200x_writereg_multibyte() 218 u8 buf, len2, attr; nxt200x_readreg_multibyte() local 248 buf = 0x80; nxt200x_readreg_multibyte() 249 nxt200x_writebytes(state, 0x21, &buf, 1); nxt200x_readreg_multibyte() 265 u8 buf, stopval, counter = 0; nxt200x_microcontroller_stop() local 281 buf = 0x80; nxt200x_microcontroller_stop() 282 nxt200x_writebytes(state, 0x22, &buf, 1); nxt200x_microcontroller_stop() 285 nxt200x_readbytes(state, 0x31, &buf, 1); nxt200x_microcontroller_stop() 286 if (buf & stopval) nxt200x_microcontroller_stop() 299 u8 buf; nxt200x_microcontroller_start() local 302 buf = 0x00; nxt200x_microcontroller_start() 303 nxt200x_writebytes(state, 0x22, &buf, 1); nxt200x_microcontroller_start() 308 u8 buf[9]; nxt2004_microcontroller_init() local 312 buf[0] = 0x00; nxt2004_microcontroller_init() 313 nxt200x_writebytes(state, 0x2b, buf, 1); nxt2004_microcontroller_init() 314 buf[0] = 0x70; nxt2004_microcontroller_init() 315 nxt200x_writebytes(state, 0x34, buf, 1); nxt2004_microcontroller_init() 316 buf[0] = 0x04; nxt2004_microcontroller_init() 317 nxt200x_writebytes(state, 0x35, buf, 1); nxt2004_microcontroller_init() 318 buf[0] = 0x01; buf[1] = 0x23; buf[2] = 0x45; buf[3] = 0x67; buf[4] = 0x89; nxt2004_microcontroller_init() 319 buf[5] = 0xAB; buf[6] = 0xCD; buf[7] = 0xEF; buf[8] = 0xC0; nxt2004_microcontroller_init() 320 nxt200x_writebytes(state, 0x36, buf, 9); nxt2004_microcontroller_init() 321 buf[0] = 0x80; nxt2004_microcontroller_init() 322 nxt200x_writebytes(state, 0x21, buf, 1); nxt2004_microcontroller_init() 325 nxt200x_readbytes(state, 0x21, buf, 1); nxt2004_microcontroller_init() 326 if (buf[0] == 0) nxt2004_microcontroller_init() 339 u8 buf, count = 0; nxt200x_writetuner() local 353 i2c_readbytes(state, data[0], &buf, 1); nxt200x_writetuner() 354 if (buf & 0x40) nxt200x_writetuner() 363 buf = 0x03; nxt200x_writetuner() 364 nxt200x_writebytes(state, 0x20, &buf, 1); nxt200x_writetuner() 367 buf = 0x04; nxt200x_writetuner() 368 nxt200x_writebytes(state, 0x34, &buf, 1); nxt200x_writetuner() 374 buf = data[0] << 1; nxt200x_writetuner() 375 nxt200x_writebytes(state, 0x35, &buf, 1); nxt200x_writetuner() 378 buf = 0x80; nxt200x_writetuner() 379 nxt200x_writebytes(state, 0x21, &buf, 1); nxt200x_writetuner() 382 nxt200x_readbytes(state, 0x21, &buf, 1); nxt200x_writetuner() 383 if ((buf & 0x80)== 0x00) nxt200x_writetuner() 399 u8 buf; nxt200x_agc_reset() local 404 buf = 0x08; nxt200x_agc_reset() 405 nxt200x_writebytes(state, 0x08, &buf, 1); nxt200x_agc_reset() 406 buf = 0x00; nxt200x_agc_reset() 407 nxt200x_writebytes(state, 0x08, &buf, 1); nxt200x_agc_reset() 410 nxt200x_readreg_multibyte(state, 0x08, &buf, 1); nxt200x_agc_reset() 411 buf = 0x08; nxt200x_agc_reset() 412 nxt200x_writereg_multibyte(state, 0x08, &buf, 1); nxt200x_agc_reset() 413 buf = 0x00; nxt200x_agc_reset() 414 nxt200x_writereg_multibyte(state, 0x08, &buf, 1); nxt200x_agc_reset() 426 u8 buf[3], written = 0, chunkpos = 0; nxt2002_load_firmware() local 433 nxt200x_readbytes(state, 0x10, buf, 1); nxt2002_load_firmware() 435 if (buf[0] & 0x10) nxt2002_load_firmware() 443 buf[0] = 0x80; nxt2002_load_firmware() 444 nxt200x_writebytes(state, 0x2B, buf, 1); nxt2002_load_firmware() 450 buf[0] = ((rambase + position) >> 8); nxt2002_load_firmware() 451 buf[1] = (rambase + position) & 0xFF; nxt2002_load_firmware() 452 buf[2] = 0x81; nxt2002_load_firmware() 454 nxt200x_writebytes(state, 0x29, buf, 3); nxt2002_load_firmware() 469 buf[0] = crc << 8; nxt2002_load_firmware() 470 buf[1] = crc & 0xFF; nxt2002_load_firmware() 473 nxt200x_writebytes(state, 0x2C, buf, 2); nxt2002_load_firmware() 476 nxt200x_readbytes(state, 0x2A, buf, 1); nxt2002_load_firmware() 479 buf[0] = 0x80; nxt2002_load_firmware() 480 nxt200x_writebytes(state, 0x2B, buf, 1); nxt2002_load_firmware() 493 u8 buf[3]; nxt2004_load_firmware() local 503 buf[0] = 0x80; nxt2004_load_firmware() 504 nxt200x_writebytes(state, 0x2B, buf,1); nxt2004_load_firmware() 511 buf[0] = rambase >> 8; nxt2004_load_firmware() 512 buf[1] = rambase & 0xFF; nxt2004_load_firmware() 513 buf[2] = 0x81; nxt2004_load_firmware() 515 nxt200x_writebytes(state,0x29,buf,3); nxt2004_load_firmware() 522 buf[0] = crc >> 8; nxt2004_load_firmware() 523 buf[1] = crc & 0xFF; nxt2004_load_firmware() 525 dprintk("firmware crc is 0x%02X 0x%02X\n", buf[0], buf[1]); nxt2004_load_firmware() 528 nxt200x_writebytes(state, 0x2C, buf,2); nxt2004_load_firmware() 531 nxt200x_readbytes(state, 0x2C, buf, 1); nxt2004_load_firmware() 534 buf[0] = 0x80; nxt2004_load_firmware() 535 nxt200x_writebytes(state, 0x2B, buf,1); nxt2004_load_firmware() 544 u8 buf[5]; nxt200x_setup_frontend_parameters() local 551 buf[0] = 0x04; nxt200x_setup_frontend_parameters() 552 nxt200x_writebytes(state, 0x14, buf, 1); nxt200x_setup_frontend_parameters() 553 buf[0] = 0x00; nxt200x_setup_frontend_parameters() 554 nxt200x_writebytes(state, 0x17, buf, 1); nxt200x_setup_frontend_parameters() 578 fe->ops.tuner_ops.calc_regs(fe, buf, 5); nxt200x_setup_frontend_parameters() 581 nxt200x_writetuner(state, buf); nxt200x_setup_frontend_parameters() 591 buf[0] = 0x74; nxt200x_setup_frontend_parameters() 594 buf[0] = 0x70; nxt200x_setup_frontend_parameters() 600 nxt200x_writebytes(state, 0x42, buf, 1); nxt200x_setup_frontend_parameters() 605 buf[0] = 0x87; nxt200x_setup_frontend_parameters() 608 buf[0] = 0x07; nxt200x_setup_frontend_parameters() 614 nxt200x_writebytes(state, 0x57, buf, 1); nxt200x_setup_frontend_parameters() 617 buf[0] = 0x10; nxt200x_setup_frontend_parameters() 618 buf[1] = 0x00; nxt200x_setup_frontend_parameters() 621 nxt200x_writereg_multibyte(state, 0x58, buf, 2); nxt200x_setup_frontend_parameters() 624 nxt200x_writebytes(state, 0x58, buf, 2); nxt200x_setup_frontend_parameters() 634 buf[0] = 0x68; nxt200x_setup_frontend_parameters() 637 buf[0] = 0x64; nxt200x_setup_frontend_parameters() 640 buf[0] = 0x60; nxt200x_setup_frontend_parameters() 646 buf[1] = 0x00; nxt200x_setup_frontend_parameters() 649 nxt200x_writereg_multibyte(state, 0x5C, buf, 2); nxt200x_setup_frontend_parameters() 652 nxt200x_writebytes(state, 0x5C, buf, 2); nxt200x_setup_frontend_parameters() 660 buf[0] = 0x05; nxt200x_setup_frontend_parameters() 661 nxt200x_writebytes(state, 0x43, buf, 1); nxt200x_setup_frontend_parameters() 665 buf[0] = 0x00; nxt200x_setup_frontend_parameters() 666 buf[1] = 0x00; nxt200x_setup_frontend_parameters() 667 nxt200x_writebytes(state, 0x46, buf, 2); nxt200x_setup_frontend_parameters() 671 buf[0] = 0x80; nxt200x_setup_frontend_parameters() 672 buf[1] = 0x00; nxt200x_setup_frontend_parameters() 675 nxt200x_writereg_multibyte(state, 0x4B, buf, 2); nxt200x_setup_frontend_parameters() 678 nxt200x_writebytes(state, 0x4B, buf, 2); nxt200x_setup_frontend_parameters() 686 buf[0] = 0x00; nxt200x_setup_frontend_parameters() 687 nxt200x_writebytes(state, 0x4D, buf, 1); nxt200x_setup_frontend_parameters() 690 buf[0] = 0x44; nxt200x_setup_frontend_parameters() 691 nxt200x_writebytes(state, 0x55, buf, 1); nxt200x_setup_frontend_parameters() 694 buf[0] = 0x04; nxt200x_setup_frontend_parameters() 695 nxt200x_writebytes(state, 0x41, buf, 1); nxt200x_setup_frontend_parameters() 698 nxt200x_readreg_multibyte(state, 0x80, buf, 1); nxt200x_setup_frontend_parameters() 699 buf[0] = 0x24; nxt200x_setup_frontend_parameters() 700 nxt200x_writereg_multibyte(state, 0x80, buf, 1); nxt200x_setup_frontend_parameters() 703 nxt200x_readreg_multibyte(state, 0x08, buf, 1); nxt200x_setup_frontend_parameters() 704 buf[0] = 0x10; nxt200x_setup_frontend_parameters() 705 nxt200x_writereg_multibyte(state, 0x08, buf, 1); nxt200x_setup_frontend_parameters() 706 nxt200x_readreg_multibyte(state, 0x08, buf, 1); nxt200x_setup_frontend_parameters() 707 buf[0] = 0x00; nxt200x_setup_frontend_parameters() 708 nxt200x_writereg_multibyte(state, 0x08, buf, 1); nxt200x_setup_frontend_parameters() 710 nxt200x_readreg_multibyte(state, 0x80, buf, 1); nxt200x_setup_frontend_parameters() 711 buf[0] = 0x04; nxt200x_setup_frontend_parameters() 712 nxt200x_writereg_multibyte(state, 0x80, buf, 1); nxt200x_setup_frontend_parameters() 713 buf[0] = 0x00; nxt200x_setup_frontend_parameters() 714 nxt200x_writereg_multibyte(state, 0x81, buf, 1); nxt200x_setup_frontend_parameters() 715 buf[0] = 0x80; buf[1] = 0x00; buf[2] = 0x00; nxt200x_setup_frontend_parameters() 716 nxt200x_writereg_multibyte(state, 0x82, buf, 3); nxt200x_setup_frontend_parameters() 717 nxt200x_readreg_multibyte(state, 0x88, buf, 1); nxt200x_setup_frontend_parameters() 718 buf[0] = 0x11; nxt200x_setup_frontend_parameters() 719 nxt200x_writereg_multibyte(state, 0x88, buf, 1); nxt200x_setup_frontend_parameters() 720 nxt200x_readreg_multibyte(state, 0x80, buf, 1); nxt200x_setup_frontend_parameters() 721 buf[0] = 0x44; nxt200x_setup_frontend_parameters() 722 nxt200x_writereg_multibyte(state, 0x80, buf, 1); nxt200x_setup_frontend_parameters() 728 buf[0] = 0x02; nxt200x_setup_frontend_parameters() 731 buf[0] = 0x03; nxt200x_setup_frontend_parameters() 734 buf[0] = 0x00; nxt200x_setup_frontend_parameters() 740 nxt200x_writebytes(state, 0x30, buf, 1); nxt200x_setup_frontend_parameters() 743 buf[0] = 0x00; nxt200x_setup_frontend_parameters() 744 nxt200x_writebytes(state, 0x41, buf, 1); nxt200x_setup_frontend_parameters() 747 buf[0] = 0x80; nxt200x_setup_frontend_parameters() 748 buf[1] = 0x00; nxt200x_setup_frontend_parameters() 751 nxt200x_writereg_multibyte(state, 0x49, buf, 2); nxt200x_setup_frontend_parameters() 752 nxt200x_writereg_multibyte(state, 0x4B, buf, 2); nxt200x_setup_frontend_parameters() 755 nxt200x_writebytes(state, 0x49, buf, 2); nxt200x_setup_frontend_parameters() 756 nxt200x_writebytes(state, 0x4B, buf, 2); nxt200x_setup_frontend_parameters() 764 buf[0] = 0x04; nxt200x_setup_frontend_parameters() 765 nxt200x_writebytes(state, 0x41, buf, 1); nxt200x_setup_frontend_parameters() 773 buf[0] = 0xF0; nxt200x_setup_frontend_parameters() 774 buf[1] = 0x00; nxt200x_setup_frontend_parameters() 775 nxt200x_writebytes(state, 0x5C, buf, 2); nxt200x_setup_frontend_parameters() 887 u8 buf[2]; nxt2002_init() local 913 buf[0]=0x00; nxt2002_init() 914 nxt200x_writebytes(state, 0x2B, buf, 1); nxt2002_init() 920 buf[0] = 0x0F; nxt2002_init() 921 nxt200x_writebytes(state, 0x08, buf, 1); nxt2002_init() 922 buf[0] = 0x00; nxt2002_init() 923 nxt200x_writebytes(state, 0x08, buf, 1); nxt2002_init() 926 buf[0] = 0xF1; nxt2002_init() 927 nxt200x_writebytes(state, 0x57, buf, 1); nxt2002_init() 930 buf[0] = 0x20; nxt2002_init() 931 nxt200x_writebytes(state, 0x09, buf, 1); nxt2002_init() 934 buf[0] = 0x7E; nxt2002_init() 935 buf[1] = 0x00; nxt2002_init() 936 nxt200x_writebytes(state, 0xE9, buf, 2); nxt2002_init() 939 buf[0] = 0x00; nxt2002_init() 940 nxt200x_writebytes(state, 0xCC, buf, 1); nxt2002_init() 950 u8 buf[3]; nxt2004_init() local 953 buf[0]=0x00; nxt2004_init() 954 nxt200x_writebytes(state, 0x1E, buf, 1); nxt2004_init() 977 buf[0] = 0x01; nxt2004_init() 978 nxt200x_writebytes(state, 0x19, buf, 1); nxt2004_init() 987 buf[0] = 0xFF; nxt2004_init() 988 nxt200x_writereg_multibyte(state, 0x08, buf, 1); nxt2004_init() 989 buf[0] = 0x00; nxt2004_init() 990 nxt200x_writereg_multibyte(state, 0x08, buf, 1); nxt2004_init() 993 buf[0] = 0xD7; nxt2004_init() 994 nxt200x_writebytes(state, 0x57, buf, 1); nxt2004_init() 997 buf[0] = 0x07; nxt2004_init() 998 buf[1] = 0xfe; nxt2004_init() 999 nxt200x_writebytes(state, 0x35, buf, 2); nxt2004_init() 1000 buf[0] = 0x12; nxt2004_init() 1001 nxt200x_writebytes(state, 0x34, buf, 1); nxt2004_init() 1002 buf[0] = 0x80; nxt2004_init() 1003 nxt200x_writebytes(state, 0x21, buf, 1); nxt2004_init() 1006 buf[0] = 0x21; nxt2004_init() 1007 nxt200x_writebytes(state, 0x0A, buf, 1); nxt2004_init() 1010 buf[0] = 0x01; nxt2004_init() 1011 nxt200x_writereg_multibyte(state, 0x80, buf, 1); nxt2004_init() 1014 buf[0] = 0x7E; nxt2004_init() 1015 buf[1] = 0x00; nxt2004_init() 1016 nxt200x_writebytes(state, 0xE9, buf, 2); nxt2004_init() 1019 buf[0] = 0x00; nxt2004_init() 1020 nxt200x_writebytes(state, 0xCC, buf, 1); nxt2004_init() 1023 nxt200x_readreg_multibyte(state, 0x80, buf, 1); nxt2004_init() 1024 buf[0] = 0x00; nxt2004_init() 1025 nxt200x_writereg_multibyte(state, 0x80, buf, 1); nxt2004_init() 1028 nxt200x_readreg_multibyte(state, 0x08, buf, 1); nxt2004_init() 1029 buf[0] = 0x10; nxt2004_init() 1030 nxt200x_writereg_multibyte(state, 0x08, buf, 1); nxt2004_init() 1031 nxt200x_readreg_multibyte(state, 0x08, buf, 1); nxt2004_init() 1032 buf[0] = 0x00; nxt2004_init() 1033 nxt200x_writereg_multibyte(state, 0x08, buf, 1); nxt2004_init() 1036 nxt200x_readreg_multibyte(state, 0x80, buf, 1); nxt2004_init() 1037 buf[0] = 0x01; nxt2004_init() 1038 nxt200x_writereg_multibyte(state, 0x80, buf, 1); nxt2004_init() 1039 buf[0] = 0x70; nxt2004_init() 1040 nxt200x_writereg_multibyte(state, 0x81, buf, 1); nxt2004_init() 1041 buf[0] = 0x31; buf[1] = 0x5E; buf[2] = 0x66; nxt2004_init() 1042 nxt200x_writereg_multibyte(state, 0x82, buf, 3); nxt2004_init() 1044 nxt200x_readreg_multibyte(state, 0x88, buf, 1); nxt2004_init() 1045 buf[0] = 0x11; nxt2004_init() 1046 nxt200x_writereg_multibyte(state, 0x88, buf, 1); nxt2004_init() 1047 nxt200x_readreg_multibyte(state, 0x80, buf, 1); nxt2004_init() 1048 buf[0] = 0x40; nxt2004_init() 1049 nxt200x_writereg_multibyte(state, 0x80, buf, 1); nxt2004_init() 1051 nxt200x_readbytes(state, 0x10, buf, 1); nxt2004_init() 1052 buf[0] = 0x10; nxt2004_init() 1053 nxt200x_writebytes(state, 0x10, buf, 1); nxt2004_init() 1054 nxt200x_readbytes(state, 0x0A, buf, 1); nxt2004_init() 1055 buf[0] = 0x21; nxt2004_init() 1056 nxt200x_writebytes(state, 0x0A, buf, 1); nxt2004_init() 1060 buf[0] = 0x21; nxt2004_init() 1061 nxt200x_writebytes(state, 0x0A, buf, 1); nxt2004_init() 1062 buf[0] = 0x7E; nxt2004_init() 1063 nxt200x_writebytes(state, 0xE9, buf, 1); nxt2004_init() 1064 buf[0] = 0x00; nxt2004_init() 1065 nxt200x_writebytes(state, 0xEA, buf, 1); nxt2004_init() 1067 nxt200x_readreg_multibyte(state, 0x80, buf, 1); nxt2004_init() 1068 buf[0] = 0x00; nxt2004_init() 1069 nxt200x_writereg_multibyte(state, 0x80, buf, 1); nxt2004_init() 1070 nxt200x_readreg_multibyte(state, 0x80, buf, 1); nxt2004_init() 1071 buf[0] = 0x00; nxt2004_init() 1072 nxt200x_writereg_multibyte(state, 0x80, buf, 1); nxt2004_init() 1075 nxt200x_readreg_multibyte(state, 0x08, buf, 1); nxt2004_init() 1076 buf[0] = 0x10; nxt2004_init() 1077 nxt200x_writereg_multibyte(state, 0x08, buf, 1); nxt2004_init() 1078 nxt200x_readreg_multibyte(state, 0x08, buf, 1); nxt2004_init() 1079 buf[0] = 0x00; nxt2004_init() 1080 nxt200x_writereg_multibyte(state, 0x08, buf, 1); nxt2004_init() 1082 nxt200x_readreg_multibyte(state, 0x80, buf, 1); nxt2004_init() 1083 buf[0] = 0x04; nxt2004_init() 1084 nxt200x_writereg_multibyte(state, 0x80, buf, 1); nxt2004_init() 1085 buf[0] = 0x00; nxt2004_init() 1086 nxt200x_writereg_multibyte(state, 0x81, buf, 1); nxt2004_init() 1087 buf[0] = 0x80; buf[1] = 0x00; buf[2] = 0x00; nxt2004_init() 1088 nxt200x_writereg_multibyte(state, 0x82, buf, 3); nxt2004_init() 1090 nxt200x_readreg_multibyte(state, 0x88, buf, 1); nxt2004_init() 1091 buf[0] = 0x11; nxt2004_init() 1092 nxt200x_writereg_multibyte(state, 0x88, buf, 1); nxt2004_init() 1094 nxt200x_readreg_multibyte(state, 0x80, buf, 1); nxt2004_init() 1095 buf[0] = 0x44; nxt2004_init() 1096 nxt200x_writereg_multibyte(state, 0x80, buf, 1); nxt2004_init() 1099 nxt200x_readbytes(state, 0x10, buf, 1); nxt2004_init() 1100 buf[0] = 0x12; nxt2004_init() 1101 nxt200x_writebytes(state, 0x10, buf, 1); nxt2004_init() 1102 buf[0] = 0x04; nxt2004_init() 1103 nxt200x_writebytes(state, 0x13, buf, 1); nxt2004_init() 1104 buf[0] = 0x00; nxt2004_init() 1105 nxt200x_writebytes(state, 0x16, buf, 1); nxt2004_init() 1106 buf[0] = 0x04; nxt2004_init() 1107 nxt200x_writebytes(state, 0x14, buf, 1); nxt2004_init() 1108 buf[0] = 0x00; nxt2004_init() 1109 nxt200x_writebytes(state, 0x14, buf, 1); nxt2004_init() 1110 nxt200x_writebytes(state, 0x17, buf, 1); nxt2004_init() 1111 nxt200x_writebytes(state, 0x14, buf, 1); nxt2004_init() 1112 nxt200x_writebytes(state, 0x17, buf, 1); nxt2004_init() 1159 u8 buf [] = {0,0,0,0,0}; nxt200x_attach() local 1172 nxt200x_readbytes(state, 0x00, buf, 5); nxt200x_attach() 1173 dprintk("NXT info: %*ph\n", 5, buf); nxt200x_attach() 1176 switch (buf[0]) { nxt200x_attach() 1192 if (buf[0] != 0x04) goto error; /* device id */ nxt200x_attach() 1193 if (buf[1] != 0x02) goto error; /* fab id */ nxt200x_attach() 1194 if (buf[2] != 0x11) goto error; /* month */ nxt200x_attach() 1195 if (buf[3] != 0x20) goto error; /* year msb */ nxt200x_attach() 1196 if (buf[4] != 0x00) goto error; /* year lsb */ nxt200x_attach() 1199 if (buf[0] != 0x05) goto error; /* device id */ nxt200x_attach() 1212 pr_err("Unknown/Unsupported NXT chip: %*ph\n", 5, buf); nxt200x_attach() 98 nxt200x_writebytes(struct nxt200x_state* state, u8 reg, const u8 *buf, u8 len) nxt200x_writebytes() argument
|
H A D | stb6000.c | 55 u8 buf[] = { 10, 0 }; stb6000_sleep() local 59 .buf = buf, stb6000_sleep() 86 u8 buf[12]; stb6000_set_params() local 90 .buf = buf, stb6000_set_params() 103 buf[0] = 0x01; stb6000_set_params() 104 buf[1] = 0xac; stb6000_set_params() 106 buf[1] = 0xaa; stb6000_set_params() 108 buf[1] = 0xa8; stb6000_set_params() 110 buf[1] = 0xa6; stb6000_set_params() 112 buf[1] = 0xa5; stb6000_set_params() 114 buf[1] = 0xa4; stb6000_set_params() 116 buf[1] = 0xa2; stb6000_set_params() 118 buf[1] = 0xa1; stb6000_set_params() 120 buf[1] = 0xa0; stb6000_set_params() 122 buf[1] = 0xbc; stb6000_set_params() 124 buf[1] = 0xba; stb6000_set_params() 132 buf[2] = n >> 1; stb6000_set_params() 133 buf[3] = (unsigned char)(((n & 1) << 7) | stb6000_set_params() 135 buf[4] = 0x04; stb6000_set_params() 136 buf[5] = 0x0e; stb6000_set_params() 138 buf[6] = (unsigned char)(bandwidth); stb6000_set_params() 140 buf[7] = 0xd8; stb6000_set_params() 141 buf[8] = 0xd0; stb6000_set_params() 142 buf[9] = 0x50; stb6000_set_params() 143 buf[10] = 0xeb; stb6000_set_params() 144 buf[11] = 0x4f; stb6000_set_params() 157 buf[0] = 0x07; stb6000_set_params() 158 buf[1] = 0xdf; stb6000_set_params() 159 buf[2] = 0xd0; stb6000_set_params() 160 buf[3] = 0x50; stb6000_set_params() 161 buf[4] = 0xfb; stb6000_set_params() 211 .buf = b0, stb6000_attach() 216 .buf = b1, stb6000_attach()
|
H A D | cxd2820r_t.c | 31 u8 buf[3], bw_param; cxd2820r_set_frontend_t() local 107 buf[0] = ((if_ctl >> 16) & 0xff); cxd2820r_set_frontend_t() 108 buf[1] = ((if_ctl >> 8) & 0xff); cxd2820r_set_frontend_t() 109 buf[2] = ((if_ctl >> 0) & 0xff); cxd2820r_set_frontend_t() 111 ret = cxd2820r_wr_regs(priv, 0x000b6, buf, 3); cxd2820r_set_frontend_t() 146 u8 buf[2]; cxd2820r_get_frontend_t() local 148 ret = cxd2820r_rd_regs(priv, 0x0002f, buf, sizeof(buf)); cxd2820r_get_frontend_t() 152 switch ((buf[0] >> 6) & 0x03) { cxd2820r_get_frontend_t() 164 switch ((buf[1] >> 1) & 0x03) { cxd2820r_get_frontend_t() 173 switch ((buf[1] >> 3) & 0x03) { cxd2820r_get_frontend_t() 188 switch ((buf[0] >> 3) & 0x07) { cxd2820r_get_frontend_t() 203 switch ((buf[0] >> 0) & 0x07) { cxd2820r_get_frontend_t() 221 switch ((buf[1] >> 5) & 0x07) { cxd2820r_get_frontend_t() 239 ret = cxd2820r_rd_reg(priv, 0x007c6, &buf[0]); cxd2820r_get_frontend_t() 243 switch ((buf[0] >> 0) & 0x01) { cxd2820r_get_frontend_t() 262 u8 buf[3], start_ber = 0; cxd2820r_read_ber_t() local 266 ret = cxd2820r_rd_regs(priv, 0x00076, buf, sizeof(buf)); cxd2820r_read_ber_t() 270 if ((buf[2] >> 7) & 0x01 || (buf[2] >> 4) & 0x01) { cxd2820r_read_ber_t() 271 *ber = (buf[2] & 0x0f) << 16 | buf[1] << 8 | buf[0]; cxd2820r_read_ber_t() 297 u8 buf[2]; cxd2820r_read_signal_strength_t() local 300 ret = cxd2820r_rd_regs(priv, 0x00026, buf, sizeof(buf)); cxd2820r_read_signal_strength_t() 304 tmp = (buf[0] & 0x0f) << 8 | buf[1]; cxd2820r_read_signal_strength_t() 320 u8 buf[2]; cxd2820r_read_snr_t() local 324 ret = cxd2820r_rd_regs(priv, 0x00028, buf, sizeof(buf)); cxd2820r_read_snr_t() 328 tmp = (buf[0] & 0x1f) << 8 | buf[1]; cxd2820r_read_snr_t() 356 u8 buf[4]; cxd2820r_read_status_t() local 359 ret = cxd2820r_rd_reg(priv, 0x00010, &buf[0]); cxd2820r_read_status_t() 363 if ((buf[0] & 0x07) == 6) { cxd2820r_read_status_t() 364 ret = cxd2820r_rd_reg(priv, 0x00073, &buf[1]); cxd2820r_read_status_t() 368 if (((buf[1] >> 3) & 0x01) == 1) { cxd2820r_read_status_t() 376 ret = cxd2820r_rd_reg(priv, 0x00014, &buf[2]); cxd2820r_read_status_t() 380 if ((buf[2] & 0x0f) >= 4) { cxd2820r_read_status_t() 381 ret = cxd2820r_rd_reg(priv, 0x00a14, &buf[3]); cxd2820r_read_status_t() 385 if (((buf[3] >> 4) & 0x01) == 1) cxd2820r_read_status_t() 390 dev_dbg(&priv->i2c->dev, "%s: lock=%*ph\n", __func__, 4, buf); cxd2820r_read_status_t()
|
H A D | cxd2820r_t2.c | 31 u8 buf[3], bw_param; cxd2820r_set_frontend_t2() local 124 buf[0] = ((if_ctl >> 16) & 0xff); cxd2820r_set_frontend_t2() 125 buf[1] = ((if_ctl >> 8) & 0xff); cxd2820r_set_frontend_t2() 126 buf[2] = ((if_ctl >> 0) & 0xff); cxd2820r_set_frontend_t2() 145 ret = cxd2820r_wr_regs(priv, 0x020b6, buf, 3); cxd2820r_set_frontend_t2() 177 u8 buf[2]; cxd2820r_get_frontend_t2() local 179 ret = cxd2820r_rd_regs(priv, 0x0205c, buf, 2); cxd2820r_get_frontend_t2() 183 switch ((buf[0] >> 0) & 0x07) { cxd2820r_get_frontend_t2() 204 switch ((buf[1] >> 4) & 0x07) { cxd2820r_get_frontend_t2() 228 ret = cxd2820r_rd_regs(priv, 0x0225b, buf, 2); cxd2820r_get_frontend_t2() 232 switch ((buf[0] >> 0) & 0x07) { cxd2820r_get_frontend_t2() 253 switch ((buf[1] >> 0) & 0x07) { cxd2820r_get_frontend_t2() 268 ret = cxd2820r_rd_reg(priv, 0x020b5, &buf[0]); cxd2820r_get_frontend_t2() 272 switch ((buf[0] >> 4) & 0x01) { cxd2820r_get_frontend_t2() 291 u8 buf[1]; cxd2820r_read_status_t2() local 294 ret = cxd2820r_rd_reg(priv, 0x02010 , &buf[0]); cxd2820r_read_status_t2() 298 if ((buf[0] & 0x07) == 6) { cxd2820r_read_status_t2() 299 if (((buf[0] >> 5) & 0x01) == 1) { cxd2820r_read_status_t2() 308 dev_dbg(&priv->i2c->dev, "%s: lock=%02x\n", __func__, buf[0]); cxd2820r_read_status_t2() 320 u8 buf[4]; cxd2820r_read_ber_t2() local 325 ret = cxd2820r_rd_regs(priv, 0x02039, buf, sizeof(buf)); cxd2820r_read_ber_t2() 329 if ((buf[0] >> 4) & 0x01) { cxd2820r_read_ber_t2() 330 errbits = (buf[0] & 0x0f) << 24 | buf[1] << 16 | cxd2820r_read_ber_t2() 331 buf[2] << 8 | buf[3]; cxd2820r_read_ber_t2() 348 u8 buf[2]; cxd2820r_read_signal_strength_t2() local 351 ret = cxd2820r_rd_regs(priv, 0x02026, buf, sizeof(buf)); cxd2820r_read_signal_strength_t2() 355 tmp = (buf[0] & 0x0f) << 8 | buf[1]; cxd2820r_read_signal_strength_t2() 371 u8 buf[2]; cxd2820r_read_snr_t2() local 375 ret = cxd2820r_rd_regs(priv, 0x02028, buf, sizeof(buf)); cxd2820r_read_snr_t2() 379 tmp = (buf[0] & 0x0f) << 8 | buf[1]; cxd2820r_read_snr_t2()
|
H A D | tda826x.c | 55 u8 buf [] = { 0x00, 0x8d }; tda826x_sleep() local 56 struct i2c_msg msg = { .addr = priv->i2c_address, .flags = 0, .buf = buf, .len = 2 }; tda826x_sleep() 61 buf[1] = 0xad; tda826x_sleep() 82 u8 buf [11]; tda826x_set_params() local 83 struct i2c_msg msg = { .addr = priv->i2c_address, .flags = 0, .buf = buf, .len = 11 }; tda826x_set_params() 98 buf[0] = 0x00; // subaddress tda826x_set_params() 99 buf[1] = 0x09; // powerdown RSSI + the magic value 1 tda826x_set_params() 101 buf[1] |= 0x20; // power down loopthrough if not needed tda826x_set_params() 102 buf[2] = (1<<5) | 0x0b; // 1Mhz + 0.45 VCO tda826x_set_params() 103 buf[3] = div >> 7; tda826x_set_params() 104 buf[4] = div << 1; tda826x_set_params() 105 buf[5] = ((bandwidth - 5) << 3) | 7; /* baseband cut-off */ tda826x_set_params() 106 buf[6] = 0xfe; // baseband gain 9 db + no RF attenuation tda826x_set_params() 107 buf[7] = 0x83; // charge pumps at high, tests off tda826x_set_params() 108 buf[8] = 0x80; // recommended value 4 for AMPVCO + disable ports. tda826x_set_params() 109 buf[9] = 0x1a; // normal caltime + recommended values for SELTH + SELVTL tda826x_set_params() 110 buf[10] = 0xd4; // recommended value 13 for BBIAS + unknown bit set on tda826x_set_params() 149 { .addr = addr, .flags = 0, .buf = NULL, .len = 0 }, tda826x_attach() 150 { .addr = addr, .flags = I2C_M_RD, .buf = b1, .len = 2 } tda826x_attach()
|
/linux-4.4.14/drivers/macintosh/ |
H A D | macio_sysfs.c | 9 char *buf) \ 12 return sprintf (buf, format_string, mdev->ofdev.dev.of_node->field); \ 16 compatible_show (struct device *dev, struct device_attribute *attr, char *buf) compatible_show() argument 26 *buf = '\0'; compatible_show() 31 length += sprintf (buf, "%s\n", compat); compatible_show() 32 buf += length; compatible_show() 42 char *buf) modalias_show() 44 int len = of_device_get_modalias(dev, buf, PAGE_SIZE - 2); modalias_show() 46 buf[len] = '\n'; modalias_show() 47 buf[len+1] = 0; modalias_show() 53 struct device_attribute *attr, char *buf) devspec_show() 58 return sprintf(buf, "%s\n", ofdev->dev.of_node->full_name); devspec_show() 41 modalias_show(struct device *dev, struct device_attribute *attr, char *buf) modalias_show() argument 52 devspec_show(struct device *dev, struct device_attribute *attr, char *buf) devspec_show() argument
|
/linux-4.4.14/tools/perf/arch/arm/tests/ |
H A D | dwarf-unwind.c | 17 u64 stack_size, *buf; sample_ustack() local 19 buf = malloc(STACK_SIZE); sample_ustack() 20 if (!buf) { sample_ustack() 30 free(buf); sample_ustack() 37 memcpy(buf, (void *) sp, stack_size); sample_ustack() 38 stack->data = (char *) buf; sample_ustack() 47 u64 *buf; test__arch_unwind_sample() local 49 buf = calloc(1, sizeof(u64) * PERF_REGS_MAX); test__arch_unwind_sample() 50 if (!buf) { test__arch_unwind_sample() 55 perf_regs_load(buf); test__arch_unwind_sample() 57 regs->regs = buf; test__arch_unwind_sample() 60 return sample_ustack(sample, thread, buf); test__arch_unwind_sample()
|
/linux-4.4.14/tools/perf/arch/arm64/tests/ |
H A D | dwarf-unwind.c | 17 u64 stack_size, *buf; sample_ustack() local 19 buf = malloc(STACK_SIZE); sample_ustack() 20 if (!buf) { sample_ustack() 30 free(buf); sample_ustack() 37 memcpy(buf, (void *) sp, stack_size); sample_ustack() 38 stack->data = (char *) buf; sample_ustack() 47 u64 *buf; test__arch_unwind_sample() local 49 buf = calloc(1, sizeof(u64) * PERF_REGS_MAX); test__arch_unwind_sample() 50 if (!buf) { test__arch_unwind_sample() 55 perf_regs_load(buf); test__arch_unwind_sample() 57 regs->regs = buf; test__arch_unwind_sample() 60 return sample_ustack(sample, thread, buf); test__arch_unwind_sample()
|
/linux-4.4.14/tools/perf/arch/x86/tests/ |
H A D | dwarf-unwind.c | 18 u64 stack_size, *buf; sample_ustack() local 20 buf = malloc(STACK_SIZE); sample_ustack() 21 if (!buf) { sample_ustack() 31 free(buf); sample_ustack() 38 memcpy(buf, (void *) sp, stack_size); sample_ustack() 39 stack->data = (char *) buf; sample_ustack() 48 u64 *buf; test__arch_unwind_sample() local 50 buf = malloc(sizeof(u64) * PERF_REGS_MAX); test__arch_unwind_sample() 51 if (!buf) { test__arch_unwind_sample() 56 perf_regs_load(buf); test__arch_unwind_sample() 58 regs->regs = buf; test__arch_unwind_sample() 61 return sample_ustack(sample, thread, buf); test__arch_unwind_sample()
|
/linux-4.4.14/drivers/pci/ |
H A D | vpd.c | 11 int pci_vpd_find_tag(const u8 *buf, unsigned int off, unsigned int len, u8 rdt) pci_vpd_find_tag() argument 16 u8 val = buf[i]; pci_vpd_find_tag() 27 pci_vpd_lrdt_size(&buf[i]); pci_vpd_find_tag() 38 pci_vpd_srdt_size(&buf[i]); pci_vpd_find_tag() 46 int pci_vpd_find_info_keyword(const u8 *buf, unsigned int off, pci_vpd_find_info_keyword() argument 52 if (buf[i + 0] == kw[0] && pci_vpd_find_info_keyword() 53 buf[i + 1] == kw[1]) pci_vpd_find_info_keyword() 57 pci_vpd_info_field_size(&buf[i]); pci_vpd_find_info_keyword()
|
H A D | syscall.c | 17 unsigned long, off, unsigned long, len, void __user *, buf) SYSCALL_DEFINE5() 55 err = put_user(byte, (unsigned char __user *)buf); SYSCALL_DEFINE5() 58 err = put_user(word, (unsigned short __user *)buf); SYSCALL_DEFINE5() 61 err = put_user(dword, (unsigned int __user *)buf); SYSCALL_DEFINE5() 73 put_user(-1, (unsigned char __user *)buf); SYSCALL_DEFINE5() 76 put_user(-1, (unsigned short __user *)buf); SYSCALL_DEFINE5() 79 put_user(-1, (unsigned int __user *)buf); SYSCALL_DEFINE5() 87 unsigned long, off, unsigned long, len, void __user *, buf) SYSCALL_DEFINE5() 104 err = get_user(byte, (u8 __user *)buf); SYSCALL_DEFINE5() 113 err = get_user(word, (u16 __user *)buf); SYSCALL_DEFINE5() 122 err = get_user(dword, (u32 __user *)buf); SYSCALL_DEFINE5()
|
/linux-4.4.14/arch/mips/include/asm/ |
H A D | uasm.h | 53 void ISAOPC(op)(u32 **buf, unsigned int a, unsigned int b, unsigned int c) 56 void ISAOPC(op)(u32 **buf, unsigned int a, unsigned int b, unsigned int c) 59 void ISAOPC(op)(u32 **buf, unsigned int a, unsigned int b, unsigned int c) 62 void ISAOPC(op)(u32 **buf, unsigned int a, unsigned int b, unsigned int c) 65 void ISAOPC(op)(u32 **buf, unsigned int a, unsigned int b, signed int c) 68 void ISAOPC(op)(u32 **buf, unsigned int a, signed int b, unsigned int c) 71 void ISAOPC(op)(u32 **buf, int a, int b, int c) 74 void ISAOPC(op)(u32 **buf, unsigned int a, unsigned int b, signed int c) 77 void ISAOPC(op)(u32 **buf, unsigned int a, unsigned int b, unsigned int c, \ 81 void ISAOPC(op)(u32 **buf, unsigned int a, unsigned int b) 84 void ISAOPC(op)(u32 **buf, unsigned int a, unsigned int b) 87 void ISAOPC(op)(u32 **buf, unsigned int a, signed int b) 89 #define Ip_u1(op) void ISAOPC(op)(u32 **buf, unsigned int a) 91 #define Ip_0(op) void ISAOPC(op)(u32 **buf) 189 void ISAFUNC(UASM_i_LA_mostly)(u32 **buf, unsigned int rs, long addr); 190 void ISAFUNC(UASM_i_LA)(u32 **buf, unsigned int rs, long addr); 200 # define UASM_i_ADDIU(buf, rs, rt, val) uasm_i_daddiu(buf, rs, rt, val) 201 # define UASM_i_ADDU(buf, rs, rt, rd) uasm_i_daddu(buf, rs, rt, rd) 202 # define UASM_i_LL(buf, rs, rt, off) uasm_i_lld(buf, rs, rt, off) 203 # define UASM_i_LW(buf, rs, rt, off) uasm_i_ld(buf, rs, rt, off) 204 # define UASM_i_LWX(buf, rs, rt, rd) uasm_i_ldx(buf, rs, rt, rd) 205 # define UASM_i_MFC0(buf, rt, rd...) uasm_i_dmfc0(buf, rt, rd) 206 # define UASM_i_MTC0(buf, rt, rd...) uasm_i_dmtc0(buf, rt, rd) 207 # define UASM_i_ROTR(buf, rs, rt, sh) uasm_i_drotr(buf, rs, rt, sh) 208 # define UASM_i_SC(buf, rs, rt, off) uasm_i_scd(buf, rs, rt, off) 209 # define UASM_i_SLL(buf, rs, rt, sh) uasm_i_dsll(buf, rs, rt, sh) 210 # define UASM_i_SRA(buf, rs, rt, sh) uasm_i_dsra(buf, rs, rt, sh) 211 # define UASM_i_SRL(buf, rs, rt, sh) uasm_i_dsrl(buf, rs, rt, sh) 212 # define UASM_i_SRL_SAFE(buf, rs, rt, sh) uasm_i_dsrl_safe(buf, rs, rt, sh) 213 # define UASM_i_SUBU(buf, rs, rt, rd) uasm_i_dsubu(buf, rs, rt, rd) 214 # define UASM_i_SW(buf, rs, rt, off) uasm_i_sd(buf, rs, rt, off) 216 # define UASM_i_ADDIU(buf, rs, rt, val) uasm_i_addiu(buf, rs, rt, val) 217 # define UASM_i_ADDU(buf, rs, rt, rd) uasm_i_addu(buf, rs, rt, rd) 218 # define UASM_i_LL(buf, rs, rt, off) uasm_i_ll(buf, rs, rt, off) 219 # define UASM_i_LW(buf, rs, rt, off) uasm_i_lw(buf, rs, rt, off) 220 # define UASM_i_LWX(buf, rs, rt, rd) uasm_i_lwx(buf, rs, rt, rd) 221 # define UASM_i_MFC0(buf, rt, rd...) uasm_i_mfc0(buf, rt, rd) 222 # define UASM_i_MTC0(buf, rt, rd...) uasm_i_mtc0(buf, rt, rd) 223 # define UASM_i_ROTR(buf, rs, rt, sh) uasm_i_rotr(buf, rs, rt, sh) 224 # define UASM_i_SC(buf, rs, rt, off) uasm_i_sc(buf, rs, rt, off) 225 # define UASM_i_SLL(buf, rs, rt, sh) uasm_i_sll(buf, rs, rt, sh) 226 # define UASM_i_SRA(buf, rs, rt, sh) uasm_i_sra(buf, rs, rt, sh) 227 # define UASM_i_SRL(buf, rs, rt, sh) uasm_i_srl(buf, rs, rt, sh) 228 # define UASM_i_SRL_SAFE(buf, rs, rt, sh) uasm_i_srl(buf, rs, rt, sh) 229 # define UASM_i_SUBU(buf, rs, rt, rd) uasm_i_subu(buf, rs, rt, rd) 230 # define UASM_i_SW(buf, rs, rt, off) uasm_i_sw(buf, rs, rt, off) 233 #define uasm_i_b(buf, off) uasm_i_beq(buf, 0, 0, off) 234 #define uasm_i_beqz(buf, rs, off) uasm_i_beq(buf, rs, 0, off) 235 #define uasm_i_beqzl(buf, rs, off) uasm_i_beql(buf, rs, 0, off) 236 #define uasm_i_bnez(buf, rs, off) uasm_i_bne(buf, rs, 0, off) 237 #define uasm_i_bnezl(buf, rs, off) uasm_i_bnel(buf, rs, 0, off) 238 #define uasm_i_ehb(buf) uasm_i_sll(buf, 0, 0, 3) 239 #define uasm_i_move(buf, a, b) UASM_i_ADDU(buf, a, 0, b) 240 #define uasm_i_nop(buf) uasm_i_sll(buf, 0, 0, 0) 241 #define uasm_i_ssnop(buf) uasm_i_sll(buf, 0, 0, 1)
|
/linux-4.4.14/net/mac80211/ |
H A D | debugfs_sta.c | 57 char buf[121]; sta_flags_read() local 63 int res = scnprintf(buf, sizeof(buf), sta_flags_read() 78 return simple_read_from_buffer(userbuf, count, ppos, buf, res); sta_flags_read() 87 char buf[17*IEEE80211_NUM_ACS], *p = buf; sta_num_ps_buf_frames_read() local 91 p += scnprintf(p, sizeof(buf)+buf-p, "AC%d: %d\n", ac, sta_num_ps_buf_frames_read() 94 return simple_read_from_buffer(userbuf, count, ppos, buf, p - buf); sta_num_ps_buf_frames_read() 101 char buf[15*IEEE80211_NUM_TIDS], *p = buf; sta_last_seq_ctrl_read() local 105 p += scnprintf(p, sizeof(buf)+buf-p, "%x ", sta_last_seq_ctrl_read() 107 p += scnprintf(p, sizeof(buf)+buf-p, "\n"); sta_last_seq_ctrl_read() 108 return simple_read_from_buffer(userbuf, count, ppos, buf, p - buf); sta_last_seq_ctrl_read() 115 char buf[71 + IEEE80211_NUM_TIDS * 40], *p = buf; sta_agg_status_read() local 123 p += scnprintf(p, sizeof(buf) + buf - p, "next dialog_token: %#02x\n", sta_agg_status_read() 125 p += scnprintf(p, sizeof(buf) + buf - p, sta_agg_status_read() 132 p += scnprintf(p, sizeof(buf) + buf - p, "%02d", i); sta_agg_status_read() 133 p += scnprintf(p, sizeof(buf) + buf - p, "\t\t%x", !!tid_rx); sta_agg_status_read() 134 p += scnprintf(p, sizeof(buf) + buf - p, "\t%#.2x", sta_agg_status_read() 136 p += scnprintf(p, sizeof(buf) + buf - p, "\t%#.3x", sta_agg_status_read() 139 p += scnprintf(p, sizeof(buf) + buf - p, "\t\t%x", !!tid_tx); sta_agg_status_read() 140 p += scnprintf(p, sizeof(buf) + buf - p, "\t%#.2x", sta_agg_status_read() 142 p += scnprintf(p, sizeof(buf) + buf - p, "\t%03d", sta_agg_status_read() 144 p += scnprintf(p, sizeof(buf) + buf - p, "\n"); sta_agg_status_read() 148 return simple_read_from_buffer(userbuf, count, ppos, buf, p - buf); sta_agg_status_read() 154 char _buf[12] = {}, *buf = _buf; sta_agg_status_write() local 163 if (copy_from_user(buf, userbuf, count)) sta_agg_status_write() 166 buf[sizeof(_buf) - 1] = '\0'; sta_agg_status_write() 168 if (strncmp(buf, "tx ", 3) == 0) { sta_agg_status_write() 169 buf += 3; sta_agg_status_write() 171 } else if (strncmp(buf, "rx ", 3) == 0) { sta_agg_status_write() 172 buf += 3; sta_agg_status_write() 177 if (strncmp(buf, "start ", 6) == 0) { sta_agg_status_write() 178 buf += 6; sta_agg_status_write() 182 } else if (strncmp(buf, "stop ", 5) == 0) { sta_agg_status_write() 183 buf += 5; sta_agg_status_write() 188 ret = kstrtoul(buf, 0, &tid); sta_agg_status_write() 216 p += scnprintf(p, sizeof(buf)+buf-p, "\t" _str "\n"); \ sta_ht_capa_read() 218 char buf[512], *p = buf; sta_ht_capa_read() local 223 p += scnprintf(p, sizeof(buf) + buf - p, "ht %ssupported\n", sta_ht_capa_read() 226 p += scnprintf(p, sizeof(buf)+buf-p, "cap: %#.4x\n", htc->cap); sta_ht_capa_read() 268 p += scnprintf(p, sizeof(buf)+buf-p, "ampdu factor/density: %d/%d\n", sta_ht_capa_read() 270 p += scnprintf(p, sizeof(buf)+buf-p, "MCS mask:"); sta_ht_capa_read() 273 p += scnprintf(p, sizeof(buf)+buf-p, " %.2x", sta_ht_capa_read() 275 p += scnprintf(p, sizeof(buf)+buf-p, "\n"); sta_ht_capa_read() 279 p += scnprintf(p, sizeof(buf)+buf-p, sta_ht_capa_read() 284 p += scnprintf(p, sizeof(buf)+buf-p, "MCS tx params: %x\n", sta_ht_capa_read() 288 return simple_read_from_buffer(userbuf, count, ppos, buf, p - buf); sta_ht_capa_read() 295 char buf[128], *p = buf; sta_vht_capa_read() local 299 p += scnprintf(p, sizeof(buf) + buf - p, "VHT %ssupported\n", sta_vht_capa_read() 302 p += scnprintf(p, sizeof(buf)+buf-p, "cap: %#.8x\n", vhtc->cap); sta_vht_capa_read() 304 p += scnprintf(p, sizeof(buf)+buf-p, "RX MCS: %.4x\n", sta_vht_capa_read() 307 p += scnprintf(p, sizeof(buf)+buf-p, sta_vht_capa_read() 310 p += scnprintf(p, sizeof(buf)+buf-p, "TX MCS: %.4x\n", sta_vht_capa_read() 313 p += scnprintf(p, sizeof(buf)+buf-p, sta_vht_capa_read() 318 return simple_read_from_buffer(userbuf, count, ppos, buf, p - buf); sta_vht_capa_read()
|
H A D | debugfs_key.c | 76 char buf[15]; key_algorithm_read() local 80 sprintf(buf, "%.2x-%.2x-%.2x:%d\n", key_algorithm_read() 82 return simple_read_from_buffer(userbuf, count, ppos, buf, strlen(buf)); key_algorithm_read() 125 char buf[20]; key_tx_spec_read() local 132 len = scnprintf(buf, sizeof(buf), "\n"); key_tx_spec_read() 135 len = scnprintf(buf, sizeof(buf), "%08x %04x\n", key_tx_spec_read() 148 len = scnprintf(buf, sizeof(buf), "%02x%02x%02x%02x%02x%02x\n", key_tx_spec_read() 155 return simple_read_from_buffer(userbuf, count, ppos, buf, len); key_tx_spec_read() 163 char buf[14*IEEE80211_NUM_TIDS+1], *p = buf; key_rx_spec_read() local 170 len = scnprintf(buf, sizeof(buf), "\n"); key_rx_spec_read() 174 p += scnprintf(p, sizeof(buf)+buf-p, key_rx_spec_read() 178 len = p - buf; key_rx_spec_read() 184 p += scnprintf(p, sizeof(buf)+buf-p, key_rx_spec_read() 189 len = p - buf; key_rx_spec_read() 194 p += scnprintf(p, sizeof(buf)+buf-p, key_rx_spec_read() 198 len = p - buf; key_rx_spec_read() 203 p += scnprintf(p, sizeof(buf)+buf-p, key_rx_spec_read() 207 len = p - buf; key_rx_spec_read() 213 p += scnprintf(p, sizeof(buf)+buf-p, key_rx_spec_read() 218 len = p - buf; key_rx_spec_read() 223 return simple_read_from_buffer(userbuf, count, ppos, buf, len); key_rx_spec_read() 231 char buf[20]; key_replays_read() local 237 len = scnprintf(buf, sizeof(buf), "%u\n", key->u.ccmp.replays); key_replays_read() 241 len = scnprintf(buf, sizeof(buf), "%u\n", key_replays_read() 246 len = scnprintf(buf, sizeof(buf), "%u\n", key_replays_read() 251 len = scnprintf(buf, sizeof(buf), "%u\n", key->u.gcmp.replays); key_replays_read() 256 return simple_read_from_buffer(userbuf, count, ppos, buf, len); key_replays_read() 264 char buf[20]; key_icverrors_read() local 270 len = scnprintf(buf, sizeof(buf), "%u\n", key_icverrors_read() 275 len = scnprintf(buf, sizeof(buf), "%u\n", key_icverrors_read() 281 return simple_read_from_buffer(userbuf, count, ppos, buf, len); key_icverrors_read() 289 char buf[20]; key_mic_failures_read() local 295 len = scnprintf(buf, sizeof(buf), "%u\n", key->u.tkip.mic_failures); key_mic_failures_read() 297 return simple_read_from_buffer(userbuf, count, ppos, buf, len); key_mic_failures_read() 306 char *buf = kmalloc(bufsize, GFP_KERNEL); key_key_read() local 307 char *p = buf; key_key_read() 310 if (!buf) key_key_read() 314 p += scnprintf(p, bufsize + buf - p, "%02x", key->conf.key[i]); key_key_read() 315 p += scnprintf(p, bufsize+buf-p, "\n"); key_key_read() 316 res = simple_read_from_buffer(userbuf, count, ppos, buf, p - buf); key_key_read() 317 kfree(buf); key_key_read() 332 char buf[100]; ieee80211_debugfs_key_add() local 338 sprintf(buf, "%d", keycount); ieee80211_debugfs_key_add() 341 key->debugfs.dir = debugfs_create_dir(buf, ieee80211_debugfs_key_add() 349 sprintf(buf, "../../netdev:%s/stations/%pM", ieee80211_debugfs_key_add() 352 debugfs_create_symlink("station", key->debugfs.dir, buf); ieee80211_debugfs_key_add() 380 char buf[50]; ieee80211_debugfs_key_update_default() local 394 sprintf(buf, "../keys/%d", key->debugfs.cnt); ieee80211_debugfs_key_update_default() 397 sdata->vif.debugfs_dir, buf); ieee80211_debugfs_key_update_default() 406 sprintf(buf, "../keys/%d", key->debugfs.cnt); ieee80211_debugfs_key_update_default() 409 sdata->vif.debugfs_dir, buf); ieee80211_debugfs_key_update_default() 415 char buf[50]; ieee80211_debugfs_key_add_mgmt_default() local 424 sprintf(buf, "../keys/%d", key->debugfs.cnt); ieee80211_debugfs_key_add_mgmt_default() 427 sdata->vif.debugfs_dir, buf); ieee80211_debugfs_key_add_mgmt_default()
|
/linux-4.4.14/include/linux/ |
H A D | zutil.h | 47 typedef uLong (*check_func) (uLong check, const Byte *buf, 57 #define DO1(buf,i) {s1 += buf[i]; s2 += s1;} 58 #define DO2(buf,i) DO1(buf,i); DO1(buf,i+1); 59 #define DO4(buf,i) DO2(buf,i); DO2(buf,i+2); 60 #define DO8(buf,i) DO4(buf,i); DO4(buf,i+4); 61 #define DO16(buf) DO8(buf,0); DO8(buf,8); 65 Update a running Adler-32 checksum with the bytes buf[0..len-1] and 66 return the updated checksum. If buf is NULL, this function returns 79 const Byte *buf, zlib_adler32() 86 if (buf == NULL) return 1L; zlib_adler32() 92 DO16(buf); zlib_adler32() 93 buf += 16; zlib_adler32() 97 s1 += *buf++; zlib_adler32() 78 zlib_adler32(uLong adler, const Byte *buf, uInt len) zlib_adler32() argument
|
H A D | hdlcdrv.h | 28 unsigned short buf[HDLCDRV_HDLCBUFFER]; member in struct:hdlcdrv_hdlcbuffer 39 static inline void hdlcdrv_add_bitbuffer(struct hdlcdrv_bitbuffer *buf, hdlcdrv_add_bitbuffer() argument 44 new = buf->shreg & 1; hdlcdrv_add_bitbuffer() 45 buf->shreg >>= 1; hdlcdrv_add_bitbuffer() 46 buf->shreg |= (!!bit) << 7; hdlcdrv_add_bitbuffer() 48 buf->buffer[buf->wr] = buf->shreg; hdlcdrv_add_bitbuffer() 49 buf->wr = (buf->wr+1) % sizeof(buf->buffer); hdlcdrv_add_bitbuffer() 50 buf->shreg = 0x80; hdlcdrv_add_bitbuffer() 54 static inline void hdlcdrv_add_bitbuffer_word(struct hdlcdrv_bitbuffer *buf, hdlcdrv_add_bitbuffer_word() argument 57 buf->buffer[buf->wr] = bits & 0xff; hdlcdrv_add_bitbuffer_word() 58 buf->wr = (buf->wr+1) % sizeof(buf->buffer); hdlcdrv_add_bitbuffer_word() 59 buf->buffer[buf->wr] = (bits >> 8) & 0xff; hdlcdrv_add_bitbuffer_word() 60 buf->wr = (buf->wr+1) % sizeof(buf->buffer); hdlcdrv_add_bitbuffer_word() 194 val = hb->buf[hb->rd]; hdlcdrv_hbuf_get() 212 hb->buf[hb->wr] = val & 0xffff; hdlcdrv_hbuf_put()
|
H A D | cciss_ioctl.h | 13 WORD buf_size; /* size in bytes of the buf */ 14 __u32 buf; /* 32 bit pointer to data buffer */ member in struct:_IOCTL32_Command_struct 22 DWORD buf_size; /* size in bytes of the buf */ 24 __u32 buf; /* 32 bit pointer to data buffer */ member in struct:_BIG_IOCTL32_Command_struct
|
/linux-4.4.14/kernel/ |
H A D | relay.c | 35 struct rchan_buf *buf = vma->vm_private_data; relay_file_mmap_close() local 36 buf->chan->cb->buf_unmapped(buf, vma->vm_file); relay_file_mmap_close() 45 struct rchan_buf *buf = vma->vm_private_data; relay_buf_fault() local 48 if (!buf) relay_buf_fault() 51 page = vmalloc_to_page(buf->start + (pgoff << PAGE_SHIFT)); relay_buf_fault() 89 * @buf: relay channel buffer 96 static int relay_mmap_buf(struct rchan_buf *buf, struct vm_area_struct *vma) relay_mmap_buf() argument 101 if (!buf) relay_mmap_buf() 104 if (length != (unsigned long)buf->chan->alloc_size) relay_mmap_buf() 109 vma->vm_private_data = buf; relay_mmap_buf() 110 buf->chan->cb->buf_mapped(buf, filp); relay_mmap_buf() 117 * @buf: the buffer struct 123 static void *relay_alloc_buf(struct rchan_buf *buf, size_t *size) relay_alloc_buf() argument 131 buf->page_array = relay_alloc_page_array(n_pages); relay_alloc_buf() 132 if (!buf->page_array) relay_alloc_buf() 136 buf->page_array[i] = alloc_page(GFP_KERNEL); relay_alloc_buf() 137 if (unlikely(!buf->page_array[i])) relay_alloc_buf() 139 set_page_private(buf->page_array[i], (unsigned long)buf); relay_alloc_buf() 141 mem = vmap(buf->page_array, n_pages, VM_MAP, PAGE_KERNEL); relay_alloc_buf() 146 buf->page_count = n_pages; relay_alloc_buf() 151 __free_page(buf->page_array[j]); relay_alloc_buf() 152 relay_free_page_array(buf->page_array); relay_alloc_buf() 164 struct rchan_buf *buf; relay_create_buf() local 169 buf = kzalloc(sizeof(struct rchan_buf), GFP_KERNEL); relay_create_buf() 170 if (!buf) relay_create_buf() 172 buf->padding = kmalloc(chan->n_subbufs * sizeof(size_t *), GFP_KERNEL); relay_create_buf() 173 if (!buf->padding) relay_create_buf() 176 buf->start = relay_alloc_buf(buf, &chan->alloc_size); relay_create_buf() 177 if (!buf->start) relay_create_buf() 180 buf->chan = chan; relay_create_buf() 181 kref_get(&buf->chan->kref); relay_create_buf() 182 return buf; relay_create_buf() 185 kfree(buf->padding); relay_create_buf() 186 kfree(buf); relay_create_buf() 204 * @buf: the buffer struct 206 static void relay_destroy_buf(struct rchan_buf *buf) relay_destroy_buf() argument 208 struct rchan *chan = buf->chan; relay_destroy_buf() 211 if (likely(buf->start)) { relay_destroy_buf() 212 vunmap(buf->start); relay_destroy_buf() 213 for (i = 0; i < buf->page_count; i++) relay_destroy_buf() 214 __free_page(buf->page_array[i]); relay_destroy_buf() 215 relay_free_page_array(buf->page_array); relay_destroy_buf() 217 chan->buf[buf->cpu] = NULL; relay_destroy_buf() 218 kfree(buf->padding); relay_destroy_buf() 219 kfree(buf); relay_destroy_buf() 233 struct rchan_buf *buf = container_of(kref, struct rchan_buf, kref); relay_remove_buf() local 234 relay_destroy_buf(buf); relay_remove_buf() 239 * @buf: channel buffer 243 static int relay_buf_empty(struct rchan_buf *buf) relay_buf_empty() argument 245 return (buf->subbufs_produced - buf->subbufs_consumed) ? 0 : 1; relay_buf_empty() 250 * @buf: channel buffer 254 int relay_buf_full(struct rchan_buf *buf) relay_buf_full() argument 256 size_t ready = buf->subbufs_produced - buf->subbufs_consumed; relay_buf_full() 257 return (ready >= buf->chan->n_subbufs) ? 1 : 0; relay_buf_full() 273 static int subbuf_start_default_callback (struct rchan_buf *buf, subbuf_start_default_callback() argument 278 if (relay_buf_full(buf)) subbuf_start_default_callback() 287 static void buf_mapped_default_callback(struct rchan_buf *buf, buf_mapped_default_callback() argument 295 static void buf_unmapped_default_callback(struct rchan_buf *buf, buf_unmapped_default_callback() argument 306 struct rchan_buf *buf, create_buf_file_default_callback() 337 struct rchan_buf *buf = (struct rchan_buf *)data; wakeup_readers() local 338 wake_up_interruptible(&buf->read_wait); wakeup_readers() 343 * @buf: the channel buffer 348 static void __relay_reset(struct rchan_buf *buf, unsigned int init) __relay_reset() argument 353 init_waitqueue_head(&buf->read_wait); __relay_reset() 354 kref_init(&buf->kref); __relay_reset() 355 setup_timer(&buf->timer, wakeup_readers, (unsigned long)buf); __relay_reset() 357 del_timer_sync(&buf->timer); __relay_reset() 359 buf->subbufs_produced = 0; __relay_reset() 360 buf->subbufs_consumed = 0; __relay_reset() 361 buf->bytes_consumed = 0; __relay_reset() 362 buf->finalized = 0; __relay_reset() 363 buf->data = buf->start; __relay_reset() 364 buf->offset = 0; __relay_reset() 366 for (i = 0; i < buf->chan->n_subbufs; i++) __relay_reset() 367 buf->padding[i] = 0; __relay_reset() 369 buf->chan->cb->subbuf_start(buf, buf->data, NULL, 0); __relay_reset() 390 if (chan->is_global && chan->buf[0]) { relay_reset() 391 __relay_reset(chan->buf[0], 0); relay_reset() 397 if (chan->buf[i]) relay_reset() 398 __relay_reset(chan->buf[i], 0); relay_reset() 403 static inline void relay_set_buf_dentry(struct rchan_buf *buf, relay_set_buf_dentry() argument 406 buf->dentry = dentry; relay_set_buf_dentry() 407 d_inode(buf->dentry)->i_size = buf->early_bytes; relay_set_buf_dentry() 411 struct rchan_buf *buf, relay_create_buf_file() 424 S_IRUSR, buf, relay_create_buf_file() 439 struct rchan_buf *buf = NULL; relay_open_buf() local 443 return chan->buf[0]; relay_open_buf() 445 buf = relay_create_buf(chan); relay_open_buf() 446 if (!buf) relay_open_buf() 450 dentry = relay_create_buf_file(chan, buf, cpu); relay_open_buf() 453 relay_set_buf_dentry(buf, dentry); relay_open_buf() 456 buf->cpu = cpu; relay_open_buf() 457 __relay_reset(buf, 1); relay_open_buf() 460 chan->buf[0] = buf; relay_open_buf() 461 buf->cpu = 0; relay_open_buf() 464 return buf; relay_open_buf() 467 relay_destroy_buf(buf); relay_open_buf() 473 * @buf: channel buffer 479 static void relay_close_buf(struct rchan_buf *buf) relay_close_buf() argument 481 buf->finalized = 1; relay_close_buf() 482 del_timer_sync(&buf->timer); relay_close_buf() 483 buf->chan->cb->remove_buf_file(buf->dentry); relay_close_buf() 484 kref_put(&buf->kref, relay_remove_buf); relay_close_buf() 528 if (chan->buf[hotcpu]) relay_hotcpu_callback() 530 chan->buf[hotcpu] = relay_open_buf(chan, hotcpu); relay_hotcpu_callback() 531 if(!chan->buf[hotcpu]) { relay_hotcpu_callback() 600 chan->buf[i] = relay_open_buf(chan, i); for_each_online_cpu() 601 if (!chan->buf[i]) for_each_online_cpu() 611 if (chan->buf[i]) for_each_possible_cpu() 612 relay_close_buf(chan->buf[i]); for_each_possible_cpu() 622 struct rchan_buf *buf; member in struct:rchan_percpu_buf_dispatcher 631 relay_set_buf_dentry(p->buf, p->dentry); __relay_set_buf_dentry() 675 if (unlikely(!chan->buf[i])) { for_each_online_cpu() 681 dentry = relay_create_buf_file(chan, chan->buf[i], i); for_each_online_cpu() 689 relay_set_buf_dentry(chan->buf[i], dentry); for_each_online_cpu() 692 disp.buf = chan->buf[i]; for_each_online_cpu() 711 * @buf: channel buffer 719 size_t relay_switch_subbuf(struct rchan_buf *buf, size_t length) relay_switch_subbuf() argument 724 if (unlikely(length > buf->chan->subbuf_size)) relay_switch_subbuf() 727 if (buf->offset != buf->chan->subbuf_size + 1) { relay_switch_subbuf() 728 buf->prev_padding = buf->chan->subbuf_size - buf->offset; relay_switch_subbuf() 729 old_subbuf = buf->subbufs_produced % buf->chan->n_subbufs; relay_switch_subbuf() 730 buf->padding[old_subbuf] = buf->prev_padding; relay_switch_subbuf() 731 buf->subbufs_produced++; relay_switch_subbuf() 732 if (buf->dentry) relay_switch_subbuf() 733 d_inode(buf->dentry)->i_size += relay_switch_subbuf() 734 buf->chan->subbuf_size - relay_switch_subbuf() 735 buf->padding[old_subbuf]; relay_switch_subbuf() 737 buf->early_bytes += buf->chan->subbuf_size - relay_switch_subbuf() 738 buf->padding[old_subbuf]; relay_switch_subbuf() 740 if (waitqueue_active(&buf->read_wait)) relay_switch_subbuf() 747 mod_timer(&buf->timer, jiffies + 1); relay_switch_subbuf() 750 old = buf->data; relay_switch_subbuf() 751 new_subbuf = buf->subbufs_produced % buf->chan->n_subbufs; relay_switch_subbuf() 752 new = buf->start + new_subbuf * buf->chan->subbuf_size; relay_switch_subbuf() 753 buf->offset = 0; relay_switch_subbuf() 754 if (!buf->chan->cb->subbuf_start(buf, new, old, buf->prev_padding)) { relay_switch_subbuf() 755 buf->offset = buf->chan->subbuf_size + 1; relay_switch_subbuf() 758 buf->data = new; relay_switch_subbuf() 759 buf->padding[new_subbuf] = 0; relay_switch_subbuf() 761 if (unlikely(length + buf->offset > buf->chan->subbuf_size)) relay_switch_subbuf() 767 buf->chan->last_toobig = length; relay_switch_subbuf() 776 * @subbufs_consumed: number of sub-buffers to add to current buf's count 789 struct rchan_buf *buf; relay_subbufs_consumed() local 794 if (cpu >= NR_CPUS || !chan->buf[cpu] || relay_subbufs_consumed() 798 buf = chan->buf[cpu]; relay_subbufs_consumed() 799 if (subbufs_consumed > buf->subbufs_produced - buf->subbufs_consumed) relay_subbufs_consumed() 800 buf->subbufs_consumed = buf->subbufs_produced; relay_subbufs_consumed() 802 buf->subbufs_consumed += subbufs_consumed; relay_subbufs_consumed() 820 if (chan->is_global && chan->buf[0]) relay_close() 821 relay_close_buf(chan->buf[0]); relay_close() 824 if (chan->buf[i]) relay_close() 825 relay_close_buf(chan->buf[i]); relay_close() 851 if (chan->is_global && chan->buf[0]) { relay_flush() 852 relay_switch_subbuf(chan->buf[0], 0); relay_flush() 858 if (chan->buf[i]) relay_flush() 859 relay_switch_subbuf(chan->buf[i], 0); relay_flush() 873 struct rchan_buf *buf = inode->i_private; relay_file_open() local 874 kref_get(&buf->kref); relay_file_open() 875 filp->private_data = buf; relay_file_open() 889 struct rchan_buf *buf = filp->private_data; relay_file_mmap() local 890 return relay_mmap_buf(buf, vma); relay_file_mmap() 903 struct rchan_buf *buf = filp->private_data; relay_file_poll() local 905 if (buf->finalized) relay_file_poll() 909 poll_wait(filp, &buf->read_wait, wait); relay_file_poll() 910 if (!relay_buf_empty(buf)) relay_file_poll() 927 struct rchan_buf *buf = filp->private_data; relay_file_release() local 928 kref_put(&buf->kref, relay_remove_buf); relay_file_release() 936 static void relay_file_read_consume(struct rchan_buf *buf, relay_file_read_consume() argument 940 size_t subbuf_size = buf->chan->subbuf_size; relay_file_read_consume() 941 size_t n_subbufs = buf->chan->n_subbufs; relay_file_read_consume() 944 if (buf->subbufs_produced == buf->subbufs_consumed && relay_file_read_consume() 945 buf->offset == buf->bytes_consumed) relay_file_read_consume() 948 if (buf->bytes_consumed + bytes_consumed > subbuf_size) { relay_file_read_consume() 949 relay_subbufs_consumed(buf->chan, buf->cpu, 1); relay_file_read_consume() 950 buf->bytes_consumed = 0; relay_file_read_consume() 953 buf->bytes_consumed += bytes_consumed; relay_file_read_consume() 955 read_subbuf = buf->subbufs_consumed % n_subbufs; relay_file_read_consume() 957 read_subbuf = read_pos / buf->chan->subbuf_size; relay_file_read_consume() 958 if (buf->bytes_consumed + buf->padding[read_subbuf] == subbuf_size) { relay_file_read_consume() 959 if ((read_subbuf == buf->subbufs_produced % n_subbufs) && relay_file_read_consume() 960 (buf->offset == subbuf_size)) relay_file_read_consume() 962 relay_subbufs_consumed(buf->chan, buf->cpu, 1); relay_file_read_consume() 963 buf->bytes_consumed = 0; relay_file_read_consume() 970 static int relay_file_read_avail(struct rchan_buf *buf, size_t read_pos) relay_file_read_avail() argument 972 size_t subbuf_size = buf->chan->subbuf_size; relay_file_read_avail() 973 size_t n_subbufs = buf->chan->n_subbufs; relay_file_read_avail() 974 size_t produced = buf->subbufs_produced; relay_file_read_avail() 975 size_t consumed = buf->subbufs_consumed; relay_file_read_avail() 977 relay_file_read_consume(buf, read_pos, 0); relay_file_read_avail() 979 consumed = buf->subbufs_consumed; relay_file_read_avail() 981 if (unlikely(buf->offset > subbuf_size)) { relay_file_read_avail() 989 buf->subbufs_consumed = consumed; relay_file_read_avail() 990 buf->bytes_consumed = 0; relay_file_read_avail() 993 produced = (produced % n_subbufs) * subbuf_size + buf->offset; relay_file_read_avail() 994 consumed = (consumed % n_subbufs) * subbuf_size + buf->bytes_consumed; relay_file_read_avail() 1000 if (buf->offset == subbuf_size && relay_file_read_avail() 1001 buf->subbufs_produced > buf->subbufs_consumed) relay_file_read_avail() 1012 * @buf: relay channel buffer 1015 struct rchan_buf *buf) relay_file_read_subbuf_avail() 1019 size_t subbuf_size = buf->chan->subbuf_size; relay_file_read_subbuf_avail() 1021 write_subbuf = (buf->data - buf->start) / subbuf_size; relay_file_read_subbuf_avail() 1022 write_offset = buf->offset > subbuf_size ? subbuf_size : buf->offset; relay_file_read_subbuf_avail() 1025 padding = buf->padding[read_subbuf]; relay_file_read_subbuf_avail() 1039 * @buf: relay channel buffer 1046 struct rchan_buf *buf) relay_file_read_start_pos() 1049 size_t subbuf_size = buf->chan->subbuf_size; relay_file_read_start_pos() 1050 size_t n_subbufs = buf->chan->n_subbufs; relay_file_read_start_pos() 1051 size_t consumed = buf->subbufs_consumed % n_subbufs; relay_file_read_start_pos() 1054 read_pos = consumed * subbuf_size + buf->bytes_consumed; relay_file_read_start_pos() 1056 padding = buf->padding[read_subbuf]; relay_file_read_start_pos() 1070 * @buf: relay channel buffer 1073 static size_t relay_file_read_end_pos(struct rchan_buf *buf, relay_file_read_end_pos() argument 1078 size_t subbuf_size = buf->chan->subbuf_size; relay_file_read_end_pos() 1079 size_t n_subbufs = buf->chan->n_subbufs; relay_file_read_end_pos() 1082 padding = buf->padding[read_subbuf]; relay_file_read_end_pos() 1097 struct rchan_buf *buf, subbuf_read_actor() 1104 from = buf->start + read_start; subbuf_read_actor() 1106 if (copy_to_user(desc->arg.buf, from, avail)) { subbuf_read_actor() 1118 struct rchan_buf *buf, 1129 struct rchan_buf *buf = filp->private_data; relay_file_read_subbufs() local 1138 if (!relay_file_read_avail(buf, *ppos)) relay_file_read_subbufs() 1141 read_start = relay_file_read_start_pos(*ppos, buf); relay_file_read_subbufs() 1142 avail = relay_file_read_subbuf_avail(read_start, buf); relay_file_read_subbufs() 1147 ret = subbuf_actor(read_start, buf, avail, desc); relay_file_read_subbufs() 1152 relay_file_read_consume(buf, read_start, ret); relay_file_read_subbufs() 1153 *ppos = relay_file_read_end_pos(buf, read_start, ret); relay_file_read_subbufs() 1169 desc.arg.buf = buffer; relay_file_read() 1185 struct pipe_buffer *buf) relay_pipe_buf_release() 1189 rbuf = (struct rchan_buf *)page_private(buf->page); relay_pipe_buf_release() 1190 relay_consume_bytes(rbuf, buf->private); relay_pipe_buf_release() 303 create_buf_file_default_callback(const char *filename, struct dentry *parent, umode_t mode, struct rchan_buf *buf, int *is_global) create_buf_file_default_callback() argument 410 relay_create_buf_file(struct rchan *chan, struct rchan_buf *buf, unsigned int cpu) relay_create_buf_file() argument 1014 relay_file_read_subbuf_avail(size_t read_pos, struct rchan_buf *buf) relay_file_read_subbuf_avail() argument 1045 relay_file_read_start_pos(size_t read_pos, struct rchan_buf *buf) relay_file_read_start_pos() argument 1096 subbuf_read_actor(size_t read_start, struct rchan_buf *buf, size_t avail, read_descriptor_t *desc) subbuf_read_actor() argument 1184 relay_pipe_buf_release(struct pipe_inode_info *pipe, struct pipe_buffer *buf) relay_pipe_buf_release() argument
|
H A D | ksysfs.c | 34 struct kobj_attribute *attr, char *buf) uevent_seqnum_show() 36 return sprintf(buf, "%llu\n", (unsigned long long)uevent_seqnum); uevent_seqnum_show() 43 struct kobj_attribute *attr, char *buf) uevent_helper_show() 45 return sprintf(buf, "%s\n", uevent_helper); uevent_helper_show() 49 const char *buf, size_t count) uevent_helper_store() 53 memcpy(uevent_helper, buf, count); uevent_helper_store() 64 struct kobj_attribute *attr, char *buf) profiling_show() 66 return sprintf(buf, "%d\n", prof_on); profiling_show() 70 const char *buf, size_t count) profiling_store() 81 profile_setup((char *)buf); profiling_store() 95 struct kobj_attribute *attr, char *buf) kexec_loaded_show() 97 return sprintf(buf, "%d\n", !!kexec_image); kexec_loaded_show() 102 struct kobj_attribute *attr, char *buf) kexec_crash_loaded_show() 104 return sprintf(buf, "%d\n", !!kexec_crash_image); kexec_crash_loaded_show() 109 struct kobj_attribute *attr, char *buf) kexec_crash_size_show() 111 return sprintf(buf, "%zu\n", crash_get_memory_size()); kexec_crash_size_show() 115 const char *buf, size_t count) kexec_crash_size_store() 120 if (kstrtoul(buf, 0, &cnt)) kexec_crash_size_store() 129 struct kobj_attribute *attr, char *buf) vmcoreinfo_show() 131 return sprintf(buf, "%lx %x\n", vmcoreinfo_show() 141 struct kobj_attribute *attr, char *buf) fscaps_show() 143 return sprintf(buf, "%d\n", file_caps_enabled); fscaps_show() 149 struct kobj_attribute *attr, char *buf) rcu_expedited_show() 151 return sprintf(buf, "%d\n", rcu_expedited); rcu_expedited_show() 155 const char *buf, size_t count) rcu_expedited_store() 157 if (kstrtoint(buf, 0, &rcu_expedited)) rcu_expedited_store() 173 char *buf, loff_t off, size_t count) notes_read() 175 memcpy(buf, &__start_notes + off, count); notes_read() 33 uevent_seqnum_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) uevent_seqnum_show() argument 42 uevent_helper_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) uevent_helper_show() argument 47 uevent_helper_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count) uevent_helper_store() argument 63 profiling_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) profiling_show() argument 68 profiling_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count) profiling_store() argument 94 kexec_loaded_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) kexec_loaded_show() argument 101 kexec_crash_loaded_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) kexec_crash_loaded_show() argument 108 kexec_crash_size_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) kexec_crash_size_show() argument 113 kexec_crash_size_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count) kexec_crash_size_store() argument 128 vmcoreinfo_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) vmcoreinfo_show() argument 140 fscaps_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) fscaps_show() argument 148 rcu_expedited_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) rcu_expedited_show() argument 153 rcu_expedited_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count) rcu_expedited_store() argument 171 notes_read(struct file *filp, struct kobject *kobj, struct bin_attribute *bin_attr, char *buf, loff_t off, size_t count) notes_read() argument
|
/linux-4.4.14/drivers/net/wireless/ath/ath5k/ |
H A D | debug.c | 199 char buf[500]; read_file_beacon() local 205 len += snprintf(buf + len, sizeof(buf) - len, read_file_beacon() 210 len += snprintf(buf + len, sizeof(buf) - len, "%-24s0x%08x\n", read_file_beacon() 213 len += snprintf(buf + len, sizeof(buf) - len, "%-24s0x%08x\n\n", read_file_beacon() 217 len += snprintf(buf + len, sizeof(buf) - len, "%-24s0x%08x\tTU: %08x\n", read_file_beacon() 221 len += snprintf(buf + len, sizeof(buf) - len, "%-24s0x%08x\tTU: %08x\n", read_file_beacon() 225 len += snprintf(buf + len, sizeof(buf) - len, "%-24s0x%08x\tTU: %08x\n", read_file_beacon() 229 len += snprintf(buf + len, sizeof(buf) - len, "%-24s0x%08x\tTU: %08x\n", read_file_beacon() 233 len += snprintf(buf + len, sizeof(buf) - len, read_file_beacon() 237 if (len > sizeof(buf)) read_file_beacon() 238 len = sizeof(buf); read_file_beacon() 240 return simple_read_from_buffer(user_buf, count, ppos, buf, len); read_file_beacon() 248 char buf[20]; write_file_beacon() local 250 count = min_t(size_t, count, sizeof(buf) - 1); write_file_beacon() 251 if (copy_from_user(buf, userbuf, count)) write_file_beacon() 254 buf[count] = '\0'; write_file_beacon() 255 if (strncmp(buf, "disable", 7) == 0) { write_file_beacon() 258 } else if (strncmp(buf, "enable", 6) == 0) { write_file_beacon() 320 char buf[700]; read_file_debug() local 324 len += snprintf(buf + len, sizeof(buf) - len, read_file_debug() 328 len += snprintf(buf + len, sizeof(buf) - len, read_file_debug() 333 len += snprintf(buf + len, sizeof(buf) - len, read_file_debug() 338 if (len > sizeof(buf)) read_file_debug() 339 len = sizeof(buf); read_file_debug() 341 return simple_read_from_buffer(user_buf, count, ppos, buf, len); read_file_debug() 350 char buf[20]; write_file_debug() local 352 count = min_t(size_t, count, sizeof(buf) - 1); write_file_debug() 353 if (copy_from_user(buf, userbuf, count)) write_file_debug() 356 buf[count] = '\0'; write_file_debug() 358 if (strncmp(buf, dbg_info[i].name, write_file_debug() 382 char buf[700]; read_file_antenna() local 387 len += snprintf(buf + len, sizeof(buf) - len, "antenna mode\t%d\n", read_file_antenna() 389 len += snprintf(buf + len, sizeof(buf) - len, "default antenna\t%d\n", read_file_antenna() 391 len += snprintf(buf + len, sizeof(buf) - len, "tx antenna\t%d\n", read_file_antenna() 394 len += snprintf(buf + len, sizeof(buf) - len, "\nANTENNA\t\tRX\tTX\n"); read_file_antenna() 396 len += snprintf(buf + len, sizeof(buf) - len, read_file_antenna() 400 len += snprintf(buf + len, sizeof(buf) - len, "[invalid]\t%d\t%d\n", read_file_antenna() 404 len += snprintf(buf + len, sizeof(buf) - len, read_file_antenna() 408 len += snprintf(buf + len, sizeof(buf) - len, read_file_antenna() 411 len += snprintf(buf + len, sizeof(buf) - len, read_file_antenna() 414 len += snprintf(buf + len, sizeof(buf) - len, read_file_antenna() 417 len += snprintf(buf + len, sizeof(buf) - len, read_file_antenna() 422 len += snprintf(buf + len, sizeof(buf) - len, read_file_antenna() 427 len += snprintf(buf + len, sizeof(buf) - len, read_file_antenna() 432 len += snprintf(buf + len, sizeof(buf) - len, read_file_antenna() 437 len += snprintf(buf + len, sizeof(buf) - len, read_file_antenna() 440 len += snprintf(buf + len, sizeof(buf) - len, read_file_antenna() 443 if (len > sizeof(buf)) read_file_antenna() 444 len = sizeof(buf); read_file_antenna() 446 return simple_read_from_buffer(user_buf, count, ppos, buf, len); read_file_antenna() 455 char buf[20]; write_file_antenna() local 457 count = min_t(size_t, count, sizeof(buf) - 1); write_file_antenna() 458 if (copy_from_user(buf, userbuf, count)) write_file_antenna() 461 buf[count] = '\0'; write_file_antenna() 462 if (strncmp(buf, "diversity", 9) == 0) { write_file_antenna() 465 } else if (strncmp(buf, "fixed-a", 7) == 0) { write_file_antenna() 468 } else if (strncmp(buf, "fixed-b", 7) == 0) { write_file_antenna() 471 } else if (strncmp(buf, "clear", 5) == 0) { write_file_antenna() 495 char buf[700]; read_file_misc() local 499 len += snprintf(buf + len, sizeof(buf) - len, "bssid-mask: %pM\n", read_file_misc() 501 len += snprintf(buf + len, sizeof(buf) - len, "filter-flags: 0x%x ", read_file_misc() 504 len += snprintf(buf + len, sizeof(buf) - len, " UCAST"); read_file_misc() 506 len += snprintf(buf + len, sizeof(buf) - len, " MCAST"); read_file_misc() 508 len += snprintf(buf + len, sizeof(buf) - len, " BCAST"); read_file_misc() 510 len += snprintf(buf + len, sizeof(buf) - len, " CONTROL"); read_file_misc() 512 len += snprintf(buf + len, sizeof(buf) - len, " BEACON"); read_file_misc() 514 len += snprintf(buf + len, sizeof(buf) - len, " PROM"); read_file_misc() 516 len += snprintf(buf + len, sizeof(buf) - len, " XRPOLL"); read_file_misc() 518 len += snprintf(buf + len, sizeof(buf) - len, " PROBEREQ"); read_file_misc() 520 len += snprintf(buf + len, sizeof(buf) - len, " PHYERR-5212"); read_file_misc() 522 len += snprintf(buf + len, sizeof(buf) - len, " RADARERR-5212"); read_file_misc() 524 snprintf(buf + len, sizeof(buf) - len, " PHYERR-5211"); read_file_misc() 526 len += snprintf(buf + len, sizeof(buf) - len, " RADARERR-5211"); read_file_misc() 528 len += snprintf(buf + len, sizeof(buf) - len, "\nopmode: %s (%d)\n", read_file_misc() 531 if (len > sizeof(buf)) read_file_misc() 532 len = sizeof(buf); read_file_misc() 534 return simple_read_from_buffer(user_buf, count, ppos, buf, len); read_file_misc() 551 char buf[700]; read_file_frameerrors() local 555 len += snprintf(buf + len, sizeof(buf) - len, read_file_frameerrors() 557 len += snprintf(buf + len, sizeof(buf) - len, "CRC\t%u\t(%u%%)\n", read_file_frameerrors() 561 len += snprintf(buf + len, sizeof(buf) - len, "PHY\t%u\t(%u%%)\n", read_file_frameerrors() 567 len += snprintf(buf + len, sizeof(buf) - len, read_file_frameerrors() 572 len += snprintf(buf + len, sizeof(buf) - len, "FIFO\t%u\t(%u%%)\n", read_file_frameerrors() 576 len += snprintf(buf + len, sizeof(buf) - len, "decrypt\t%u\t(%u%%)\n", read_file_frameerrors() 580 len += snprintf(buf + len, sizeof(buf) - len, "MIC\t%u\t(%u%%)\n", read_file_frameerrors() 584 len += snprintf(buf + len, sizeof(buf) - len, "process\t%u\t(%u%%)\n", read_file_frameerrors() 588 len += snprintf(buf + len, sizeof(buf) - len, "jumbo\t%u\t(%u%%)\n", read_file_frameerrors() 592 len += snprintf(buf + len, sizeof(buf) - len, "[RX all\t%u]\n", read_file_frameerrors() 594 len += snprintf(buf + len, sizeof(buf) - len, "RX-all-bytes\t%u\n", read_file_frameerrors() 597 len += snprintf(buf + len, sizeof(buf) - len, read_file_frameerrors() 599 len += snprintf(buf + len, sizeof(buf) - len, "retry\t%u\t(%u%%)\n", read_file_frameerrors() 603 len += snprintf(buf + len, sizeof(buf) - len, "FIFO\t%u\t(%u%%)\n", read_file_frameerrors() 607 len += snprintf(buf + len, sizeof(buf) - len, "filter\t%u\t(%u%%)\n", read_file_frameerrors() 611 len += snprintf(buf + len, sizeof(buf) - len, "[TX all\t%u]\n", read_file_frameerrors() 613 len += snprintf(buf + len, sizeof(buf) - len, "TX-all-bytes\t%u\n", read_file_frameerrors() 616 if (len > sizeof(buf)) read_file_frameerrors() 617 len = sizeof(buf); read_file_frameerrors() 619 return simple_read_from_buffer(user_buf, count, ppos, buf, len); read_file_frameerrors() 628 char buf[20]; write_file_frameerrors() local 630 count = min_t(size_t, count, sizeof(buf) - 1); write_file_frameerrors() 631 if (copy_from_user(buf, userbuf, count)) write_file_frameerrors() 634 buf[count] = '\0'; write_file_frameerrors() 635 if (strncmp(buf, "clear", 5) == 0) { write_file_frameerrors() 671 char buf[700]; read_file_ani() local 674 len += snprintf(buf + len, sizeof(buf) - len, read_file_ani() 678 len += snprintf(buf + len, sizeof(buf) - len, read_file_ani() 681 len += snprintf(buf + len, sizeof(buf) - len, read_file_ani() 683 len += snprintf(buf + len, sizeof(buf) - len, "operating mode:\t\t\t"); read_file_ani() 686 len += snprintf(buf + len, sizeof(buf) - len, "OFF\n"); read_file_ani() 689 len += snprintf(buf + len, sizeof(buf) - len, read_file_ani() 693 len += snprintf(buf + len, sizeof(buf) - len, read_file_ani() 697 len += snprintf(buf + len, sizeof(buf) - len, "AUTO\n"); read_file_ani() 700 len += snprintf(buf + len, sizeof(buf) - len, read_file_ani() 704 len += snprintf(buf + len, sizeof(buf) - len, read_file_ani() 707 len += snprintf(buf + len, sizeof(buf) - len, read_file_ani() 710 len += snprintf(buf + len, sizeof(buf) - len, read_file_ani() 713 len += snprintf(buf + len, sizeof(buf) - len, read_file_ani() 716 len += snprintf(buf + len, sizeof(buf) - len, read_file_ani() 720 len += snprintf(buf + len, sizeof(buf) - len, read_file_ani() 723 len += snprintf(buf + len, sizeof(buf) - len, read_file_ani() 732 len += snprintf(buf + len, sizeof(buf) - len, read_file_ani() 735 len += snprintf(buf + len, sizeof(buf) - len, read_file_ani() 738 len += snprintf(buf + len, sizeof(buf) - len, read_file_ani() 742 len += snprintf(buf + len, sizeof(buf) - len, "profcnt cycles\t\t%u\n", read_file_ani() 744 len += snprintf(buf + len, sizeof(buf) - len, read_file_ani() 747 len += snprintf(buf + len, sizeof(buf) - len, read_file_ani() 751 len += snprintf(buf + len, sizeof(buf) - len, read_file_ani() 755 len += snprintf(buf + len, sizeof(buf) - len, read_file_ani() 760 len += snprintf(buf + len, sizeof(buf) - len, read_file_ani() 766 if (len > sizeof(buf)) read_file_ani() 767 len = sizeof(buf); read_file_ani() 769 return simple_read_from_buffer(user_buf, count, ppos, buf, len); read_file_ani() 777 char buf[20]; write_file_ani() local 779 count = min_t(size_t, count, sizeof(buf) - 1); write_file_ani() 780 if (copy_from_user(buf, userbuf, count)) write_file_ani() 783 buf[count] = '\0'; write_file_ani() 784 if (strncmp(buf, "sens-low", 8) == 0) { write_file_ani() 786 } else if (strncmp(buf, "sens-high", 9) == 0) { write_file_ani() 788 } else if (strncmp(buf, "ani-off", 7) == 0) { write_file_ani() 790 } else if (strncmp(buf, "ani-on", 6) == 0) { write_file_ani() 792 } else if (strncmp(buf, "noise-low", 9) == 0) { write_file_ani() 794 } else if (strncmp(buf, "noise-high", 10) == 0) { write_file_ani() 797 } else if (strncmp(buf, "spur-low", 8) == 0) { write_file_ani() 799 } else if (strncmp(buf, "spur-high", 9) == 0) { write_file_ani() 802 } else if (strncmp(buf, "fir-low", 7) == 0) { write_file_ani() 804 } else if (strncmp(buf, "fir-high", 8) == 0) { write_file_ani() 806 } else if (strncmp(buf, "ofdm-off", 8) == 0) { write_file_ani() 808 } else if (strncmp(buf, "ofdm-on", 7) == 0) { write_file_ani() 810 } else if (strncmp(buf, "cck-off", 7) == 0) { write_file_ani() 812 } else if (strncmp(buf, "cck-on", 6) == 0) { write_file_ani() 833 char buf[700]; read_file_queue() local 840 len += snprintf(buf + len, sizeof(buf) - len, read_file_queue() 846 len += snprintf(buf + len, sizeof(buf) - len, read_file_queue() 858 len += snprintf(buf + len, sizeof(buf) - len, read_file_queue() 860 len += snprintf(buf + len, sizeof(buf) - len, read_file_queue() 864 if (len > sizeof(buf)) read_file_queue() 865 len = sizeof(buf); read_file_queue() 867 return simple_read_from_buffer(user_buf, count, ppos, buf, len); read_file_queue() 875 char buf[20]; write_file_queue() local 877 count = min_t(size_t, count, sizeof(buf) - 1); write_file_queue() 878 if (copy_from_user(buf, userbuf, count)) write_file_queue() 881 buf[count] = '\0'; write_file_queue() 882 if (strncmp(buf, "start", 5) == 0) write_file_queue() 884 else if (strncmp(buf, "stop", 4) == 0) write_file_queue() 902 u16 *buf; member in struct:eeprom_private 913 u16 val, *buf; open_file_eeprom() local 935 buf = vmalloc(eesize); open_file_eeprom() 936 if (!buf) { open_file_eeprom() 943 buf[i] = val; open_file_eeprom() 954 ep->buf = buf; open_file_eeprom() 962 vfree(buf); open_file_eeprom() 973 return simple_read_from_buffer(user_buf, count, ppos, ep->buf, ep->len); read_file_eeprom() 980 vfree(ep->buf); release_file_eeprom()
|
/linux-4.4.14/drivers/media/tuners/ |
H A D | mt20xx.c | 104 unsigned char *buf, mt2032_compute_freq() 163 buf[0]=lo1n-1; mt2032_compute_freq() 164 buf[1]=lo1a | (sel<<4); mt2032_compute_freq() 165 buf[2]=0x86; // LOGC mt2032_compute_freq() 166 buf[3]=0x0f; //reserved mt2032_compute_freq() 167 buf[4]=0x1f; mt2032_compute_freq() 168 buf[5]=(lo2n-1) | (lo2a<<5); mt2032_compute_freq() 170 buf[6]=0xe4; mt2032_compute_freq() 172 buf[6]=0xf4; // set PKEN per rev 1.2 mt2032_compute_freq() 173 buf[7]=8+xogc; mt2032_compute_freq() 174 buf[8]=0xc3; //reserved mt2032_compute_freq() 175 buf[9]=0x4e; //reserved mt2032_compute_freq() 176 buf[10]=0xec; //reserved mt2032_compute_freq() 177 buf[11]=(lo2num&0xff); mt2032_compute_freq() 178 buf[12]=(lo2num>>8) |0x80; // Lo2RST mt2032_compute_freq() 187 unsigned char buf[2]; mt2032_check_lo_lock() local 190 buf[0]=0x0e; mt2032_check_lo_lock() 191 tuner_i2c_xfer_send(&priv->i2c_props,buf,1); mt2032_check_lo_lock() 192 tuner_i2c_xfer_recv(&priv->i2c_props,buf,1); mt2032_check_lo_lock() 193 tuner_dbg("mt2032 Reg.E=0x%02x\n",buf[0]); mt2032_check_lo_lock() 194 lock=buf[0] &0x06; mt2032_check_lo_lock() 199 tuner_dbg("mt2032: pll wait 1ms for lock (0x%2x)\n",buf[0]); mt2032_check_lo_lock() 208 unsigned char buf[2]; mt2032_optimize_vco() local 211 buf[0]=0x0f; mt2032_optimize_vco() 212 tuner_i2c_xfer_send(&priv->i2c_props,buf,1); mt2032_optimize_vco() 213 tuner_i2c_xfer_recv(&priv->i2c_props,buf,1); mt2032_optimize_vco() 214 tuner_dbg("mt2032 Reg.F=0x%02x\n",buf[0]); mt2032_optimize_vco() 215 tad1=buf[0]&0x07; mt2032_optimize_vco() 234 buf[0]=0x0f; mt2032_optimize_vco() 235 buf[1]=sel; mt2032_optimize_vco() 236 tuner_i2c_xfer_send(&priv->i2c_props,buf,2); mt2032_optimize_vco() 246 unsigned char buf[21]; mt2032_set_if_freq() local 253 buf[0]=0; mt2032_set_if_freq() 254 ret=tuner_i2c_xfer_send(&priv->i2c_props,buf,1); mt2032_set_if_freq() 255 tuner_i2c_xfer_recv(&priv->i2c_props,buf,21); mt2032_set_if_freq() 257 buf[0]=0; mt2032_set_if_freq() 258 ret=mt2032_compute_freq(fe,rfin,if1,if2,from,to,&buf[1],&sel,priv->xogc); mt2032_set_if_freq() 263 buf[0]=0; mt2032_set_if_freq() 264 ret=tuner_i2c_xfer_send(&priv->i2c_props,buf,4); mt2032_set_if_freq() 265 buf[5]=5; mt2032_set_if_freq() 266 ret=tuner_i2c_xfer_send(&priv->i2c_props,buf+5,4); mt2032_set_if_freq() 267 buf[11]=11; mt2032_set_if_freq() 268 ret=tuner_i2c_xfer_send(&priv->i2c_props,buf+11,3); mt2032_set_if_freq() 281 buf[0]=7; mt2032_set_if_freq() 282 buf[1]=0x80 +8+priv->xogc; // set LINT to re-init PLLs mt2032_set_if_freq() 283 tuner_i2c_xfer_send(&priv->i2c_props,buf,2); mt2032_set_if_freq() 285 buf[1]=8+priv->xogc; mt2032_set_if_freq() 286 tuner_i2c_xfer_send(&priv->i2c_props,buf,2); mt2032_set_if_freq() 292 buf[0]=2; mt2032_set_if_freq() 293 buf[1]=0x20; // LOGC for optimal phase noise mt2032_set_if_freq() 294 ret=tuner_i2c_xfer_send(&priv->i2c_props,buf,2); mt2032_set_if_freq() 376 unsigned char buf[21]; mt2032_init() local 380 buf[1]=2; // Index to register 2 mt2032_init() 381 buf[2]=0xff; mt2032_init() 382 buf[3]=0x0f; mt2032_init() 383 buf[4]=0x1f; mt2032_init() 384 ret=tuner_i2c_xfer_send(&priv->i2c_props,buf+1,4); mt2032_init() 386 buf[5]=6; // Index register 6 mt2032_init() 387 buf[6]=0xe4; mt2032_init() 388 buf[7]=0x8f; mt2032_init() 389 buf[8]=0xc3; mt2032_init() 390 buf[9]=0x4e; mt2032_init() 391 buf[10]=0xec; mt2032_init() 392 ret=tuner_i2c_xfer_send(&priv->i2c_props,buf+5,6); mt2032_init() 394 buf[12]=13; // Index register 13 mt2032_init() 395 buf[13]=0x32; mt2032_init() 396 ret=tuner_i2c_xfer_send(&priv->i2c_props,buf+12,2); mt2032_init() 403 buf[0]=0x0e; mt2032_init() 404 tuner_i2c_xfer_send(&priv->i2c_props,buf,1); mt2032_init() 405 tuner_i2c_xfer_recv(&priv->i2c_props,buf,1); mt2032_init() 406 xok=buf[0]&0x01; mt2032_init() 416 buf[0]=0x07; mt2032_init() 417 buf[1]=0x88 + xogc; mt2032_init() 418 ret=tuner_i2c_xfer_send(&priv->i2c_props,buf,2); mt2032_init() 432 unsigned char buf[2]; mt2050_set_antenna() local 434 buf[0] = 6; mt2050_set_antenna() 435 buf[1] = antenna ? 0x11 : 0x10; mt2050_set_antenna() 436 tuner_i2c_xfer_send(&priv->i2c_props, buf, 2); mt2050_set_antenna() 446 unsigned char buf[6]; mt2050_set_if_freq() local 480 buf[0]=1; mt2050_set_if_freq() 481 buf[1]= 4*div1b + num1; mt2050_set_if_freq() 482 if(freq<275*1000*1000) buf[1] = buf[1]|0x80; mt2050_set_if_freq() 484 buf[2]=div1a; mt2050_set_if_freq() 485 buf[3]=32*div2b + num2/256; mt2050_set_if_freq() 486 buf[4]=num2-(num2/256)*256; mt2050_set_if_freq() 487 buf[5]=div2a; mt2050_set_if_freq() 488 if(num2!=0) buf[5]=buf[5]|0x40; mt2050_set_if_freq() 494 printk("%x ",buf[i]); mt2050_set_if_freq() 498 ret=tuner_i2c_xfer_send(&priv->i2c_props,buf,6); mt2050_set_if_freq() 575 unsigned char buf[2]; mt2050_init() local 577 buf[0] = 6; mt2050_init() 578 buf[1] = 0x10; mt2050_init() 579 tuner_i2c_xfer_send(&priv->i2c_props, buf, 2); /* power */ mt2050_init() 581 buf[0] = 0x0f; mt2050_init() 582 buf[1] = 0x0f; mt2050_init() 583 tuner_i2c_xfer_send(&priv->i2c_props, buf, 2); /* m1lo */ mt2050_init() 585 buf[0] = 0x0d; mt2050_init() 586 tuner_i2c_xfer_send(&priv->i2c_props, buf, 1); mt2050_init() 587 tuner_i2c_xfer_recv(&priv->i2c_props, buf, 1); mt2050_init() 589 tuner_dbg("mt2050: sro is %x\n", buf[0]); mt2050_init() 602 unsigned char buf[21]; microtune_attach() local 616 memset(buf,0,sizeof(buf)); microtune_attach() 620 tuner_i2c_xfer_send(&priv->i2c_props,buf,1); microtune_attach() 621 tuner_i2c_xfer_recv(&priv->i2c_props,buf,21); microtune_attach() 626 printk(" %02x",buf[i]); microtune_attach() 631 company_code = buf[0x11] << 8 | buf[0x12]; microtune_attach() 633 company_code,buf[0x13],buf[0x14]); microtune_attach() 636 if (buf[0x13] < ARRAY_SIZE(microtune_part) && microtune_attach() 637 NULL != microtune_part[buf[0x13]]) microtune_attach() 638 name = microtune_part[buf[0x13]]; microtune_attach() 639 switch (buf[0x13]) { microtune_attach() 99 mt2032_compute_freq(struct dvb_frontend *fe, unsigned int rfin, unsigned int if1, unsigned int if2, unsigned int spectrum_from, unsigned int spectrum_to, unsigned char *buf, int *ret_sel, unsigned int xogc) mt2032_compute_freq() argument
|
H A D | tda9887.c | 270 static void dump_read_message(struct dvb_frontend *fe, unsigned char *buf) dump_read_message() argument 292 tuner_info("read: 0x%2x\n", buf[0]); dump_read_message() 293 tuner_info(" after power on : %s\n", (buf[0] & 0x01) ? "yes" : "no"); dump_read_message() 294 tuner_info(" afc : %s\n", afc[(buf[0] >> 1) & 0x0f]); dump_read_message() 295 tuner_info(" fmif level : %s\n", (buf[0] & 0x20) ? "high" : "low"); dump_read_message() 296 tuner_info(" afc window : %s\n", (buf[0] & 0x40) ? "in" : "out"); dump_read_message() 297 tuner_info(" vfi level : %s\n", (buf[0] & 0x80) ? "high" : "low"); dump_read_message() 300 static void dump_write_message(struct dvb_frontend *fe, unsigned char *buf) dump_write_message() argument 342 tuner_info("write: byte B 0x%02x\n", buf[1]); dump_write_message() 344 (buf[1] & 0x01) ? "video trap" : "sound trap"); dump_write_message() 346 (buf[1] & 0x02) ? "yes" : "no"); dump_write_message() 348 (buf[1] & 0x04) ? "QSS" : "Intercarrier"); dump_write_message() 350 sound[(buf[1] & 0x18) >> 3]); dump_write_message() 352 (buf[1] & 0x20) ? "yes" : "no"); dump_write_message() 354 (buf[1] & 0x40) ? "high (inactive)" : "low (active)"); dump_write_message() 356 (buf[1] & 0x80) ? "high (inactive)" : "low (active)"); dump_write_message() 358 tuner_info("write: byte C 0x%02x\n", buf[2]); dump_write_message() 360 adjust[buf[2] & 0x1f]); dump_write_message() 362 deemph[(buf[2] & 0x60) >> 5]); dump_write_message() 364 (buf[2] & 0x80) ? "-6" : "0"); dump_write_message() 366 tuner_info("write: byte E 0x%02x\n", buf[3]); dump_write_message() 368 carrier[(buf[3] & 0x03)]); dump_write_message() 370 (buf[3] & 0x40) ? "36" : "13"); dump_write_message() 372 if (buf[1] & 0x08) { dump_write_message() 375 rif[(buf[3] & 0x0c) >> 2]); dump_write_message() 377 (buf[3] & 0x80) dump_write_message() 378 ? ((buf[3] & 0x10) ? "fm-agc radio" : dump_write_message() 384 vif[(buf[3] & 0x1c) >> 2]); dump_write_message() 386 (buf[3] & 0x80) dump_write_message() 387 ? ((buf[3] & 0x20) ? "external" : "normal") dump_write_message() 388 : ((buf[3] & 0x20) ? "minimum" : "normal")); dump_write_message() 390 (buf[3] & 0x80) ? ((buf[3] & 0x20) dump_write_message() 404 char *buf = priv->data; tda9887_set_tvnorm() local 426 buf[1] = norm->b; tda9887_set_tvnorm() 427 buf[2] = norm->c; tda9887_set_tvnorm() 428 buf[3] = norm->e; tda9887_set_tvnorm() 445 char *buf = priv->data; tda9887_set_insmod() local 449 buf[1] |= cOutputPort1Inactive; tda9887_set_insmod() 451 buf[1] &= ~cOutputPort1Inactive; tda9887_set_insmod() 455 buf[1] |= cOutputPort2Inactive; tda9887_set_insmod() 457 buf[1] &= ~cOutputPort2Inactive; tda9887_set_insmod() 462 buf[1] |= cQSS; tda9887_set_insmod() 464 buf[1] &= ~cQSS; tda9887_set_insmod() 468 buf[2] &= ~cTopMask; tda9887_set_insmod() 469 buf[2] |= adjust; tda9887_set_insmod() 477 char *buf = priv->data; tda9887_do_config() local 480 buf[1] &= ~cOutputPort1Inactive; tda9887_do_config() 482 buf[1] |= cOutputPort1Inactive; tda9887_do_config() 484 buf[1] &= ~cOutputPort2Inactive; tda9887_do_config() 486 buf[1] |= cOutputPort2Inactive; tda9887_do_config() 489 buf[1] |= cQSS; tda9887_do_config() 491 buf[1] &= ~cQSS; tda9887_do_config() 494 buf[1] |= cAutoMuteFmActive; tda9887_do_config() 496 buf[2] &= ~0x60; tda9887_do_config() 499 buf[2] |= cDeemphasisOFF; tda9887_do_config() 502 buf[2] |= cDeemphasisON | cDeemphasis50; tda9887_do_config() 505 buf[2] |= cDeemphasisON | cDeemphasis75; tda9887_do_config() 510 buf[2] &= ~cTopMask; tda9887_do_config() 511 buf[2] |= (priv->config >> 8) & cTopMask; tda9887_do_config() 515 buf[1] &= ~cQSS; tda9887_do_config() 517 buf[3] &= ~cGating_36; tda9887_do_config() 521 buf[3] &= ~cVideoIFMask; tda9887_do_config() 522 buf[3] |= cRadioIF_41_30; tda9887_do_config() 525 buf[3] &= ~cTunerGainLow; tda9887_do_config() 536 unsigned char buf[1]; tda9887_status() local 539 rc = tuner_i2c_xfer_recv(&priv->i2c_props, buf, 1); tda9887_status() 542 dump_read_message(fe, buf); tda9887_status()
|
/linux-4.4.14/drivers/media/pci/cx23885/ |
H A D | netup-init.c | 28 u8 buf[3]; i2c_av_write() local 32 .buf = buf, i2c_av_write() 36 buf[0] = reg >> 8; i2c_av_write() 37 buf[1] = reg & 0xff; i2c_av_write() 38 buf[2] = val; i2c_av_write() 49 u8 buf[6]; i2c_av_write4() local 53 .buf = buf, i2c_av_write4() 57 buf[0] = reg >> 8; i2c_av_write4() 58 buf[1] = reg & 0xff; i2c_av_write4() 59 buf[2] = val & 0xff; i2c_av_write4() 60 buf[3] = (val >> 8) & 0xff; i2c_av_write4() 61 buf[4] = (val >> 16) & 0xff; i2c_av_write4() 62 buf[5] = val >> 24; i2c_av_write4() 73 u8 buf[2]; i2c_av_read() local 77 .buf = buf, i2c_av_read() 81 buf[0] = reg >> 8; i2c_av_read() 82 buf[1] = reg & 0xff; i2c_av_read() 97 return buf[0]; i2c_av_read()
|
H A D | cx23885-f300.c | 83 static u8 f300_xfer(struct dvb_frontend *fe, u8 *buf) f300_xfer() argument 89 temp = buf[0]; f300_xfer() 90 for (i = 0; i < buf[0]; i++) f300_xfer() 91 temp += buf[i + 1]; f300_xfer() 93 buf[1 + buf[0]] = temp; f300_xfer() 108 temp = buf[0]; f300_xfer() 111 f300_send_byte(dev, buf[i]); f300_xfer() 149 u8 buf[16]; f300_set_voltage() local 151 buf[0] = 0x05; f300_set_voltage() 152 buf[1] = 0x38;/* write port */ f300_set_voltage() 153 buf[2] = 0x01;/* A port, lnb power */ f300_set_voltage() 157 buf[3] = 0x01;/* power on */ f300_set_voltage() 158 buf[4] = 0x02;/* B port, H/V */ f300_set_voltage() 159 buf[5] = 0x00;/*13V v*/ f300_set_voltage() 162 buf[3] = 0x01; f300_set_voltage() 163 buf[4] = 0x02; f300_set_voltage() 164 buf[5] = 0x01;/* 18V h*/ f300_set_voltage() 167 buf[3] = 0x00;/* power off */ f300_set_voltage() 168 buf[4] = 0x00; f300_set_voltage() 169 buf[5] = 0x00; f300_set_voltage() 173 return f300_xfer(fe, buf); f300_set_voltage()
|
H A D | cx23885-alsa.c | 85 struct cx23885_audio_buffer *buf = chip->buf; cx23885_alsa_dma_init() local 89 buf->vaddr = vmalloc_32(nr_pages << PAGE_SHIFT); cx23885_alsa_dma_init() 90 if (NULL == buf->vaddr) { cx23885_alsa_dma_init() 96 (unsigned long)buf->vaddr, cx23885_alsa_dma_init() 99 memset(buf->vaddr, 0, nr_pages << PAGE_SHIFT); cx23885_alsa_dma_init() 100 buf->nr_pages = nr_pages; cx23885_alsa_dma_init() 102 buf->sglist = vzalloc(buf->nr_pages * sizeof(*buf->sglist)); cx23885_alsa_dma_init() 103 if (NULL == buf->sglist) cx23885_alsa_dma_init() 106 sg_init_table(buf->sglist, buf->nr_pages); cx23885_alsa_dma_init() 107 for (i = 0; i < buf->nr_pages; i++) { cx23885_alsa_dma_init() 108 pg = vmalloc_to_page(buf->vaddr + i * PAGE_SIZE); cx23885_alsa_dma_init() 111 sg_set_page(&buf->sglist[i], pg, PAGE_SIZE, 0); cx23885_alsa_dma_init() 116 vfree(buf->sglist); cx23885_alsa_dma_init() 117 buf->sglist = NULL; cx23885_alsa_dma_init() 119 vfree(buf->vaddr); cx23885_alsa_dma_init() 120 buf->vaddr = NULL; cx23885_alsa_dma_init() 126 struct cx23885_audio_buffer *buf = dev->buf; cx23885_alsa_dma_map() local 128 buf->sglen = dma_map_sg(&dev->pci->dev, buf->sglist, cx23885_alsa_dma_map() 129 buf->nr_pages, PCI_DMA_FROMDEVICE); cx23885_alsa_dma_map() 131 if (0 == buf->sglen) { cx23885_alsa_dma_map() 140 struct cx23885_audio_buffer *buf = dev->buf; cx23885_alsa_dma_unmap() local 142 if (!buf->sglen) cx23885_alsa_dma_unmap() 145 dma_unmap_sg(&dev->pci->dev, buf->sglist, buf->sglen, PCI_DMA_FROMDEVICE); cx23885_alsa_dma_unmap() 146 buf->sglen = 0; cx23885_alsa_dma_unmap() 150 static int cx23885_alsa_dma_free(struct cx23885_audio_buffer *buf) cx23885_alsa_dma_free() argument 152 vfree(buf->sglist); cx23885_alsa_dma_free() 153 buf->sglist = NULL; cx23885_alsa_dma_free() 154 vfree(buf->vaddr); cx23885_alsa_dma_free() 155 buf->vaddr = NULL; cx23885_alsa_dma_free() 165 struct cx23885_audio_buffer *buf = chip->buf; cx23885_start_audio_dma() local 176 cx23885_sram_channel_setup(chip->dev, audio_ch, buf->bpl, cx23885_start_audio_dma() 177 buf->risc.dma); cx23885_start_audio_dma() 180 cx_write(AUD_INT_A_LNGTH, buf->bpl); cx23885_start_audio_dma() 190 "byte buffer\n", buf->bpl, cx_read(audio_ch->cmds_start+12)>>1, cx23885_start_audio_dma() 191 chip->num_periods, buf->bpl * chip->num_periods); cx23885_start_audio_dma() 279 cx23885_alsa_dma_free(chip->buf); dsp_buffer_free() 280 risc = &chip->buf->risc; dsp_buffer_free() 282 kfree(chip->buf); dsp_buffer_free() 284 chip->buf = NULL; dsp_buffer_free() 375 struct cx23885_audio_buffer *buf; snd_cx23885_hw_params() local 390 buf = kzalloc(sizeof(*buf), GFP_KERNEL); snd_cx23885_hw_params() 391 if (NULL == buf) snd_cx23885_hw_params() 394 buf->bpl = chip->period_size; snd_cx23885_hw_params() 395 chip->buf = buf; snd_cx23885_hw_params() 406 ret = cx23885_risc_databuffer(chip->pci, &buf->risc, buf->sglist, snd_cx23885_hw_params() 412 buf->risc.jmp[0] = cpu_to_le32(RISC_JUMP|RISC_IRQ1|RISC_CNT_INC); snd_cx23885_hw_params() 413 buf->risc.jmp[1] = cpu_to_le32(buf->risc.dma); snd_cx23885_hw_params() 414 buf->risc.jmp[2] = cpu_to_le32(0); /* bits 63-32 */ snd_cx23885_hw_params() 416 substream->runtime->dma_area = chip->buf->vaddr; snd_cx23885_hw_params() 423 kfree(buf); snd_cx23885_hw_params() 424 chip->buf = NULL; snd_cx23885_hw_params()
|
H A D | netup-eeprom.c | 31 unsigned char buf[2]; netup_eeprom_read() local 38 .buf = &buf[0], netup_eeprom_read() 43 .buf = &buf[1], netup_eeprom_read() 49 buf[0] = addr; netup_eeprom_read() 50 buf[1] = 0x0; netup_eeprom_read() 59 return buf[1]; netup_eeprom_read() 72 .buf = &bufw[0], netup_eeprom_write()
|
/linux-4.4.14/arch/um/include/shared/ |
H A D | longjmp.h | 10 #define UML_LONGJMP(buf, val) do { \ 11 longjmp(*buf, val); \ 14 #define UML_SETJMP(buf) ({ \ 18 n = setjmp(*buf); \
|
/linux-4.4.14/fs/f2fs/ |
H A D | hash.c | 28 static void TEA_transform(unsigned int buf[4], unsigned int const in[]) TEA_transform() argument 31 __u32 b0 = buf[0], b1 = buf[1]; TEA_transform() 41 buf[0] += b0; TEA_transform() 42 buf[1] += b1; TEA_transform() 46 unsigned int *buf, int num) str2hashbuf() 62 *buf++ = val; str2hashbuf() 68 *buf++ = val; str2hashbuf() 70 *buf++ = pad; str2hashbuf() 78 __u32 in[8], buf[4]; f2fs_dentry_hash() local 86 buf[0] = 0x67452301; f2fs_dentry_hash() 87 buf[1] = 0xefcdab89; f2fs_dentry_hash() 88 buf[2] = 0x98badcfe; f2fs_dentry_hash() 89 buf[3] = 0x10325476; f2fs_dentry_hash() 94 TEA_transform(buf, in); f2fs_dentry_hash() 100 hash = buf[0]; f2fs_dentry_hash() 45 str2hashbuf(const unsigned char *msg, size_t len, unsigned int *buf, int num) str2hashbuf() argument
|
/linux-4.4.14/drivers/net/wireless/ath/ath9k/ |
H A D | htc_drv_debug.c | 24 char buf[512]; read_file_tgt_int_stats() local 40 len += scnprintf(buf + len, sizeof(buf) - len, read_file_tgt_int_stats() 44 len += scnprintf(buf + len, sizeof(buf) - len, read_file_tgt_int_stats() 48 len += scnprintf(buf + len, sizeof(buf) - len, read_file_tgt_int_stats() 52 len += scnprintf(buf + len, sizeof(buf) - len, read_file_tgt_int_stats() 56 len += scnprintf(buf + len, sizeof(buf) - len, read_file_tgt_int_stats() 60 len += scnprintf(buf + len, sizeof(buf) - len, read_file_tgt_int_stats() 64 if (len > sizeof(buf)) read_file_tgt_int_stats() 65 len = sizeof(buf); read_file_tgt_int_stats() 67 return simple_read_from_buffer(user_buf, count, ppos, buf, len); read_file_tgt_int_stats() 82 char buf[512]; read_file_tgt_tx_stats() local 98 len += scnprintf(buf + len, sizeof(buf) - len, read_file_tgt_tx_stats() 102 len += scnprintf(buf + len, sizeof(buf) - len, read_file_tgt_tx_stats() 106 len += scnprintf(buf + len, sizeof(buf) - len, read_file_tgt_tx_stats() 110 len += scnprintf(buf + len, sizeof(buf) - len, read_file_tgt_tx_stats() 114 len += scnprintf(buf + len, sizeof(buf) - len, read_file_tgt_tx_stats() 118 len += scnprintf(buf + len, sizeof(buf) - len, read_file_tgt_tx_stats() 122 len += scnprintf(buf + len, sizeof(buf) - len, read_file_tgt_tx_stats() 126 len += scnprintf(buf + len, sizeof(buf) - len, read_file_tgt_tx_stats() 130 len += scnprintf(buf + len, sizeof(buf) - len, read_file_tgt_tx_stats() 134 if (len > sizeof(buf)) read_file_tgt_tx_stats() 135 len = sizeof(buf); read_file_tgt_tx_stats() 137 return simple_read_from_buffer(user_buf, count, ppos, buf, len); read_file_tgt_tx_stats() 152 char buf[512]; read_file_tgt_rx_stats() local 168 len += scnprintf(buf + len, sizeof(buf) - len, read_file_tgt_rx_stats() 172 len += scnprintf(buf + len, sizeof(buf) - len, read_file_tgt_rx_stats() 176 len += scnprintf(buf + len, sizeof(buf) - len, read_file_tgt_rx_stats() 180 if (len > sizeof(buf)) read_file_tgt_rx_stats() 181 len = sizeof(buf); read_file_tgt_rx_stats() 183 return simple_read_from_buffer(user_buf, count, ppos, buf, len); read_file_tgt_rx_stats() 197 char buf[512]; read_file_xmit() local 200 len += scnprintf(buf + len, sizeof(buf) - len, read_file_xmit() 203 len += scnprintf(buf + len, sizeof(buf) - len, read_file_xmit() 206 len += scnprintf(buf + len, sizeof(buf) - len, read_file_xmit() 209 len += scnprintf(buf + len, sizeof(buf) - len, read_file_xmit() 212 len += scnprintf(buf + len, sizeof(buf) - len, read_file_xmit() 215 len += scnprintf(buf + len, sizeof(buf) - len, read_file_xmit() 219 len += scnprintf(buf + len, sizeof(buf) - len, read_file_xmit() 222 len += scnprintf(buf + len, sizeof(buf) - len, read_file_xmit() 225 len += scnprintf(buf + len, sizeof(buf) - len, read_file_xmit() 228 len += scnprintf(buf + len, sizeof(buf) - len, read_file_xmit() 232 if (len > sizeof(buf)) read_file_xmit() 233 len = sizeof(buf); read_file_xmit() 235 return simple_read_from_buffer(user_buf, count, ppos, buf, len); read_file_xmit() 255 char *buf; read_file_skb_rx() local 259 buf = kzalloc(size, GFP_KERNEL); read_file_skb_rx() 260 if (buf == NULL) read_file_skb_rx() 263 len += scnprintf(buf + len, size - len, read_file_skb_rx() 266 len += scnprintf(buf + len, size - len, read_file_skb_rx() 269 len += scnprintf(buf + len, size - len, read_file_skb_rx() 276 retval = simple_read_from_buffer(user_buf, count, ppos, buf, len); read_file_skb_rx() 277 kfree(buf); read_file_skb_rx() 293 char buf[512]; read_file_slot() local 297 len = scnprintf(buf, sizeof(buf), read_file_slot() 303 return simple_read_from_buffer(user_buf, count, ppos, buf, len); read_file_slot() 317 char buf[512]; read_file_queue() local 320 len += scnprintf(buf + len, sizeof(buf) - len, "%20s : %10u\n", read_file_queue() 323 len += scnprintf(buf + len, sizeof(buf) - len, "%20s : %10u\n", read_file_queue() 326 len += scnprintf(buf + len, sizeof(buf) - len, "%20s : %10u\n", read_file_queue() 329 len += scnprintf(buf + len, sizeof(buf) - len, "%20s : %10u\n", read_file_queue() 332 len += scnprintf(buf + len, sizeof(buf) - len, "%20s : %10u\n", read_file_queue() 335 len += scnprintf(buf + len, sizeof(buf) - len, "%20s : %10u\n", read_file_queue() 338 len += scnprintf(buf + len, sizeof(buf) - len, "%20s : %10u\n", read_file_queue() 342 len += scnprintf(buf + len, sizeof(buf) - len, "%20s : %10u\n", read_file_queue() 346 if (len > sizeof(buf)) read_file_queue() 347 len = sizeof(buf); read_file_queue() 349 return simple_read_from_buffer(user_buf, count, ppos, buf, len); read_file_queue() 365 char buf[32]; read_file_debug() local 368 len = sprintf(buf, "0x%08x\n", common->debug_mask); read_file_debug() 369 return simple_read_from_buffer(user_buf, count, ppos, buf, len); read_file_debug() 378 char buf[32]; write_file_debug() local 381 len = min(count, sizeof(buf) - 1); write_file_debug() 382 if (copy_from_user(buf, user_buf, len)) write_file_debug() 385 buf[len] = '\0'; write_file_debug() 386 if (kstrtoul(buf, 0, &mask)) write_file_debug()
|
/linux-4.4.14/drivers/media/pci/ivtv/ |
H A D | ivtv-queue.c | 25 int ivtv_buf_copy_from_user(struct ivtv_stream *s, struct ivtv_buffer *buf, const char __user *src, int copybytes) ivtv_buf_copy_from_user() argument 27 if (s->buf_size - buf->bytesused < copybytes) ivtv_buf_copy_from_user() 28 copybytes = s->buf_size - buf->bytesused; ivtv_buf_copy_from_user() 29 if (copy_from_user(buf->buf + buf->bytesused, src, copybytes)) { ivtv_buf_copy_from_user() 32 buf->bytesused += copybytes; ivtv_buf_copy_from_user() 36 void ivtv_buf_swap(struct ivtv_buffer *buf) ivtv_buf_swap() argument 40 for (i = 0; i < buf->bytesused; i += 4) ivtv_buf_swap() 41 swab32s((u32 *)(buf->buf + i)); ivtv_buf_swap() 52 void ivtv_enqueue(struct ivtv_stream *s, struct ivtv_buffer *buf, struct ivtv_queue *q) ivtv_enqueue() argument 58 buf->bytesused = 0; ivtv_enqueue() 59 buf->readpos = 0; ivtv_enqueue() 60 buf->b_flags = 0; ivtv_enqueue() 61 buf->dma_xfer_cnt = 0; ivtv_enqueue() 64 list_add_tail(&buf->list, &q->list); ivtv_enqueue() 67 q->bytesused += buf->bytesused - buf->readpos; ivtv_enqueue() 73 struct ivtv_buffer *buf = NULL; ivtv_dequeue() local 78 buf = list_entry(q->list.next, struct ivtv_buffer, list); ivtv_dequeue() 82 q->bytesused -= buf->bytesused - buf->readpos; ivtv_dequeue() 85 return buf; ivtv_dequeue() 91 struct ivtv_buffer *buf = list_entry(from->list.next, struct ivtv_buffer, list); ivtv_queue_move_buf() local 96 from->bytesused -= buf->bytesused - buf->readpos; ivtv_queue_move_buf() 99 buf->bytesused = buf->readpos = buf->b_flags = buf->dma_xfer_cnt = 0; ivtv_queue_move_buf() 102 to->bytesused += buf->bytesused - buf->readpos; ivtv_queue_move_buf() 145 struct ivtv_buffer *buf = list_entry(steal->list.prev, struct ivtv_buffer, list); ivtv_queue_move() local 146 u16 dma_xfer_cnt = buf->dma_xfer_cnt; ivtv_queue_move() 152 while (dma_xfer_cnt == buf->dma_xfer_cnt) { ivtv_queue_move() 157 steal->bytesused -= buf->bytesused - buf->readpos; ivtv_queue_move() 158 buf->bytesused = buf->readpos = buf->b_flags = buf->dma_xfer_cnt = 0; ivtv_queue_move() 164 buf = list_entry(steal->list.prev, struct ivtv_buffer, list); ivtv_queue_move() 240 struct ivtv_buffer *buf = kzalloc(sizeof(struct ivtv_buffer), ivtv_stream_alloc() local 243 if (buf == NULL) ivtv_stream_alloc() 245 buf->buf = kmalloc(s->buf_size + 256, GFP_KERNEL|__GFP_NOWARN); ivtv_stream_alloc() 246 if (buf->buf == NULL) { ivtv_stream_alloc() 247 kfree(buf); ivtv_stream_alloc() 250 INIT_LIST_HEAD(&buf->list); ivtv_stream_alloc() 252 buf->dma_handle = pci_map_single(s->itv->pdev, ivtv_stream_alloc() 253 buf->buf, s->buf_size + 256, s->dma); ivtv_stream_alloc() 254 ivtv_buf_sync_for_cpu(s, buf); ivtv_stream_alloc() 256 ivtv_enqueue(s, buf, &s->q_free); ivtv_stream_alloc() 267 struct ivtv_buffer *buf; ivtv_stream_free() local 273 while ((buf = ivtv_dequeue(s, &s->q_free))) { ivtv_stream_free() 275 pci_unmap_single(s->itv->pdev, buf->dma_handle, ivtv_stream_free() 277 kfree(buf->buf); ivtv_stream_free() 278 kfree(buf); ivtv_stream_free()
|
/linux-4.4.14/arch/mips/mm/ |
H A D | page.c | 106 pg_addiu(u32 **buf, unsigned int reg1, unsigned int reg2, unsigned int off) pg_addiu() argument 110 uasm_i_lui(buf, T9, uasm_rel_hi(off)); pg_addiu() 111 uasm_i_addiu(buf, T9, T9, uasm_rel_lo(off)); pg_addiu() 113 uasm_i_addiu(buf, T9, ZERO, off); pg_addiu() 114 uasm_i_daddu(buf, reg1, reg2, T9); pg_addiu() 117 uasm_i_lui(buf, T9, uasm_rel_hi(off)); pg_addiu() 118 uasm_i_addiu(buf, T9, T9, uasm_rel_lo(off)); pg_addiu() 119 UASM_i_ADDU(buf, reg1, reg2, T9); pg_addiu() 121 UASM_i_ADDIU(buf, reg1, reg2, off); pg_addiu() 225 static void build_clear_store(u32 **buf, int off) build_clear_store() argument 228 uasm_i_sd(buf, ZERO, off, A0); build_clear_store() 230 uasm_i_sw(buf, ZERO, off, A0); build_clear_store() 234 static inline void build_clear_pref(u32 **buf, int off) build_clear_pref() argument 240 _uasm_i_pref(buf, pref_dst_mode, pref_bias_clear_store + off, build_clear_pref() 244 uasm_i_cache(buf, Create_Dirty_Excl_SD, off, A0); build_clear_pref() 247 uasm_i_nop(buf); build_clear_pref() 248 uasm_i_nop(buf); build_clear_pref() 249 uasm_i_nop(buf); build_clear_pref() 250 uasm_i_nop(buf); build_clear_pref() 254 uasm_i_lw(buf, ZERO, ZERO, AT); build_clear_pref() 256 uasm_i_cache(buf, Create_Dirty_Excl_D, off, A0); build_clear_pref() 269 u32 *buf = &__clear_page_start; build_clear_page() local 294 pg_addiu(&buf, A2, A0, off); build_clear_page() 296 uasm_i_ori(&buf, A2, A0, off); build_clear_page() 299 uasm_i_lui(&buf, AT, uasm_rel_hi(0xa0000000)); build_clear_page() 304 build_clear_pref(&buf, -off); build_clear_page() 307 uasm_l_clear_pref(&l, buf); build_clear_page() 309 build_clear_pref(&buf, off); build_clear_page() 310 build_clear_store(&buf, off); build_clear_page() 313 pg_addiu(&buf, A0, A0, 2 * off); build_clear_page() 316 build_clear_pref(&buf, off); build_clear_page() 318 uasm_il_bne(&buf, &r, A0, A2, label_clear_pref); build_clear_page() 319 build_clear_store(&buf, off); build_clear_page() 324 pg_addiu(&buf, A2, A0, pref_bias_clear_store); build_clear_page() 325 uasm_l_clear_nopref(&l, buf); build_clear_page() 328 build_clear_store(&buf, off); build_clear_page() 331 pg_addiu(&buf, A0, A0, 2 * off); build_clear_page() 335 uasm_il_bne(&buf, &r, A0, A2, build_clear_page() 337 build_clear_store(&buf, off); build_clear_page() 342 uasm_i_jr(&buf, RA); build_clear_page() 343 uasm_i_nop(&buf); build_clear_page() 345 BUG_ON(buf > &__clear_page_end); build_clear_page() 350 (u32)(buf - &__clear_page_start)); build_clear_page() 354 for (i = 0; i < (buf - &__clear_page_start); i++) build_clear_page() 359 static void build_copy_load(u32 **buf, int reg, int off) build_copy_load() argument 362 uasm_i_ld(buf, reg, off, A1); build_copy_load() 364 uasm_i_lw(buf, reg, off, A1); build_copy_load() 368 static void build_copy_store(u32 **buf, int reg, int off) build_copy_store() argument 371 uasm_i_sd(buf, reg, off, A0); build_copy_store() 373 uasm_i_sw(buf, reg, off, A0); build_copy_store() 377 static inline void build_copy_load_pref(u32 **buf, int off) build_copy_load_pref() argument 383 _uasm_i_pref(buf, pref_src_mode, pref_bias_copy_load + off, A1); build_copy_load_pref() 386 static inline void build_copy_store_pref(u32 **buf, int off) build_copy_store_pref() argument 392 _uasm_i_pref(buf, pref_dst_mode, pref_bias_copy_store + off, build_copy_store_pref() 396 uasm_i_cache(buf, Create_Dirty_Excl_SD, off, A0); build_copy_store_pref() 399 uasm_i_nop(buf); build_copy_store_pref() 400 uasm_i_nop(buf); build_copy_store_pref() 401 uasm_i_nop(buf); build_copy_store_pref() 402 uasm_i_nop(buf); build_copy_store_pref() 406 uasm_i_lw(buf, ZERO, ZERO, AT); build_copy_store_pref() 408 uasm_i_cache(buf, Create_Dirty_Excl_D, off, A0); build_copy_store_pref() 416 u32 *buf = &__copy_page_start; build_copy_page() local 445 pg_addiu(&buf, A2, A0, off); build_copy_page() 447 uasm_i_ori(&buf, A2, A0, off); build_copy_page() 450 uasm_i_lui(&buf, AT, uasm_rel_hi(0xa0000000)); build_copy_page() 455 build_copy_load_pref(&buf, -off); build_copy_page() 461 build_copy_store_pref(&buf, -off); build_copy_page() 464 uasm_l_copy_pref_both(&l, buf); build_copy_page() 466 build_copy_load_pref(&buf, off); build_copy_page() 467 build_copy_load(&buf, T0, off); build_copy_page() 468 build_copy_load_pref(&buf, off + copy_word_size); build_copy_page() 469 build_copy_load(&buf, T1, off + copy_word_size); build_copy_page() 470 build_copy_load_pref(&buf, off + 2 * copy_word_size); build_copy_page() 471 build_copy_load(&buf, T2, off + 2 * copy_word_size); build_copy_page() 472 build_copy_load_pref(&buf, off + 3 * copy_word_size); build_copy_page() 473 build_copy_load(&buf, T3, off + 3 * copy_word_size); build_copy_page() 474 build_copy_store_pref(&buf, off); build_copy_page() 475 build_copy_store(&buf, T0, off); build_copy_page() 476 build_copy_store_pref(&buf, off + copy_word_size); build_copy_page() 477 build_copy_store(&buf, T1, off + copy_word_size); build_copy_page() 478 build_copy_store_pref(&buf, off + 2 * copy_word_size); build_copy_page() 479 build_copy_store(&buf, T2, off + 2 * copy_word_size); build_copy_page() 480 build_copy_store_pref(&buf, off + 3 * copy_word_size); build_copy_page() 481 build_copy_store(&buf, T3, off + 3 * copy_word_size); build_copy_page() 484 pg_addiu(&buf, A1, A1, 2 * off); build_copy_page() 485 pg_addiu(&buf, A0, A0, 2 * off); build_copy_page() 488 build_copy_load_pref(&buf, off); build_copy_page() 489 build_copy_load(&buf, T0, off); build_copy_page() 490 build_copy_load_pref(&buf, off + copy_word_size); build_copy_page() 491 build_copy_load(&buf, T1, off + copy_word_size); build_copy_page() 492 build_copy_load_pref(&buf, off + 2 * copy_word_size); build_copy_page() 493 build_copy_load(&buf, T2, off + 2 * copy_word_size); build_copy_page() 494 build_copy_load_pref(&buf, off + 3 * copy_word_size); build_copy_page() 495 build_copy_load(&buf, T3, off + 3 * copy_word_size); build_copy_page() 496 build_copy_store_pref(&buf, off); build_copy_page() 497 build_copy_store(&buf, T0, off); build_copy_page() 498 build_copy_store_pref(&buf, off + copy_word_size); build_copy_page() 499 build_copy_store(&buf, T1, off + copy_word_size); build_copy_page() 500 build_copy_store_pref(&buf, off + 2 * copy_word_size); build_copy_page() 501 build_copy_store(&buf, T2, off + 2 * copy_word_size); build_copy_page() 502 build_copy_store_pref(&buf, off + 3 * copy_word_size); build_copy_page() 504 uasm_il_bne(&buf, &r, A2, A0, label_copy_pref_both); build_copy_page() 505 build_copy_store(&buf, T3, off + 3 * copy_word_size); build_copy_page() 510 pg_addiu(&buf, A2, A0, build_copy_page() 512 uasm_l_copy_pref_store(&l, buf); build_copy_page() 515 build_copy_load(&buf, T0, off); build_copy_page() 516 build_copy_load(&buf, T1, off + copy_word_size); build_copy_page() 517 build_copy_load(&buf, T2, off + 2 * copy_word_size); build_copy_page() 518 build_copy_load(&buf, T3, off + 3 * copy_word_size); build_copy_page() 519 build_copy_store_pref(&buf, off); build_copy_page() 520 build_copy_store(&buf, T0, off); build_copy_page() 521 build_copy_store_pref(&buf, off + copy_word_size); build_copy_page() 522 build_copy_store(&buf, T1, off + copy_word_size); build_copy_page() 523 build_copy_store_pref(&buf, off + 2 * copy_word_size); build_copy_page() 524 build_copy_store(&buf, T2, off + 2 * copy_word_size); build_copy_page() 525 build_copy_store_pref(&buf, off + 3 * copy_word_size); build_copy_page() 526 build_copy_store(&buf, T3, off + 3 * copy_word_size); build_copy_page() 529 pg_addiu(&buf, A1, A1, 2 * off); build_copy_page() 530 pg_addiu(&buf, A0, A0, 2 * off); build_copy_page() 533 build_copy_load(&buf, T0, off); build_copy_page() 534 build_copy_load(&buf, T1, off + copy_word_size); build_copy_page() 535 build_copy_load(&buf, T2, off + 2 * copy_word_size); build_copy_page() 536 build_copy_load(&buf, T3, off + 3 * copy_word_size); build_copy_page() 537 build_copy_store_pref(&buf, off); build_copy_page() 538 build_copy_store(&buf, T0, off); build_copy_page() 539 build_copy_store_pref(&buf, off + copy_word_size); build_copy_page() 540 build_copy_store(&buf, T1, off + copy_word_size); build_copy_page() 541 build_copy_store_pref(&buf, off + 2 * copy_word_size); build_copy_page() 542 build_copy_store(&buf, T2, off + 2 * copy_word_size); build_copy_page() 543 build_copy_store_pref(&buf, off + 3 * copy_word_size); build_copy_page() 545 uasm_il_bne(&buf, &r, A2, A0, build_copy_page() 547 build_copy_store(&buf, T3, off + 3 * copy_word_size); build_copy_page() 553 pg_addiu(&buf, A2, A0, pref_bias_copy_store); build_copy_page() 554 uasm_l_copy_nopref(&l, buf); build_copy_page() 557 build_copy_load(&buf, T0, off); build_copy_page() 558 build_copy_load(&buf, T1, off + copy_word_size); build_copy_page() 559 build_copy_load(&buf, T2, off + 2 * copy_word_size); build_copy_page() 560 build_copy_load(&buf, T3, off + 3 * copy_word_size); build_copy_page() 561 build_copy_store(&buf, T0, off); build_copy_page() 562 build_copy_store(&buf, T1, off + copy_word_size); build_copy_page() 563 build_copy_store(&buf, T2, off + 2 * copy_word_size); build_copy_page() 564 build_copy_store(&buf, T3, off + 3 * copy_word_size); build_copy_page() 567 pg_addiu(&buf, A1, A1, 2 * off); build_copy_page() 568 pg_addiu(&buf, A0, A0, 2 * off); build_copy_page() 571 build_copy_load(&buf, T0, off); build_copy_page() 572 build_copy_load(&buf, T1, off + copy_word_size); build_copy_page() 573 build_copy_load(&buf, T2, off + 2 * copy_word_size); build_copy_page() 574 build_copy_load(&buf, T3, off + 3 * copy_word_size); build_copy_page() 575 build_copy_store(&buf, T0, off); build_copy_page() 576 build_copy_store(&buf, T1, off + copy_word_size); build_copy_page() 577 build_copy_store(&buf, T2, off + 2 * copy_word_size); build_copy_page() 579 uasm_il_bne(&buf, &r, A2, A0, build_copy_page() 581 build_copy_store(&buf, T3, off + 3 * copy_word_size); build_copy_page() 586 uasm_i_jr(&buf, RA); build_copy_page() 587 uasm_i_nop(&buf); build_copy_page() 589 BUG_ON(buf > &__copy_page_end); build_copy_page() 594 (u32)(buf - &__copy_page_start)); build_copy_page() 598 for (i = 0; i < (buf - &__copy_page_start); i++) build_copy_page()
|
H A D | sc-debugfs.c | 21 char buf[3]; sc_prefetch_read() local 23 buf[0] = enabled ? 'Y' : 'N'; sc_prefetch_read() 24 buf[1] = '\n'; sc_prefetch_read() 25 buf[2] = 0; sc_prefetch_read() 27 return simple_read_from_buffer(user_buf, count, ppos, buf, 2); sc_prefetch_read() 34 char buf[32]; sc_prefetch_write() local 39 buf_size = min(count, sizeof(buf) - 1); sc_prefetch_write() 40 if (copy_from_user(buf, user_buf, buf_size)) sc_prefetch_write() 43 buf[buf_size] = '\0'; sc_prefetch_write() 44 err = strtobool(buf, &enabled); sc_prefetch_write()
|
/linux-4.4.14/arch/alpha/lib/ |
H A D | srm_printk.c | 11 static char buf[1024]; srm_printk() local 17 len = vsprintf(buf, fmt, args); srm_printk() 23 for (src = buf; *src; ++src) { srm_printk() 31 for (dst = src + num_lf; src >= buf; ) { srm_printk() 39 srm_puts(buf, num_lf+len); srm_printk()
|
/linux-4.4.14/drivers/net/wireless/iwlegacy/ |
H A D | debug.c | 236 char *buf; il_dbgfs_tx_stats_read() local 243 buf = kzalloc(bufsz, GFP_KERNEL); il_dbgfs_tx_stats_read() 244 if (!buf) il_dbgfs_tx_stats_read() 246 pos += scnprintf(buf + pos, bufsz - pos, "Management:\n"); il_dbgfs_tx_stats_read() 249 scnprintf(buf + pos, bufsz - pos, "\t%25s\t\t: %u\n", il_dbgfs_tx_stats_read() 252 pos += scnprintf(buf + pos, bufsz - pos, "Control\n"); il_dbgfs_tx_stats_read() 255 scnprintf(buf + pos, bufsz - pos, "\t%25s\t\t: %u\n", il_dbgfs_tx_stats_read() 258 pos += scnprintf(buf + pos, bufsz - pos, "Data:\n"); il_dbgfs_tx_stats_read() 260 scnprintf(buf + pos, bufsz - pos, "\tcnt: %u\n", il_dbgfs_tx_stats_read() 263 scnprintf(buf + pos, bufsz - pos, "\tbytes: %llu\n", il_dbgfs_tx_stats_read() 265 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); il_dbgfs_tx_stats_read() 266 kfree(buf); il_dbgfs_tx_stats_read() 277 char buf[8]; il_dbgfs_clear_traffic_stats_write() local 280 memset(buf, 0, sizeof(buf)); il_dbgfs_clear_traffic_stats_write() 281 buf_size = min(count, sizeof(buf) - 1); il_dbgfs_clear_traffic_stats_write() 282 if (copy_from_user(buf, user_buf, buf_size)) il_dbgfs_clear_traffic_stats_write() 284 if (sscanf(buf, "%x", &clear_flag) != 1) il_dbgfs_clear_traffic_stats_write() 297 char *buf; il_dbgfs_rx_stats_read() local 303 buf = kzalloc(bufsz, GFP_KERNEL); il_dbgfs_rx_stats_read() 304 if (!buf) il_dbgfs_rx_stats_read() 307 pos += scnprintf(buf + pos, bufsz - pos, "Management:\n"); il_dbgfs_rx_stats_read() 310 scnprintf(buf + pos, bufsz - pos, "\t%25s\t\t: %u\n", il_dbgfs_rx_stats_read() 313 pos += scnprintf(buf + pos, bufsz - pos, "Control:\n"); il_dbgfs_rx_stats_read() 316 scnprintf(buf + pos, bufsz - pos, "\t%25s\t\t: %u\n", il_dbgfs_rx_stats_read() 319 pos += scnprintf(buf + pos, bufsz - pos, "Data:\n"); il_dbgfs_rx_stats_read() 321 scnprintf(buf + pos, bufsz - pos, "\tcnt: %u\n", il_dbgfs_rx_stats_read() 324 scnprintf(buf + pos, bufsz - pos, "\tbytes: %llu\n", il_dbgfs_rx_stats_read() 327 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); il_dbgfs_rx_stats_read() 328 kfree(buf); il_dbgfs_rx_stats_read() 340 char *buf; il_dbgfs_sram_read() local 356 buf = kmalloc(bufsz, GFP_KERNEL); il_dbgfs_sram_read() 357 if (!buf) il_dbgfs_sram_read() 360 scnprintf(buf + pos, bufsz - pos, "sram_len: 0x%x\n", il_dbgfs_sram_read() 363 scnprintf(buf + pos, bufsz - pos, "sram_offset: 0x%x\n", il_dbgfs_sram_read() 384 pos += scnprintf(buf + pos, bufsz - pos, "\n"); il_dbgfs_sram_read() 385 pos += scnprintf(buf + pos, bufsz - pos, "0x%08x ", val); il_dbgfs_sram_read() 387 pos += scnprintf(buf + pos, bufsz - pos, "\n"); il_dbgfs_sram_read() 389 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); il_dbgfs_sram_read() 390 kfree(buf); il_dbgfs_sram_read() 399 char buf[64]; il_dbgfs_sram_write() local 403 memset(buf, 0, sizeof(buf)); il_dbgfs_sram_write() 404 buf_size = min(count, sizeof(buf) - 1); il_dbgfs_sram_write() 405 if (copy_from_user(buf, user_buf, buf_size)) il_dbgfs_sram_write() 408 if (sscanf(buf, "%x,%x", &offset, &len) == 2) { il_dbgfs_sram_write() 426 char *buf; il_dbgfs_stations_read() local 432 buf = kmalloc(bufsz, GFP_KERNEL); il_dbgfs_stations_read() 433 if (!buf) il_dbgfs_stations_read() 437 scnprintf(buf + pos, bufsz - pos, "num of stations: %d\n\n", il_dbgfs_stations_read() 445 scnprintf(buf + pos, bufsz - pos, il_dbgfs_stations_read() 450 scnprintf(buf + pos, bufsz - pos, il_dbgfs_stations_read() 453 scnprintf(buf + pos, bufsz - pos, il_dbgfs_stations_read() 458 scnprintf(buf + pos, bufsz - pos, il_dbgfs_stations_read() 470 scnprintf(buf + pos, bufsz - pos, il_dbgfs_stations_read() 472 pos += scnprintf(buf + pos, bufsz - pos, "\n"); il_dbgfs_stations_read() 475 pos += scnprintf(buf + pos, bufsz - pos, "\n"); il_dbgfs_stations_read() 478 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); il_dbgfs_stations_read() 479 kfree(buf); il_dbgfs_stations_read() 491 char *buf; il_dbgfs_nvm_read() local 508 buf = kzalloc(buf_size, GFP_KERNEL); il_dbgfs_nvm_read() 509 if (!buf) { il_dbgfs_nvm_read() 515 scnprintf(buf + pos, buf_size - pos, "EEPROM " "version: 0x%x\n", il_dbgfs_nvm_read() 518 pos += scnprintf(buf + pos, buf_size - pos, "0x%.4x %16ph\n", il_dbgfs_nvm_read() 522 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); il_dbgfs_nvm_read() 523 kfree(buf); il_dbgfs_nvm_read() 535 char *buf; il_dbgfs_channels_read() local 541 buf = kzalloc(bufsz, GFP_KERNEL); il_dbgfs_channels_read() 542 if (!buf) { il_dbgfs_channels_read() 552 scnprintf(buf + pos, bufsz - pos, il_dbgfs_channels_read() 558 scnprintf(buf + pos, bufsz - pos, il_dbgfs_channels_read() 579 scnprintf(buf + pos, bufsz - pos, il_dbgfs_channels_read() 585 scnprintf(buf + pos, bufsz - pos, il_dbgfs_channels_read() 601 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); il_dbgfs_channels_read() 602 kfree(buf); il_dbgfs_channels_read() 612 char buf[512]; il_dbgfs_status_read() local 614 const size_t bufsz = sizeof(buf); il_dbgfs_status_read() 617 scnprintf(buf + pos, bufsz - pos, "S_HCMD_ACTIVE:\t %d\n", il_dbgfs_status_read() 620 scnprintf(buf + pos, bufsz - pos, "S_INT_ENABLED:\t %d\n", il_dbgfs_status_read() 623 scnprintf(buf + pos, bufsz - pos, "S_RFKILL:\t %d\n", il_dbgfs_status_read() 626 scnprintf(buf + pos, bufsz - pos, "S_CT_KILL:\t\t %d\n", il_dbgfs_status_read() 629 scnprintf(buf + pos, bufsz - pos, "S_INIT:\t\t %d\n", il_dbgfs_status_read() 632 scnprintf(buf + pos, bufsz - pos, "S_ALIVE:\t\t %d\n", il_dbgfs_status_read() 635 scnprintf(buf + pos, bufsz - pos, "S_READY:\t\t %d\n", il_dbgfs_status_read() 638 scnprintf(buf + pos, bufsz - pos, "S_TEMPERATURE:\t %d\n", il_dbgfs_status_read() 641 scnprintf(buf + pos, bufsz - pos, "S_GEO_CONFIGURED:\t %d\n", il_dbgfs_status_read() 644 scnprintf(buf + pos, bufsz - pos, "S_EXIT_PENDING:\t %d\n", il_dbgfs_status_read() 647 scnprintf(buf + pos, bufsz - pos, "S_STATS:\t %d\n", il_dbgfs_status_read() 650 scnprintf(buf + pos, bufsz - pos, "S_SCANNING:\t %d\n", il_dbgfs_status_read() 653 scnprintf(buf + pos, bufsz - pos, "S_SCAN_ABORTING:\t %d\n", il_dbgfs_status_read() 656 scnprintf(buf + pos, bufsz - pos, "S_SCAN_HW:\t\t %d\n", il_dbgfs_status_read() 659 scnprintf(buf + pos, bufsz - pos, "S_POWER_PMI:\t %d\n", il_dbgfs_status_read() 662 scnprintf(buf + pos, bufsz - pos, "S_FW_ERROR:\t %d\n", il_dbgfs_status_read() 664 return simple_read_from_buffer(user_buf, count, ppos, buf, pos); il_dbgfs_status_read() 675 char *buf; il_dbgfs_interrupt_read() local 679 buf = kzalloc(bufsz, GFP_KERNEL); il_dbgfs_interrupt_read() 680 if (!buf) { il_dbgfs_interrupt_read() 686 scnprintf(buf + pos, bufsz - pos, "Interrupt Statistics Report:\n"); il_dbgfs_interrupt_read() 689 scnprintf(buf + pos, bufsz - pos, "HW Error:\t\t\t %u\n", il_dbgfs_interrupt_read() 692 scnprintf(buf + pos, bufsz - pos, "SW Error:\t\t\t %u\n", il_dbgfs_interrupt_read() 696 scnprintf(buf + pos, bufsz - pos, il_dbgfs_interrupt_read() 702 scnprintf(buf + pos, bufsz - pos, "Frame transmitted:\t\t %u\n", il_dbgfs_interrupt_read() 705 scnprintf(buf + pos, bufsz - pos, "Alive interrupt:\t\t %u\n", il_dbgfs_interrupt_read() 709 scnprintf(buf + pos, bufsz - pos, il_dbgfs_interrupt_read() 714 scnprintf(buf + pos, bufsz - pos, "CT KILL:\t\t\t %u\n", il_dbgfs_interrupt_read() 718 scnprintf(buf + pos, bufsz - pos, "Wakeup Interrupt:\t\t %u\n", il_dbgfs_interrupt_read() 722 scnprintf(buf + pos, bufsz - pos, "Rx command responses:\t\t %u\n", il_dbgfs_interrupt_read() 727 scnprintf(buf + pos, bufsz - pos, il_dbgfs_interrupt_read() 734 scnprintf(buf + pos, bufsz - pos, "Tx/FH interrupt:\t\t %u\n", il_dbgfs_interrupt_read() 738 scnprintf(buf + pos, bufsz - pos, "Unexpected INTA:\t\t %u\n", il_dbgfs_interrupt_read() 741 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); il_dbgfs_interrupt_read() 742 kfree(buf); il_dbgfs_interrupt_read() 751 char buf[8]; il_dbgfs_interrupt_write() local 755 memset(buf, 0, sizeof(buf)); il_dbgfs_interrupt_write() 756 buf_size = min(count, sizeof(buf) - 1); il_dbgfs_interrupt_write() 757 if (copy_from_user(buf, user_buf, buf_size)) il_dbgfs_interrupt_write() 759 if (sscanf(buf, "%x", &reset_flag) != 1) il_dbgfs_interrupt_write() 773 char buf[256]; il_dbgfs_qos_read() local 774 const size_t bufsz = sizeof(buf); il_dbgfs_qos_read() 778 scnprintf(buf + pos, bufsz - pos, il_dbgfs_qos_read() 781 scnprintf(buf + pos, bufsz - pos, il_dbgfs_qos_read() 789 return simple_read_from_buffer(user_buf, count, ppos, buf, pos); il_dbgfs_qos_read() 797 char buf[8]; il_dbgfs_disable_ht40_write() local 801 memset(buf, 0, sizeof(buf)); il_dbgfs_disable_ht40_write() 802 buf_size = min(count, sizeof(buf) - 1); il_dbgfs_disable_ht40_write() 803 if (copy_from_user(buf, user_buf, buf_size)) il_dbgfs_disable_ht40_write() 805 if (sscanf(buf, "%d", &ht40) != 1) il_dbgfs_disable_ht40_write() 823 char buf[100]; il_dbgfs_disable_ht40_read() local 825 const size_t bufsz = sizeof(buf); il_dbgfs_disable_ht40_read() 828 scnprintf(buf + pos, bufsz - pos, "11n 40MHz Mode: %s\n", il_dbgfs_disable_ht40_read() 830 return simple_read_from_buffer(user_buf, count, ppos, buf, pos); il_dbgfs_disable_ht40_read() 850 char *buf; il_dbgfs_tx_queue_read() local 861 buf = kzalloc(bufsz, GFP_KERNEL); il_dbgfs_tx_queue_read() 862 if (!buf) il_dbgfs_tx_queue_read() 869 scnprintf(buf + pos, bufsz - pos, il_dbgfs_tx_queue_read() 880 scnprintf(buf + pos, bufsz - pos, il_dbgfs_tx_queue_read() 884 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); il_dbgfs_tx_queue_read() 885 kfree(buf); il_dbgfs_tx_queue_read() 896 char buf[256]; il_dbgfs_rx_queue_read() local 898 const size_t bufsz = sizeof(buf); il_dbgfs_rx_queue_read() 900 pos += scnprintf(buf + pos, bufsz - pos, "read: %u\n", rxq->read); il_dbgfs_rx_queue_read() 901 pos += scnprintf(buf + pos, bufsz - pos, "write: %u\n", rxq->write); il_dbgfs_rx_queue_read() 903 scnprintf(buf + pos, bufsz - pos, "free_count: %u\n", il_dbgfs_rx_queue_read() 907 scnprintf(buf + pos, bufsz - pos, "closed_rb_num: %u\n", il_dbgfs_rx_queue_read() 912 scnprintf(buf + pos, bufsz - pos, il_dbgfs_rx_queue_read() 915 return simple_read_from_buffer(user_buf, count, ppos, buf, pos); il_dbgfs_rx_queue_read() 953 char *buf; il_dbgfs_sensitivity_read() local 959 buf = kzalloc(bufsz, GFP_KERNEL); il_dbgfs_sensitivity_read() 960 if (!buf) { il_dbgfs_sensitivity_read() 966 scnprintf(buf + pos, bufsz - pos, "auto_corr_ofdm:\t\t\t %u\n", il_dbgfs_sensitivity_read() 969 scnprintf(buf + pos, bufsz - pos, "auto_corr_ofdm_mrc:\t\t %u\n", il_dbgfs_sensitivity_read() 972 scnprintf(buf + pos, bufsz - pos, "auto_corr_ofdm_x1:\t\t %u\n", il_dbgfs_sensitivity_read() 975 scnprintf(buf + pos, bufsz - pos, "auto_corr_ofdm_mrc_x1:\t\t %u\n", il_dbgfs_sensitivity_read() 978 scnprintf(buf + pos, bufsz - pos, "auto_corr_cck:\t\t\t %u\n", il_dbgfs_sensitivity_read() 981 scnprintf(buf + pos, bufsz - pos, "auto_corr_cck_mrc:\t\t %u\n", il_dbgfs_sensitivity_read() 984 scnprintf(buf + pos, bufsz - pos, il_dbgfs_sensitivity_read() 988 scnprintf(buf + pos, bufsz - pos, "last_fa_cnt_ofdm:\t\t %u\n", il_dbgfs_sensitivity_read() 991 scnprintf(buf + pos, bufsz - pos, "last_bad_plcp_cnt_cck:\t\t %u\n", il_dbgfs_sensitivity_read() 994 scnprintf(buf + pos, bufsz - pos, "last_fa_cnt_cck:\t\t %u\n", il_dbgfs_sensitivity_read() 997 scnprintf(buf + pos, bufsz - pos, "nrg_curr_state:\t\t\t %u\n", il_dbgfs_sensitivity_read() 1000 scnprintf(buf + pos, bufsz - pos, "nrg_prev_state:\t\t\t %u\n", il_dbgfs_sensitivity_read() 1002 pos += scnprintf(buf + pos, bufsz - pos, "nrg_value:\t\t\t"); il_dbgfs_sensitivity_read() 1005 scnprintf(buf + pos, bufsz - pos, " %u", il_dbgfs_sensitivity_read() 1008 pos += scnprintf(buf + pos, bufsz - pos, "\n"); il_dbgfs_sensitivity_read() 1009 pos += scnprintf(buf + pos, bufsz - pos, "nrg_silence_rssi:\t\t"); il_dbgfs_sensitivity_read() 1012 scnprintf(buf + pos, bufsz - pos, " %u", il_dbgfs_sensitivity_read() 1015 pos += scnprintf(buf + pos, bufsz - pos, "\n"); il_dbgfs_sensitivity_read() 1017 scnprintf(buf + pos, bufsz - pos, "nrg_silence_ref:\t\t %u\n", il_dbgfs_sensitivity_read() 1020 scnprintf(buf + pos, bufsz - pos, "nrg_energy_idx:\t\t\t %u\n", il_dbgfs_sensitivity_read() 1023 scnprintf(buf + pos, bufsz - pos, "nrg_silence_idx:\t\t %u\n", il_dbgfs_sensitivity_read() 1026 scnprintf(buf + pos, bufsz - pos, "nrg_th_cck:\t\t\t %u\n", il_dbgfs_sensitivity_read() 1029 scnprintf(buf + pos, bufsz - pos, il_dbgfs_sensitivity_read() 1033 scnprintf(buf + pos, bufsz - pos, "num_in_cck_no_fa:\t\t %u\n", il_dbgfs_sensitivity_read() 1036 scnprintf(buf + pos, bufsz - pos, "nrg_th_ofdm:\t\t\t %u\n", il_dbgfs_sensitivity_read() 1039 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); il_dbgfs_sensitivity_read() 1040 kfree(buf); il_dbgfs_sensitivity_read() 1052 char *buf; il_dbgfs_chain_noise_read() local 1058 buf = kzalloc(bufsz, GFP_KERNEL); il_dbgfs_chain_noise_read() 1059 if (!buf) { il_dbgfs_chain_noise_read() 1065 scnprintf(buf + pos, bufsz - pos, "active_chains:\t\t\t %u\n", il_dbgfs_chain_noise_read() 1068 scnprintf(buf + pos, bufsz - pos, "chain_noise_a:\t\t\t %u\n", il_dbgfs_chain_noise_read() 1071 scnprintf(buf + pos, bufsz - pos, "chain_noise_b:\t\t\t %u\n", il_dbgfs_chain_noise_read() 1074 scnprintf(buf + pos, bufsz - pos, "chain_noise_c:\t\t\t %u\n", il_dbgfs_chain_noise_read() 1077 scnprintf(buf + pos, bufsz - pos, "chain_signal_a:\t\t\t %u\n", il_dbgfs_chain_noise_read() 1080 scnprintf(buf + pos, bufsz - pos, "chain_signal_b:\t\t\t %u\n", il_dbgfs_chain_noise_read() 1083 scnprintf(buf + pos, bufsz - pos, "chain_signal_c:\t\t\t %u\n", il_dbgfs_chain_noise_read() 1086 scnprintf(buf + pos, bufsz - pos, "beacon_count:\t\t\t %u\n", il_dbgfs_chain_noise_read() 1089 pos += scnprintf(buf + pos, bufsz - pos, "disconn_array:\t\t\t"); il_dbgfs_chain_noise_read() 1092 scnprintf(buf + pos, bufsz - pos, " %u", il_dbgfs_chain_noise_read() 1095 pos += scnprintf(buf + pos, bufsz - pos, "\n"); il_dbgfs_chain_noise_read() 1096 pos += scnprintf(buf + pos, bufsz - pos, "delta_gain_code:\t\t"); il_dbgfs_chain_noise_read() 1099 scnprintf(buf + pos, bufsz - pos, " %u", il_dbgfs_chain_noise_read() 1102 pos += scnprintf(buf + pos, bufsz - pos, "\n"); il_dbgfs_chain_noise_read() 1104 scnprintf(buf + pos, bufsz - pos, "radio_write:\t\t\t %u\n", il_dbgfs_chain_noise_read() 1107 scnprintf(buf + pos, bufsz - pos, "state:\t\t\t\t %u\n", il_dbgfs_chain_noise_read() 1110 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); il_dbgfs_chain_noise_read() 1111 kfree(buf); il_dbgfs_chain_noise_read() 1120 char buf[60]; il_dbgfs_power_save_status_read() local 1122 const size_t bufsz = sizeof(buf); il_dbgfs_power_save_status_read() 1128 pos += scnprintf(buf + pos, bufsz - pos, "Power Save Status: "); il_dbgfs_power_save_status_read() 1130 scnprintf(buf + pos, bufsz - pos, "%s\n", il_dbgfs_power_save_status_read() 1136 return simple_read_from_buffer(user_buf, count, ppos, buf, pos); il_dbgfs_power_save_status_read() 1145 char buf[8]; il_dbgfs_clear_ucode_stats_write() local 1149 memset(buf, 0, sizeof(buf)); il_dbgfs_clear_ucode_stats_write() 1150 buf_size = min(count, sizeof(buf) - 1); il_dbgfs_clear_ucode_stats_write() 1151 if (copy_from_user(buf, user_buf, buf_size)) il_dbgfs_clear_ucode_stats_write() 1153 if (sscanf(buf, "%d", &clear) != 1) il_dbgfs_clear_ucode_stats_write() 1171 char buf[20]; il_dbgfs_rxon_flags_read() local 1173 len = sprintf(buf, "0x%04X\n", le32_to_cpu(il->active.flags)); il_dbgfs_rxon_flags_read() 1174 return simple_read_from_buffer(user_buf, count, ppos, buf, len); il_dbgfs_rxon_flags_read() 1184 char buf[20]; il_dbgfs_rxon_filter_flags_read() local 1187 sprintf(buf, "0x%04X\n", le32_to_cpu(il->active.filter_flags)); il_dbgfs_rxon_filter_flags_read() 1188 return simple_read_from_buffer(user_buf, count, ppos, buf, len); il_dbgfs_rxon_filter_flags_read() 1196 char *buf; il_dbgfs_fh_reg_read() local 1201 ret = pos = il->ops->dump_fh(il, &buf, true); il_dbgfs_fh_reg_read() 1202 if (buf) { il_dbgfs_fh_reg_read() 1204 simple_read_from_buffer(user_buf, count, ppos, buf, il_dbgfs_fh_reg_read() 1206 kfree(buf); il_dbgfs_fh_reg_read() 1220 char buf[12]; il_dbgfs_missed_beacon_read() local 1221 const size_t bufsz = sizeof(buf); il_dbgfs_missed_beacon_read() 1224 scnprintf(buf + pos, bufsz - pos, "%d\n", il_dbgfs_missed_beacon_read() 1227 return simple_read_from_buffer(user_buf, count, ppos, buf, pos); il_dbgfs_missed_beacon_read() 1235 char buf[8]; il_dbgfs_missed_beacon_write() local 1239 memset(buf, 0, sizeof(buf)); il_dbgfs_missed_beacon_write() 1240 buf_size = min(count, sizeof(buf) - 1); il_dbgfs_missed_beacon_write() 1241 if (copy_from_user(buf, user_buf, buf_size)) il_dbgfs_missed_beacon_write() 1243 if (sscanf(buf, "%d", &missed) != 1) il_dbgfs_missed_beacon_write() 1262 char buf[300]; il_dbgfs_force_reset_read() local 1263 const size_t bufsz = sizeof(buf); il_dbgfs_force_reset_read() 1269 scnprintf(buf + pos, bufsz - pos, "\tnumber of reset request: %d\n", il_dbgfs_force_reset_read() 1272 scnprintf(buf + pos, bufsz - pos, il_dbgfs_force_reset_read() 1276 scnprintf(buf + pos, bufsz - pos, il_dbgfs_force_reset_read() 1280 scnprintf(buf + pos, bufsz - pos, "\treset duration: %lu\n", il_dbgfs_force_reset_read() 1283 return simple_read_from_buffer(user_buf, count, ppos, buf, pos); il_dbgfs_force_reset_read() 1305 char buf[8]; il_dbgfs_wd_timeout_write() local 1309 memset(buf, 0, sizeof(buf)); il_dbgfs_wd_timeout_write() 1310 buf_size = min(count, sizeof(buf) - 1); il_dbgfs_wd_timeout_write() 1311 if (copy_from_user(buf, user_buf, buf_size)) il_dbgfs_wd_timeout_write() 1313 if (sscanf(buf, "%d", &timeout) != 1) il_dbgfs_wd_timeout_write()
|
H A D | 3945-debug.c | 33 il3945_stats_flag(struct il_priv *il, char *buf, int bufsz) il3945_stats_flag() argument 37 p += scnprintf(buf + p, bufsz - p, "Statistics Flag(0x%X):\n", il3945_stats_flag() 40 p += scnprintf(buf + p, bufsz - p, il3945_stats_flag() 42 p += scnprintf(buf + p, bufsz - p, "\tOperational Frequency: %s\n", il3945_stats_flag() 45 p += scnprintf(buf + p, bufsz - p, "\tTGj Narrow Band: %s\n", il3945_stats_flag() 57 char *buf; il3945_ucode_rx_stats_read() local 70 buf = kzalloc(bufsz, GFP_KERNEL); il3945_ucode_rx_stats_read() 71 if (!buf) { il3945_ucode_rx_stats_read() 94 pos += il3945_stats_flag(il, buf, bufsz); il3945_ucode_rx_stats_read() 96 scnprintf(buf + pos, bufsz - pos, il3945_ucode_rx_stats_read() 101 scnprintf(buf + pos, bufsz - pos, il3945_ucode_rx_stats_read() 106 scnprintf(buf + pos, bufsz - pos, il3945_ucode_rx_stats_read() 111 scnprintf(buf + pos, bufsz - pos, il3945_ucode_rx_stats_read() 116 scnprintf(buf + pos, bufsz - pos, il3945_ucode_rx_stats_read() 121 scnprintf(buf + pos, bufsz - pos, il3945_ucode_rx_stats_read() 126 scnprintf(buf + pos, bufsz - pos, il3945_ucode_rx_stats_read() 133 scnprintf(buf + pos, bufsz - pos, il3945_ucode_rx_stats_read() 138 scnprintf(buf + pos, bufsz - pos, il3945_ucode_rx_stats_read() 144 scnprintf(buf + pos, bufsz - pos, il3945_ucode_rx_stats_read() 151 scnprintf(buf + pos, bufsz - pos, il3945_ucode_rx_stats_read() 156 scnprintf(buf + pos, bufsz - pos, il3945_ucode_rx_stats_read() 161 scnprintf(buf + pos, bufsz - pos, il3945_ucode_rx_stats_read() 167 scnprintf(buf + pos, bufsz - pos, il3945_ucode_rx_stats_read() 175 scnprintf(buf + pos, bufsz - pos, il3945_ucode_rx_stats_read() 180 scnprintf(buf + pos, bufsz - pos, il3945_ucode_rx_stats_read() 186 scnprintf(buf + pos, bufsz - pos, il3945_ucode_rx_stats_read() 191 scnprintf(buf + pos, bufsz - pos, il3945_ucode_rx_stats_read() 196 scnprintf(buf + pos, bufsz - pos, il3945_ucode_rx_stats_read() 201 scnprintf(buf + pos, bufsz - pos, il3945_ucode_rx_stats_read() 206 scnprintf(buf + pos, bufsz - pos, il3945_ucode_rx_stats_read() 211 scnprintf(buf + pos, bufsz - pos, il3945_ucode_rx_stats_read() 216 scnprintf(buf + pos, bufsz - pos, il3945_ucode_rx_stats_read() 222 scnprintf(buf + pos, bufsz - pos, il3945_ucode_rx_stats_read() 227 scnprintf(buf + pos, bufsz - pos, il3945_ucode_rx_stats_read() 233 scnprintf(buf + pos, bufsz - pos, il3945_ucode_rx_stats_read() 239 scnprintf(buf + pos, bufsz - pos, il3945_ucode_rx_stats_read() 244 scnprintf(buf + pos, bufsz - pos, il3945_ucode_rx_stats_read() 249 scnprintf(buf + pos, bufsz - pos, il3945_ucode_rx_stats_read() 255 scnprintf(buf + pos, bufsz - pos, il3945_ucode_rx_stats_read() 263 scnprintf(buf + pos, bufsz - pos, il3945_ucode_rx_stats_read() 268 scnprintf(buf + pos, bufsz - pos, il3945_ucode_rx_stats_read() 274 scnprintf(buf + pos, bufsz - pos, il3945_ucode_rx_stats_read() 279 scnprintf(buf + pos, bufsz - pos, il3945_ucode_rx_stats_read() 284 scnprintf(buf + pos, bufsz - pos, il3945_ucode_rx_stats_read() 289 scnprintf(buf + pos, bufsz - pos, il3945_ucode_rx_stats_read() 296 scnprintf(buf + pos, bufsz - pos, il3945_ucode_rx_stats_read() 303 scnprintf(buf + pos, bufsz - pos, il3945_ucode_rx_stats_read() 311 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); il3945_ucode_rx_stats_read() 312 kfree(buf); il3945_ucode_rx_stats_read() 322 char *buf; il3945_ucode_tx_stats_read() local 330 buf = kzalloc(bufsz, GFP_KERNEL); il3945_ucode_tx_stats_read() 331 if (!buf) { il3945_ucode_tx_stats_read() 345 pos += il3945_stats_flag(il, buf, bufsz); il3945_ucode_tx_stats_read() 347 scnprintf(buf + pos, bufsz - pos, il3945_ucode_tx_stats_read() 352 scnprintf(buf + pos, bufsz - pos, il3945_ucode_tx_stats_read() 357 scnprintf(buf + pos, bufsz - pos, il3945_ucode_tx_stats_read() 363 scnprintf(buf + pos, bufsz - pos, il3945_ucode_tx_stats_read() 369 scnprintf(buf + pos, bufsz - pos, il3945_ucode_tx_stats_read() 375 scnprintf(buf + pos, bufsz - pos, il3945_ucode_tx_stats_read() 380 scnprintf(buf + pos, bufsz - pos, il3945_ucode_tx_stats_read() 385 scnprintf(buf + pos, bufsz - pos, il3945_ucode_tx_stats_read() 390 scnprintf(buf + pos, bufsz - pos, il3945_ucode_tx_stats_read() 396 scnprintf(buf + pos, bufsz - pos, il3945_ucode_tx_stats_read() 401 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); il3945_ucode_tx_stats_read() 402 kfree(buf); il3945_ucode_tx_stats_read() 412 char *buf; il3945_ucode_general_stats_read() local 423 buf = kzalloc(bufsz, GFP_KERNEL); il3945_ucode_general_stats_read() 424 if (!buf) { il3945_ucode_general_stats_read() 446 pos += il3945_stats_flag(il, buf, bufsz); il3945_ucode_general_stats_read() 448 scnprintf(buf + pos, bufsz - pos, il3945_ucode_general_stats_read() 453 scnprintf(buf + pos, bufsz - pos, il3945_ucode_general_stats_read() 458 scnprintf(buf + pos, bufsz - pos, il3945_ucode_general_stats_read() 463 scnprintf(buf + pos, bufsz - pos, il3945_ucode_general_stats_read() 469 scnprintf(buf + pos, bufsz - pos, il3945_ucode_general_stats_read() 474 scnprintf(buf + pos, bufsz - pos, il3945_ucode_general_stats_read() 480 scnprintf(buf + pos, bufsz - pos, "ttl_timestamp:\t\t\t%u\n", il3945_ucode_general_stats_read() 483 scnprintf(buf + pos, bufsz - pos, il3945_ucode_general_stats_read() 488 scnprintf(buf + pos, bufsz - pos, il3945_ucode_general_stats_read() 493 scnprintf(buf + pos, bufsz - pos, il3945_ucode_general_stats_read() 498 scnprintf(buf + pos, bufsz - pos, il3945_ucode_general_stats_read() 502 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); il3945_ucode_general_stats_read() 503 kfree(buf); il3945_ucode_general_stats_read()
|
H A D | 4965-debug.c | 37 il4965_stats_flag(struct il_priv *il, char *buf, int bufsz) il4965_stats_flag() argument 44 p += scnprintf(buf + p, bufsz - p, "Statistics Flag(0x%X):\n", flag); il4965_stats_flag() 46 p += scnprintf(buf + p, bufsz - p, il4965_stats_flag() 48 p += scnprintf(buf + p, bufsz - p, "\tOperational Frequency: %s\n", il4965_stats_flag() 51 p += scnprintf(buf + p, bufsz - p, "\tTGj Narrow Band: %s\n", il4965_stats_flag() 64 char *buf; il4965_ucode_rx_stats_read() local 79 buf = kzalloc(bufsz, GFP_KERNEL); il4965_ucode_rx_stats_read() 80 if (!buf) { il4965_ucode_rx_stats_read() 107 pos += il4965_stats_flag(il, buf, bufsz); il4965_ucode_rx_stats_read() 109 scnprintf(buf + pos, bufsz - pos, fmt_header, il4965_ucode_rx_stats_read() 112 scnprintf(buf + pos, bufsz - pos, fmt_table, "ina_cnt:", il4965_ucode_rx_stats_read() 116 scnprintf(buf + pos, bufsz - pos, fmt_table, "fina_cnt:", il4965_ucode_rx_stats_read() 120 scnprintf(buf + pos, bufsz - pos, fmt_table, "plcp_err:", il4965_ucode_rx_stats_read() 124 scnprintf(buf + pos, bufsz - pos, fmt_table, "crc32_err:", il4965_ucode_rx_stats_read() 128 scnprintf(buf + pos, bufsz - pos, fmt_table, "overrun_err:", il4965_ucode_rx_stats_read() 132 scnprintf(buf + pos, bufsz - pos, fmt_table, "early_overrun_err:", il4965_ucode_rx_stats_read() 138 scnprintf(buf + pos, bufsz - pos, fmt_table, "crc32_good:", il4965_ucode_rx_stats_read() 142 scnprintf(buf + pos, bufsz - pos, fmt_table, "false_alarm_cnt:", il4965_ucode_rx_stats_read() 147 scnprintf(buf + pos, bufsz - pos, fmt_table, "fina_sync_err_cnt:", il4965_ucode_rx_stats_read() 153 scnprintf(buf + pos, bufsz - pos, fmt_table, "sfd_timeout:", il4965_ucode_rx_stats_read() 157 scnprintf(buf + pos, bufsz - pos, fmt_table, "fina_timeout:", il4965_ucode_rx_stats_read() 161 scnprintf(buf + pos, bufsz - pos, fmt_table, "unresponded_rts:", il4965_ucode_rx_stats_read() 166 scnprintf(buf + pos, bufsz - pos, fmt_table, "rxe_frame_lmt_ovrun:", il4965_ucode_rx_stats_read() 172 scnprintf(buf + pos, bufsz - pos, fmt_table, "sent_ack_cnt:", il4965_ucode_rx_stats_read() 176 scnprintf(buf + pos, bufsz - pos, fmt_table, "sent_cts_cnt:", il4965_ucode_rx_stats_read() 180 scnprintf(buf + pos, bufsz - pos, fmt_table, "sent_ba_rsp_cnt:", il4965_ucode_rx_stats_read() 185 scnprintf(buf + pos, bufsz - pos, fmt_table, "dsp_self_kill:", il4965_ucode_rx_stats_read() 190 scnprintf(buf + pos, bufsz - pos, fmt_table, "mh_format_err:", il4965_ucode_rx_stats_read() 195 scnprintf(buf + pos, bufsz - pos, fmt_table, il4965_ucode_rx_stats_read() 203 scnprintf(buf + pos, bufsz - pos, fmt_header, il4965_ucode_rx_stats_read() 206 scnprintf(buf + pos, bufsz - pos, fmt_table, "ina_cnt:", il4965_ucode_rx_stats_read() 210 scnprintf(buf + pos, bufsz - pos, fmt_table, "fina_cnt:", il4965_ucode_rx_stats_read() 214 scnprintf(buf + pos, bufsz - pos, fmt_table, "plcp_err:", il4965_ucode_rx_stats_read() 218 scnprintf(buf + pos, bufsz - pos, fmt_table, "crc32_err:", il4965_ucode_rx_stats_read() 222 scnprintf(buf + pos, bufsz - pos, fmt_table, "overrun_err:", il4965_ucode_rx_stats_read() 226 scnprintf(buf + pos, bufsz - pos, fmt_table, "early_overrun_err:", il4965_ucode_rx_stats_read() 231 scnprintf(buf + pos, bufsz - pos, fmt_table, "crc32_good:", il4965_ucode_rx_stats_read() 235 scnprintf(buf + pos, bufsz - pos, fmt_table, "false_alarm_cnt:", il4965_ucode_rx_stats_read() 240 scnprintf(buf + pos, bufsz - pos, fmt_table, "fina_sync_err_cnt:", il4965_ucode_rx_stats_read() 245 scnprintf(buf + pos, bufsz - pos, fmt_table, "sfd_timeout:", il4965_ucode_rx_stats_read() 249 scnprintf(buf + pos, bufsz - pos, fmt_table, "fina_timeout:", il4965_ucode_rx_stats_read() 253 scnprintf(buf + pos, bufsz - pos, fmt_table, "unresponded_rts:", il4965_ucode_rx_stats_read() 258 scnprintf(buf + pos, bufsz - pos, fmt_table, "rxe_frame_lmt_ovrun:", il4965_ucode_rx_stats_read() 264 scnprintf(buf + pos, bufsz - pos, fmt_table, "sent_ack_cnt:", il4965_ucode_rx_stats_read() 268 scnprintf(buf + pos, bufsz - pos, fmt_table, "sent_cts_cnt:", il4965_ucode_rx_stats_read() 272 scnprintf(buf + pos, bufsz - pos, fmt_table, "sent_ba_rsp_cnt:", il4965_ucode_rx_stats_read() 277 scnprintf(buf + pos, bufsz - pos, fmt_table, "dsp_self_kill:", il4965_ucode_rx_stats_read() 281 scnprintf(buf + pos, bufsz - pos, fmt_table, "mh_format_err:", il4965_ucode_rx_stats_read() 285 scnprintf(buf + pos, bufsz - pos, fmt_table, il4965_ucode_rx_stats_read() 293 scnprintf(buf + pos, bufsz - pos, fmt_header, il4965_ucode_rx_stats_read() 296 scnprintf(buf + pos, bufsz - pos, fmt_table, "bogus_cts:", il4965_ucode_rx_stats_read() 300 scnprintf(buf + pos, bufsz - pos, fmt_table, "bogus_ack:", il4965_ucode_rx_stats_read() 304 scnprintf(buf + pos, bufsz - pos, fmt_table, "non_bssid_frames:", il4965_ucode_rx_stats_read() 310 scnprintf(buf + pos, bufsz - pos, fmt_table, "filtered_frames:", il4965_ucode_rx_stats_read() 316 scnprintf(buf + pos, bufsz - pos, fmt_table, "non_channel_beacons:", il4965_ucode_rx_stats_read() 322 scnprintf(buf + pos, bufsz - pos, fmt_table, "channel_beacons:", il4965_ucode_rx_stats_read() 328 scnprintf(buf + pos, bufsz - pos, fmt_table, "num_missed_bcon:", il4965_ucode_rx_stats_read() 334 scnprintf(buf + pos, bufsz - pos, fmt_table, il4965_ucode_rx_stats_read() 341 scnprintf(buf + pos, bufsz - pos, fmt_table, il4965_ucode_rx_stats_read() 348 scnprintf(buf + pos, bufsz - pos, fmt_table, il4965_ucode_rx_stats_read() 355 scnprintf(buf + pos, bufsz - pos, fmt_table, il4965_ucode_rx_stats_read() 362 scnprintf(buf + pos, bufsz - pos, fmt_table, il4965_ucode_rx_stats_read() 369 scnprintf(buf + pos, bufsz - pos, fmt_table, il4965_ucode_rx_stats_read() 376 scnprintf(buf + pos, bufsz - pos, fmt_table, "channel_load:", il4965_ucode_rx_stats_read() 381 scnprintf(buf + pos, bufsz - pos, fmt_table, "dsp_false_alarms:", il4965_ucode_rx_stats_read() 387 scnprintf(buf + pos, bufsz - pos, fmt_table, "beacon_rssi_a:", il4965_ucode_rx_stats_read() 392 scnprintf(buf + pos, bufsz - pos, fmt_table, "beacon_rssi_b:", il4965_ucode_rx_stats_read() 397 scnprintf(buf + pos, bufsz - pos, fmt_table, "beacon_rssi_c:", il4965_ucode_rx_stats_read() 402 scnprintf(buf + pos, bufsz - pos, fmt_table, "beacon_energy_a:", il4965_ucode_rx_stats_read() 408 scnprintf(buf + pos, bufsz - pos, fmt_table, "beacon_energy_b:", il4965_ucode_rx_stats_read() 414 scnprintf(buf + pos, bufsz - pos, fmt_table, "beacon_energy_c:", il4965_ucode_rx_stats_read() 421 scnprintf(buf + pos, bufsz - pos, fmt_header, il4965_ucode_rx_stats_read() 424 scnprintf(buf + pos, bufsz - pos, fmt_table, "plcp_err:", il4965_ucode_rx_stats_read() 428 scnprintf(buf + pos, bufsz - pos, fmt_table, "overrun_err:", il4965_ucode_rx_stats_read() 432 scnprintf(buf + pos, bufsz - pos, fmt_table, "early_overrun_err:", il4965_ucode_rx_stats_read() 437 scnprintf(buf + pos, bufsz - pos, fmt_table, "crc32_good:", il4965_ucode_rx_stats_read() 441 scnprintf(buf + pos, bufsz - pos, fmt_table, "crc32_err:", il4965_ucode_rx_stats_read() 445 scnprintf(buf + pos, bufsz - pos, fmt_table, "mh_format_err:", il4965_ucode_rx_stats_read() 449 scnprintf(buf + pos, bufsz - pos, fmt_table, "agg_crc32_good:", il4965_ucode_rx_stats_read() 453 scnprintf(buf + pos, bufsz - pos, fmt_table, "agg_mpdu_cnt:", il4965_ucode_rx_stats_read() 457 scnprintf(buf + pos, bufsz - pos, fmt_table, "agg_cnt:", il4965_ucode_rx_stats_read() 461 scnprintf(buf + pos, bufsz - pos, fmt_table, "unsupport_mcs:", il4965_ucode_rx_stats_read() 465 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); il4965_ucode_rx_stats_read() 466 kfree(buf); il4965_ucode_rx_stats_read() 476 char *buf; il4965_ucode_tx_stats_read() local 484 buf = kzalloc(bufsz, GFP_KERNEL); il4965_ucode_tx_stats_read() 485 if (!buf) { il4965_ucode_tx_stats_read() 499 pos += il4965_stats_flag(il, buf, bufsz); il4965_ucode_tx_stats_read() 500 pos += scnprintf(buf + pos, bufsz - pos, fmt_header, "Statistics_Tx:"); il4965_ucode_tx_stats_read() 502 scnprintf(buf + pos, bufsz - pos, fmt_table, "preamble:", il4965_ucode_tx_stats_read() 506 scnprintf(buf + pos, bufsz - pos, fmt_table, "rx_detected_cnt:", il4965_ucode_tx_stats_read() 511 scnprintf(buf + pos, bufsz - pos, fmt_table, "bt_prio_defer_cnt:", il4965_ucode_tx_stats_read() 516 scnprintf(buf + pos, bufsz - pos, fmt_table, "bt_prio_kill_cnt:", il4965_ucode_tx_stats_read() 521 scnprintf(buf + pos, bufsz - pos, fmt_table, "few_bytes_cnt:", il4965_ucode_tx_stats_read() 525 scnprintf(buf + pos, bufsz - pos, fmt_table, "cts_timeout:", il4965_ucode_tx_stats_read() 529 scnprintf(buf + pos, bufsz - pos, fmt_table, "ack_timeout:", il4965_ucode_tx_stats_read() 533 scnprintf(buf + pos, bufsz - pos, fmt_table, "expected_ack_cnt:", il4965_ucode_tx_stats_read() 538 scnprintf(buf + pos, bufsz - pos, fmt_table, "actual_ack_cnt:", il4965_ucode_tx_stats_read() 542 scnprintf(buf + pos, bufsz - pos, fmt_table, "dump_msdu_cnt:", il4965_ucode_tx_stats_read() 546 scnprintf(buf + pos, bufsz - pos, fmt_table, il4965_ucode_tx_stats_read() 553 scnprintf(buf + pos, bufsz - pos, fmt_table, il4965_ucode_tx_stats_read() 560 scnprintf(buf + pos, bufsz - pos, fmt_table, il4965_ucode_tx_stats_read() 567 scnprintf(buf + pos, bufsz - pos, fmt_table, il4965_ucode_tx_stats_read() 574 scnprintf(buf + pos, bufsz - pos, fmt_table, "agg ba_timeout:", il4965_ucode_tx_stats_read() 578 scnprintf(buf + pos, bufsz - pos, fmt_table, il4965_ucode_tx_stats_read() 585 scnprintf(buf + pos, bufsz - pos, fmt_table, il4965_ucode_tx_stats_read() 592 scnprintf(buf + pos, bufsz - pos, fmt_table, il4965_ucode_tx_stats_read() 599 scnprintf(buf + pos, bufsz - pos, fmt_table, "agg scd_query_agg:", il4965_ucode_tx_stats_read() 604 scnprintf(buf + pos, bufsz - pos, fmt_table, il4965_ucode_tx_stats_read() 611 scnprintf(buf + pos, bufsz - pos, fmt_table, "agg frame_not_ready:", il4965_ucode_tx_stats_read() 617 scnprintf(buf + pos, bufsz - pos, fmt_table, "agg underrun:", il4965_ucode_tx_stats_read() 621 scnprintf(buf + pos, bufsz - pos, fmt_table, "agg bt_prio_kill:", il4965_ucode_tx_stats_read() 626 scnprintf(buf + pos, bufsz - pos, fmt_table, "agg rx_ba_rsp_cnt:", il4965_ucode_tx_stats_read() 631 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); il4965_ucode_tx_stats_read() 632 kfree(buf); il4965_ucode_tx_stats_read() 642 char *buf; il4965_ucode_general_stats_read() local 653 buf = kzalloc(bufsz, GFP_KERNEL); il4965_ucode_general_stats_read() 654 if (!buf) { il4965_ucode_general_stats_read() 676 pos += il4965_stats_flag(il, buf, bufsz); il4965_ucode_general_stats_read() 678 scnprintf(buf + pos, bufsz - pos, fmt_header, il4965_ucode_general_stats_read() 681 scnprintf(buf + pos, bufsz - pos, fmt_value, "temperature:", il4965_ucode_general_stats_read() 684 scnprintf(buf + pos, bufsz - pos, fmt_value, "ttl_timestamp:", il4965_ucode_general_stats_read() 687 scnprintf(buf + pos, bufsz - pos, fmt_table, "burst_check:", il4965_ucode_general_stats_read() 691 scnprintf(buf + pos, bufsz - pos, fmt_table, "burst_count:", il4965_ucode_general_stats_read() 695 scnprintf(buf + pos, bufsz - pos, fmt_table, il4965_ucode_general_stats_read() 702 scnprintf(buf + pos, bufsz - pos, fmt_table, "sleep_time:", il4965_ucode_general_stats_read() 707 scnprintf(buf + pos, bufsz - pos, fmt_table, "slots_out:", il4965_ucode_general_stats_read() 711 scnprintf(buf + pos, bufsz - pos, fmt_table, "slots_idle:", il4965_ucode_general_stats_read() 716 scnprintf(buf + pos, bufsz - pos, fmt_table, "tx_on_a:", il4965_ucode_general_stats_read() 720 scnprintf(buf + pos, bufsz - pos, fmt_table, "tx_on_b:", il4965_ucode_general_stats_read() 724 scnprintf(buf + pos, bufsz - pos, fmt_table, "exec_time:", il4965_ucode_general_stats_read() 728 scnprintf(buf + pos, bufsz - pos, fmt_table, "probe_time:", il4965_ucode_general_stats_read() 732 scnprintf(buf + pos, bufsz - pos, fmt_table, "rx_enable_counter:", il4965_ucode_general_stats_read() 738 scnprintf(buf + pos, bufsz - pos, fmt_table, "num_of_sos_states:", il4965_ucode_general_stats_read() 743 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); il4965_ucode_general_stats_read() 744 kfree(buf); il4965_ucode_general_stats_read()
|
/linux-4.4.14/drivers/media/usb/dvb-usb-v2/ |
H A D | mxl111sf-i2c.c | 260 &msg->buf[i]); mxl111sf_i2c_sw_xfer_msg() 291 msg->buf[i]); mxl111sf_i2c_sw_xfer_msg() 343 u8 buf[26]; mxl111sf_i2c_check_status() local 347 buf[0] = USB_READ_I2C_CMD; mxl111sf_i2c_check_status() 348 buf[1] = 0x00; mxl111sf_i2c_check_status() 350 buf[2] = I2C_INT_STATUS_REG; mxl111sf_i2c_check_status() 351 buf[3] = 0x00; mxl111sf_i2c_check_status() 352 buf[4] = 0x00; mxl111sf_i2c_check_status() 354 buf[5] = USB_END_I2C_CMD; mxl111sf_i2c_check_status() 356 mxl111sf_i2c_get_data(state, 0, buf, buf); mxl111sf_i2c_check_status() 358 if (buf[1] & 0x04) mxl111sf_i2c_check_status() 367 u8 buf[26]; mxl111sf_i2c_check_fifo() local 371 buf[0] = USB_READ_I2C_CMD; mxl111sf_i2c_check_fifo() 372 buf[1] = 0x00; mxl111sf_i2c_check_fifo() 374 buf[2] = I2C_MUX_REG; mxl111sf_i2c_check_fifo() 375 buf[3] = 0x00; mxl111sf_i2c_check_fifo() 376 buf[4] = 0x00; mxl111sf_i2c_check_fifo() 378 buf[5] = I2C_INT_STATUS_REG; mxl111sf_i2c_check_fifo() 379 buf[6] = 0x00; mxl111sf_i2c_check_fifo() 380 buf[7] = 0x00; mxl111sf_i2c_check_fifo() 381 buf[8] = USB_END_I2C_CMD; mxl111sf_i2c_check_fifo() 383 mxl111sf_i2c_get_data(state, 0, buf, buf); mxl111sf_i2c_check_fifo() 385 if (0x08 == (buf[1] & 0x08)) mxl111sf_i2c_check_fifo() 388 if ((buf[5] & 0x02) == 0x02) mxl111sf_i2c_check_fifo() 389 mxl_i2c("(buf[5] & 0x02) == 0x02"); /* FIXME */ mxl111sf_i2c_check_fifo() 445 u8 buf[26]; mxl111sf_i2c_hw_xfer_msg() local 458 buf[index] = USB_END_I2C_CMD; mxl111sf_i2c_hw_xfer_msg() 461 buf[0] = USB_WRITE_I2C_CMD; mxl111sf_i2c_hw_xfer_msg() 462 buf[1] = 0x00; mxl111sf_i2c_hw_xfer_msg() 465 buf[2] = I2C_MUX_REG; mxl111sf_i2c_hw_xfer_msg() 466 buf[3] = 0x80; mxl111sf_i2c_hw_xfer_msg() 467 buf[4] = 0x00; mxl111sf_i2c_hw_xfer_msg() 470 buf[5] = I2C_MUX_REG; mxl111sf_i2c_hw_xfer_msg() 471 buf[6] = 0x81; mxl111sf_i2c_hw_xfer_msg() 472 buf[7] = 0x00; mxl111sf_i2c_hw_xfer_msg() 475 buf[8] = 0x14; mxl111sf_i2c_hw_xfer_msg() 476 buf[9] = 0xff; mxl111sf_i2c_hw_xfer_msg() 477 buf[10] = 0x00; mxl111sf_i2c_hw_xfer_msg() 480 buf[8] = 0x24; mxl111sf_i2c_hw_xfer_msg() 481 buf[9] = 0xF7; mxl111sf_i2c_hw_xfer_msg() 482 buf[10] = 0x00; mxl111sf_i2c_hw_xfer_msg() 484 buf[11] = 0x24; mxl111sf_i2c_hw_xfer_msg() 485 buf[12] = 0xF7; mxl111sf_i2c_hw_xfer_msg() 486 buf[13] = 0x00; mxl111sf_i2c_hw_xfer_msg() 488 ret = mxl111sf_i2c_send_data(state, 0, buf); mxl111sf_i2c_hw_xfer_msg() 492 mxl_i2c("%d\t%02x", msg->len, msg->buf[0]); mxl111sf_i2c_hw_xfer_msg() 495 buf[2] = I2C_CONTROL_REG; mxl111sf_i2c_hw_xfer_msg() 496 buf[3] = 0x5E; mxl111sf_i2c_hw_xfer_msg() 497 buf[4] = (HWI2C400) ? 0x03 : 0x0D; mxl111sf_i2c_hw_xfer_msg() 500 buf[5] = I2C_SLAVE_ADDR_REG; mxl111sf_i2c_hw_xfer_msg() 501 buf[6] = (msg->addr); mxl111sf_i2c_hw_xfer_msg() 502 buf[7] = 0x00; mxl111sf_i2c_hw_xfer_msg() 503 buf[8] = USB_END_I2C_CMD; mxl111sf_i2c_hw_xfer_msg() 504 ret = mxl111sf_i2c_send_data(state, 0, buf); mxl111sf_i2c_hw_xfer_msg() 511 buf[2] = I2C_CONTROL_REG; mxl111sf_i2c_hw_xfer_msg() 512 buf[3] = 0x4E; mxl111sf_i2c_hw_xfer_msg() 513 buf[4] = (HWI2C400) ? 0x03 : 0x0D; mxl111sf_i2c_hw_xfer_msg() 531 buf[2+(i*3)] = I2C_DATA_REG; mxl111sf_i2c_hw_xfer_msg() 532 buf[3+(i*3)] = msg->buf[(index*8)+i]; mxl111sf_i2c_hw_xfer_msg() 533 buf[4+(i*3)] = 0x00; mxl111sf_i2c_hw_xfer_msg() 536 ret = mxl111sf_i2c_send_data(state, 0, buf); mxl111sf_i2c_hw_xfer_msg() 544 buf[2] = I2C_CONTROL_REG; mxl111sf_i2c_hw_xfer_msg() 545 buf[3] = 0x4E; mxl111sf_i2c_hw_xfer_msg() 546 buf[4] = (HWI2C400) ? 0x03 : 0x0D; mxl111sf_i2c_hw_xfer_msg() 555 buf[k] = USB_END_I2C_CMD; mxl111sf_i2c_hw_xfer_msg() 557 buf[0] = 0x99; mxl111sf_i2c_hw_xfer_msg() 558 buf[1] = 0x00; mxl111sf_i2c_hw_xfer_msg() 561 buf[2+(i*3)] = I2C_DATA_REG; mxl111sf_i2c_hw_xfer_msg() 562 buf[3+(i*3)] = msg->buf[(index*8)+i]; mxl111sf_i2c_hw_xfer_msg() 564 index, i, msg->buf[(index*8)+i]); mxl111sf_i2c_hw_xfer_msg() 565 buf[4+(i*3)] = 0x00; mxl111sf_i2c_hw_xfer_msg() 567 ret = mxl111sf_i2c_send_data(state, 0, buf); mxl111sf_i2c_hw_xfer_msg() 575 buf[2] = I2C_CONTROL_REG; mxl111sf_i2c_hw_xfer_msg() 576 buf[3] = 0x4E; mxl111sf_i2c_hw_xfer_msg() 577 buf[4] = (HWI2C400) ? 0x03 : 0x0D; mxl111sf_i2c_hw_xfer_msg() 585 buf[2] = I2C_CONTROL_REG; mxl111sf_i2c_hw_xfer_msg() 586 buf[3] = 0x4E; mxl111sf_i2c_hw_xfer_msg() 587 buf[4] = (HWI2C400) ? 0x03 : 0x0D; mxl111sf_i2c_hw_xfer_msg() 593 mxl_i2c("read buf len %d", msg->len); mxl111sf_i2c_hw_xfer_msg() 597 buf[2] = I2C_CONTROL_REG; mxl111sf_i2c_hw_xfer_msg() 598 buf[3] = 0xDF; mxl111sf_i2c_hw_xfer_msg() 599 buf[4] = (HWI2C400) ? 0x03 : 0x0D; mxl111sf_i2c_hw_xfer_msg() 602 buf[5] = 0x14; mxl111sf_i2c_hw_xfer_msg() 603 buf[6] = (msg->len & 0xFF); mxl111sf_i2c_hw_xfer_msg() 604 buf[7] = 0; mxl111sf_i2c_hw_xfer_msg() 607 buf[8] = I2C_SLAVE_ADDR_REG; mxl111sf_i2c_hw_xfer_msg() 608 buf[9] = msg->addr; mxl111sf_i2c_hw_xfer_msg() 609 buf[10] = 0x00; mxl111sf_i2c_hw_xfer_msg() 610 buf[11] = USB_END_I2C_CMD; mxl111sf_i2c_hw_xfer_msg() 611 ret = mxl111sf_i2c_send_data(state, 0, buf); mxl111sf_i2c_hw_xfer_msg() 619 buf[2] = I2C_CONTROL_REG; mxl111sf_i2c_hw_xfer_msg() 620 buf[3] = 0xC7; mxl111sf_i2c_hw_xfer_msg() 621 buf[4] = (HWI2C400) ? 0x03 : 0x0D; mxl111sf_i2c_hw_xfer_msg() 637 buf[0] = USB_READ_I2C_CMD; mxl111sf_i2c_hw_xfer_msg() 638 buf[1] = 0x00; mxl111sf_i2c_hw_xfer_msg() 643 buf[2+(i*3)] = I2C_DATA_REG; mxl111sf_i2c_hw_xfer_msg() 644 buf[3+(i*3)] = 0x00; mxl111sf_i2c_hw_xfer_msg() 645 buf[4+(i*3)] = 0x00; mxl111sf_i2c_hw_xfer_msg() 648 ret = mxl111sf_i2c_get_data(state, 0, buf, i2c_r_data); mxl111sf_i2c_hw_xfer_msg() 656 buf[2] = I2C_CONTROL_REG; mxl111sf_i2c_hw_xfer_msg() 657 buf[3] = 0xC7; mxl111sf_i2c_hw_xfer_msg() 658 buf[4] = (HWI2C400) ? 0x03 : 0x0D; mxl111sf_i2c_hw_xfer_msg() 671 msg->buf[(index*8)+i] = mxl111sf_i2c_hw_xfer_msg() 683 msg->buf[(index*8)+(k+i+1)] = mxl111sf_i2c_hw_xfer_msg() 686 msg->buf[(index*8)+(k+i)], mxl111sf_i2c_hw_xfer_msg() 689 msg->buf[(index*8)+(k+i+1)], mxl111sf_i2c_hw_xfer_msg() 699 msg->buf[(index*8)+i] = mxl111sf_i2c_hw_xfer_msg() 703 msg->buf[(index*8)+i] = mxl111sf_i2c_hw_xfer_msg() 714 buf[k] = USB_END_I2C_CMD; mxl111sf_i2c_hw_xfer_msg() 716 buf[0] = 0xDD; mxl111sf_i2c_hw_xfer_msg() 717 buf[1] = 0x00; mxl111sf_i2c_hw_xfer_msg() 720 buf[2+(i*3)] = I2C_DATA_REG; mxl111sf_i2c_hw_xfer_msg() 721 buf[3+(i*3)] = 0x00; mxl111sf_i2c_hw_xfer_msg() 722 buf[4+(i*3)] = 0x00; mxl111sf_i2c_hw_xfer_msg() 724 ret = mxl111sf_i2c_get_data(state, 0, buf, mxl111sf_i2c_hw_xfer_msg() 733 buf[2] = I2C_CONTROL_REG; mxl111sf_i2c_hw_xfer_msg() 734 buf[3] = 0xC7; mxl111sf_i2c_hw_xfer_msg() 735 buf[4] = (HWI2C400) ? 0x03 : 0x0D; mxl111sf_i2c_hw_xfer_msg() 741 msg->buf[(block_len*8)+i] = mxl111sf_i2c_hw_xfer_msg() 751 buf[0] = USB_WRITE_I2C_CMD; mxl111sf_i2c_hw_xfer_msg() 752 buf[1] = 0x00; mxl111sf_i2c_hw_xfer_msg() 755 buf[2] = I2C_CONTROL_REG; mxl111sf_i2c_hw_xfer_msg() 756 buf[3] = 0x17; mxl111sf_i2c_hw_xfer_msg() 757 buf[4] = (HWI2C400) ? 0x03 : 0x0D; mxl111sf_i2c_hw_xfer_msg() 759 buf[5] = USB_END_I2C_CMD; mxl111sf_i2c_hw_xfer_msg() 760 ret = mxl111sf_i2c_send_data(state, 0, buf); mxl111sf_i2c_hw_xfer_msg() 763 buf[2] = I2C_CONTROL_REG; mxl111sf_i2c_hw_xfer_msg() 764 buf[3] = 0xC7; mxl111sf_i2c_hw_xfer_msg() 765 buf[4] = (HWI2C400) ? 0x03 : 0x0D; mxl111sf_i2c_hw_xfer_msg() 770 buf[0] = USB_WRITE_I2C_CMD; mxl111sf_i2c_hw_xfer_msg() 771 buf[1] = 0x00; mxl111sf_i2c_hw_xfer_msg() 774 buf[5] = USB_END_I2C_CMD; mxl111sf_i2c_hw_xfer_msg() 775 mxl111sf_i2c_send_data(state, 0, buf); mxl111sf_i2c_hw_xfer_msg() 778 buf[2] = I2C_CONTROL_REG; mxl111sf_i2c_hw_xfer_msg() 779 buf[3] = 0xDF; mxl111sf_i2c_hw_xfer_msg() 780 buf[4] = 0x03; mxl111sf_i2c_hw_xfer_msg() 783 buf[5] = I2C_MUX_REG; mxl111sf_i2c_hw_xfer_msg() 784 buf[6] = 0x00; mxl111sf_i2c_hw_xfer_msg() 785 buf[7] = 0x00; mxl111sf_i2c_hw_xfer_msg() 788 buf[8] = USB_END_I2C_CMD; mxl111sf_i2c_hw_xfer_msg() 789 mxl111sf_i2c_send_data(state, 0, buf); mxl111sf_i2c_hw_xfer_msg() 792 buf[2] = I2C_MUX_REG; mxl111sf_i2c_hw_xfer_msg() 793 buf[3] = 0x81; mxl111sf_i2c_hw_xfer_msg() 794 buf[4] = 0x00; mxl111sf_i2c_hw_xfer_msg() 797 buf[5] = I2C_MUX_REG; mxl111sf_i2c_hw_xfer_msg() 798 buf[6] = 0x00; mxl111sf_i2c_hw_xfer_msg() 799 buf[7] = 0x00; mxl111sf_i2c_hw_xfer_msg() 802 buf[8] = I2C_MUX_REG; mxl111sf_i2c_hw_xfer_msg() 803 buf[9] = 0x00; mxl111sf_i2c_hw_xfer_msg() 804 buf[10] = 0x00; mxl111sf_i2c_hw_xfer_msg() 806 buf[11] = USB_END_I2C_CMD; mxl111sf_i2c_hw_xfer_msg() 807 mxl111sf_i2c_send_data(state, 0, buf); mxl111sf_i2c_hw_xfer_msg()
|
/linux-4.4.14/drivers/net/wireless/cw1200/ |
H A D | wsm.c | 30 #define WSM_SKIP(buf, size) \ 32 if ((buf)->data + size > (buf)->end) \ 34 (buf)->data += size; \ 37 #define WSM_GET(buf, ptr, size) \ 39 if ((buf)->data + size > (buf)->end) \ 41 memcpy(ptr, (buf)->data, size); \ 42 (buf)->data += size; \ 45 #define __WSM_GET(buf, type, type2, cvt) \ 48 if ((buf)->data + sizeof(type) > (buf)->end) \ 50 val = cvt(*(type2 *)(buf)->data); \ 51 (buf)->data += sizeof(type); \ 55 #define WSM_GET8(buf) __WSM_GET(buf, u8, u8, (u8)) 56 #define WSM_GET16(buf) __WSM_GET(buf, u16, __le16, __le16_to_cpu) 57 #define WSM_GET32(buf) __WSM_GET(buf, u32, __le32, __le32_to_cpu) 59 #define WSM_PUT(buf, ptr, size) \ 61 if ((buf)->data + size > (buf)->end) \ 62 if (wsm_buf_reserve((buf), size)) \ 64 memcpy((buf)->data, ptr, size); \ 65 (buf)->data += size; \ 68 #define __WSM_PUT(buf, val, type, type2, cvt) \ 70 if ((buf)->data + sizeof(type) > (buf)->end) \ 71 if (wsm_buf_reserve((buf), sizeof(type))) \ 73 *(type2 *)(buf)->data = cvt(val); \ 74 (buf)->data += sizeof(type); \ 77 #define WSM_PUT8(buf, val) __WSM_PUT(buf, val, u8, u8, (u8)) 78 #define WSM_PUT16(buf, val) __WSM_PUT(buf, val, u16, __le16, __cpu_to_le16) 79 #define WSM_PUT32(buf, val) __WSM_PUT(buf, val, u32, __le32, __cpu_to_le32) 81 static void wsm_buf_reset(struct wsm_buf *buf); 82 static int wsm_buf_reserve(struct wsm_buf *buf, size_t extra_size); 85 struct wsm_buf *buf, 96 struct wsm_buf *buf) wsm_generic_confirm() 98 u32 status = WSM_GET32(buf); wsm_generic_confirm() 111 struct wsm_buf *buf = &priv->wsm_cmd_buf; wsm_configuration() local 115 WSM_PUT32(buf, arg->dot11MaxTransmitMsduLifeTime); wsm_configuration() 116 WSM_PUT32(buf, arg->dot11MaxReceiveLifeTime); wsm_configuration() 117 WSM_PUT32(buf, arg->dot11RtsThreshold); wsm_configuration() 120 WSM_PUT16(buf, arg->dpdData_size + 12); wsm_configuration() 121 WSM_PUT16(buf, 1); /* DPD version */ wsm_configuration() 122 WSM_PUT(buf, arg->dot11StationId, ETH_ALEN); wsm_configuration() 123 WSM_PUT16(buf, 5); /* DPD flags */ wsm_configuration() 124 WSM_PUT(buf, arg->dpdData, arg->dpdData_size); wsm_configuration() 126 ret = wsm_cmd_send(priv, buf, arg, wsm_configuration() 139 struct wsm_buf *buf) wsm_configuration_confirm() 144 status = WSM_GET32(buf); wsm_configuration_confirm() 148 WSM_GET(buf, arg->dot11StationId, ETH_ALEN); wsm_configuration_confirm() 149 arg->dot11FrequencyBandsSupported = WSM_GET8(buf); wsm_configuration_confirm() 150 WSM_SKIP(buf, 1); wsm_configuration_confirm() 151 arg->supportedRateMask = WSM_GET32(buf); wsm_configuration_confirm() 153 arg->txPowerRange[i].min_power_level = WSM_GET32(buf); wsm_configuration_confirm() 154 arg->txPowerRange[i].max_power_level = WSM_GET32(buf); wsm_configuration_confirm() 155 arg->txPowerRange[i].stepping = WSM_GET32(buf); wsm_configuration_confirm() 169 struct wsm_buf *buf = &priv->wsm_cmd_buf; wsm_reset() local 174 WSM_PUT32(buf, arg->reset_statistics ? 0 : 1); wsm_reset() 175 ret = wsm_cmd_send(priv, buf, NULL, cmd, WSM_CMD_RESET_TIMEOUT); wsm_reset() 188 void *buf; member in struct:wsm_mib 196 struct wsm_buf *buf = &priv->wsm_cmd_buf; wsm_read_mib() local 199 .buf = _buf, wsm_read_mib() 204 WSM_PUT16(buf, mib_id); wsm_read_mib() 205 WSM_PUT16(buf, 0); wsm_read_mib() 207 ret = wsm_cmd_send(priv, buf, &mib_buf, wsm_read_mib() 219 struct wsm_buf *buf) wsm_read_mib_confirm() 222 if (WARN_ON(WSM_GET32(buf) != WSM_STATUS_SUCCESS)) wsm_read_mib_confirm() 225 if (WARN_ON(WSM_GET16(buf) != arg->mib_id)) wsm_read_mib_confirm() 228 size = WSM_GET16(buf); wsm_read_mib_confirm() 232 WSM_GET(buf, arg->buf, size); wsm_read_mib_confirm() 247 struct wsm_buf *buf = &priv->wsm_cmd_buf; wsm_write_mib() local 250 .buf = _buf, wsm_write_mib() 256 WSM_PUT16(buf, mib_id); wsm_write_mib() 257 WSM_PUT16(buf, buf_size); wsm_write_mib() 258 WSM_PUT(buf, _buf, buf_size); wsm_write_mib() 260 ret = wsm_cmd_send(priv, buf, &mib_buf, wsm_write_mib() 272 struct wsm_buf *buf) wsm_write_mib_confirm() 276 ret = wsm_generic_confirm(priv, arg, buf); wsm_write_mib_confirm() 282 const char *p = arg->buf; wsm_write_mib_confirm() 294 struct wsm_buf *buf = &priv->wsm_cmd_buf; wsm_scan() local 307 WSM_PUT8(buf, arg->band); wsm_scan() 308 WSM_PUT8(buf, arg->type); wsm_scan() 309 WSM_PUT8(buf, arg->flags); wsm_scan() 310 WSM_PUT8(buf, arg->max_tx_rate); wsm_scan() 311 WSM_PUT32(buf, arg->auto_scan_interval); wsm_scan() 312 WSM_PUT8(buf, arg->num_probes); wsm_scan() 313 WSM_PUT8(buf, arg->num_channels); wsm_scan() 314 WSM_PUT8(buf, arg->num_ssids); wsm_scan() 315 WSM_PUT8(buf, arg->probe_delay); wsm_scan() 318 WSM_PUT16(buf, arg->ch[i].number); wsm_scan() 319 WSM_PUT16(buf, 0); wsm_scan() 320 WSM_PUT32(buf, arg->ch[i].min_chan_time); wsm_scan() 321 WSM_PUT32(buf, arg->ch[i].max_chan_time); wsm_scan() 322 WSM_PUT32(buf, 0); wsm_scan() 326 WSM_PUT32(buf, arg->ssids[i].length); wsm_scan() 327 WSM_PUT(buf, &arg->ssids[i].ssid[0], wsm_scan() 331 ret = wsm_cmd_send(priv, buf, NULL, wsm_scan() 346 struct wsm_buf *buf = &priv->wsm_cmd_buf; wsm_stop_scan() local 348 ret = wsm_cmd_send(priv, buf, NULL, wsm_stop_scan() 356 struct wsm_buf *buf, wsm_tx_confirm() 361 tx_confirm.packet_id = WSM_GET32(buf); wsm_tx_confirm() 362 tx_confirm.status = WSM_GET32(buf); wsm_tx_confirm() 363 tx_confirm.tx_rate = WSM_GET8(buf); wsm_tx_confirm() 364 tx_confirm.ack_failures = WSM_GET8(buf); wsm_tx_confirm() 365 tx_confirm.flags = WSM_GET16(buf); wsm_tx_confirm() 366 tx_confirm.media_delay = WSM_GET32(buf); wsm_tx_confirm() 367 tx_confirm.tx_queue_delay = WSM_GET32(buf); wsm_tx_confirm() 378 struct wsm_buf *buf, int link_id) wsm_multi_tx_confirm() 384 count = WSM_GET32(buf); wsm_multi_tx_confirm() 399 ret = wsm_tx_confirm(priv, buf, link_id); wsm_multi_tx_confirm() 414 struct wsm_buf *buf) wsm_join_confirm() 416 arg->status = WSM_GET32(buf); wsm_join_confirm() 420 arg->min_power_level = WSM_GET32(buf); wsm_join_confirm() 421 arg->max_power_level = WSM_GET32(buf); wsm_join_confirm() 433 struct wsm_buf *buf = &priv->wsm_cmd_buf; wsm_join() local 437 WSM_PUT8(buf, arg->mode); wsm_join() 438 WSM_PUT8(buf, arg->band); wsm_join() 439 WSM_PUT16(buf, arg->channel_number); wsm_join() 440 WSM_PUT(buf, &arg->bssid[0], sizeof(arg->bssid)); wsm_join() 441 WSM_PUT16(buf, arg->atim_window); wsm_join() 442 WSM_PUT8(buf, arg->preamble_type); wsm_join() 443 WSM_PUT8(buf, arg->probe_for_join); wsm_join() 444 WSM_PUT8(buf, arg->dtim_period); wsm_join() 445 WSM_PUT8(buf, arg->flags); wsm_join() 446 WSM_PUT32(buf, arg->ssid_len); wsm_join() 447 WSM_PUT(buf, &arg->ssid[0], sizeof(arg->ssid)); wsm_join() 448 WSM_PUT32(buf, arg->beacon_interval); wsm_join() 449 WSM_PUT32(buf, arg->basic_rate_set); wsm_join() 452 ret = wsm_cmd_send(priv, buf, &resp, wsm_join() 472 struct wsm_buf *buf = &priv->wsm_cmd_buf; wsm_set_bss_params() local 476 WSM_PUT8(buf, (arg->reset_beacon_loss ? 0x1 : 0)); wsm_set_bss_params() 477 WSM_PUT8(buf, arg->beacon_lost_count); wsm_set_bss_params() 478 WSM_PUT16(buf, arg->aid); wsm_set_bss_params() 479 WSM_PUT32(buf, arg->operational_rate_set); wsm_set_bss_params() 481 ret = wsm_cmd_send(priv, buf, NULL, wsm_set_bss_params() 497 struct wsm_buf *buf = &priv->wsm_cmd_buf; wsm_add_key() local 501 WSM_PUT(buf, arg, sizeof(*arg)); wsm_add_key() 503 ret = wsm_cmd_send(priv, buf, NULL, wsm_add_key() 519 struct wsm_buf *buf = &priv->wsm_cmd_buf; wsm_remove_key() local 523 WSM_PUT8(buf, arg->index); wsm_remove_key() 524 WSM_PUT8(buf, 0); wsm_remove_key() 525 WSM_PUT16(buf, 0); wsm_remove_key() 527 ret = wsm_cmd_send(priv, buf, NULL, wsm_remove_key() 544 struct wsm_buf *buf = &priv->wsm_cmd_buf; wsm_set_tx_queue_params() local 549 WSM_PUT8(buf, queue_id_to_wmm_aci[id]); wsm_set_tx_queue_params() 550 WSM_PUT8(buf, 0); wsm_set_tx_queue_params() 551 WSM_PUT8(buf, arg->ackPolicy); wsm_set_tx_queue_params() 552 WSM_PUT8(buf, 0); wsm_set_tx_queue_params() 553 WSM_PUT32(buf, arg->maxTransmitLifetime); wsm_set_tx_queue_params() 554 WSM_PUT16(buf, arg->allowedMediumTime); wsm_set_tx_queue_params() 555 WSM_PUT16(buf, 0); wsm_set_tx_queue_params() 557 ret = wsm_cmd_send(priv, buf, NULL, 0x0012, WSM_CMD_TIMEOUT); wsm_set_tx_queue_params() 573 struct wsm_buf *buf = &priv->wsm_cmd_buf; wsm_set_edca_params() local 579 WSM_PUT16(buf, arg->params[3].cwmin); wsm_set_edca_params() 580 WSM_PUT16(buf, arg->params[2].cwmin); wsm_set_edca_params() 581 WSM_PUT16(buf, arg->params[1].cwmin); wsm_set_edca_params() 582 WSM_PUT16(buf, arg->params[0].cwmin); wsm_set_edca_params() 584 WSM_PUT16(buf, arg->params[3].cwmax); wsm_set_edca_params() 585 WSM_PUT16(buf, arg->params[2].cwmax); wsm_set_edca_params() 586 WSM_PUT16(buf, arg->params[1].cwmax); wsm_set_edca_params() 587 WSM_PUT16(buf, arg->params[0].cwmax); wsm_set_edca_params() 589 WSM_PUT8(buf, arg->params[3].aifns); wsm_set_edca_params() 590 WSM_PUT8(buf, arg->params[2].aifns); wsm_set_edca_params() 591 WSM_PUT8(buf, arg->params[1].aifns); wsm_set_edca_params() 592 WSM_PUT8(buf, arg->params[0].aifns); wsm_set_edca_params() 594 WSM_PUT16(buf, arg->params[3].txop_limit); wsm_set_edca_params() 595 WSM_PUT16(buf, arg->params[2].txop_limit); wsm_set_edca_params() 596 WSM_PUT16(buf, arg->params[1].txop_limit); wsm_set_edca_params() 597 WSM_PUT16(buf, arg->params[0].txop_limit); wsm_set_edca_params() 599 WSM_PUT32(buf, arg->params[3].max_rx_lifetime); wsm_set_edca_params() 600 WSM_PUT32(buf, arg->params[2].max_rx_lifetime); wsm_set_edca_params() 601 WSM_PUT32(buf, arg->params[1].max_rx_lifetime); wsm_set_edca_params() 602 WSM_PUT32(buf, arg->params[0].max_rx_lifetime); wsm_set_edca_params() 604 ret = wsm_cmd_send(priv, buf, NULL, wsm_set_edca_params() 620 struct wsm_buf *buf = &priv->wsm_cmd_buf; wsm_switch_channel() local 624 WSM_PUT8(buf, arg->mode); wsm_switch_channel() 625 WSM_PUT8(buf, arg->switch_count); wsm_switch_channel() 626 WSM_PUT16(buf, arg->channel_number); wsm_switch_channel() 630 ret = wsm_cmd_send(priv, buf, NULL, wsm_switch_channel() 648 struct wsm_buf *buf = &priv->wsm_cmd_buf; wsm_set_pm() local 653 WSM_PUT8(buf, arg->mode); wsm_set_pm() 654 WSM_PUT8(buf, arg->fast_psm_idle_period); wsm_set_pm() 655 WSM_PUT8(buf, arg->ap_psm_change_period); wsm_set_pm() 656 WSM_PUT8(buf, arg->min_auto_pspoll_period); wsm_set_pm() 658 ret = wsm_cmd_send(priv, buf, NULL, wsm_set_pm() 674 struct wsm_buf *buf = &priv->wsm_cmd_buf; wsm_start() local 678 WSM_PUT8(buf, arg->mode); wsm_start() 679 WSM_PUT8(buf, arg->band); wsm_start() 680 WSM_PUT16(buf, arg->channel_number); wsm_start() 681 WSM_PUT32(buf, arg->ct_window); wsm_start() 682 WSM_PUT32(buf, arg->beacon_interval); wsm_start() 683 WSM_PUT8(buf, arg->dtim_period); wsm_start() 684 WSM_PUT8(buf, arg->preamble); wsm_start() 685 WSM_PUT8(buf, arg->probe_delay); wsm_start() 686 WSM_PUT8(buf, arg->ssid_len); wsm_start() 687 WSM_PUT(buf, arg->ssid, sizeof(arg->ssid)); wsm_start() 688 WSM_PUT32(buf, arg->basic_rate_set); wsm_start() 691 ret = wsm_cmd_send(priv, buf, NULL, wsm_start() 708 struct wsm_buf *buf = &priv->wsm_cmd_buf; wsm_beacon_transmit() local 712 WSM_PUT32(buf, arg->enable_beaconing ? 1 : 0); wsm_beacon_transmit() 714 ret = wsm_cmd_send(priv, buf, NULL, wsm_beacon_transmit() 730 struct wsm_buf *buf = &priv->wsm_cmd_buf; wsm_start_find() local 733 ret = wsm_cmd_send(priv, buf, NULL, 0x0019, WSM_CMD_TIMEOUT); wsm_start_find() 743 struct wsm_buf *buf = &priv->wsm_cmd_buf; wsm_stop_find() local 746 ret = wsm_cmd_send(priv, buf, NULL, 0x001A, WSM_CMD_TIMEOUT); wsm_stop_find() 756 struct wsm_buf *buf = &priv->wsm_cmd_buf; wsm_map_link() local 761 WSM_PUT(buf, &arg->mac_addr[0], sizeof(arg->mac_addr)); wsm_map_link() 762 WSM_PUT16(buf, 0); wsm_map_link() 764 ret = wsm_cmd_send(priv, buf, NULL, cmd, WSM_CMD_TIMEOUT); wsm_map_link() 780 struct wsm_buf *buf = &priv->wsm_cmd_buf; wsm_update_ie() local 784 WSM_PUT16(buf, arg->what); wsm_update_ie() 785 WSM_PUT16(buf, arg->count); wsm_update_ie() 786 WSM_PUT(buf, arg->ies, arg->length); wsm_update_ie() 788 ret = wsm_cmd_send(priv, buf, NULL, 0x001B, WSM_CMD_TIMEOUT); wsm_update_ie() 816 struct wsm_buf *buf) wsm_startup_indication() 818 priv->wsm_caps.input_buffers = WSM_GET16(buf); wsm_startup_indication() 819 priv->wsm_caps.input_buffer_size = WSM_GET16(buf); wsm_startup_indication() 820 priv->wsm_caps.hw_id = WSM_GET16(buf); wsm_startup_indication() 821 priv->wsm_caps.hw_subid = WSM_GET16(buf); wsm_startup_indication() 822 priv->wsm_caps.status = WSM_GET16(buf); wsm_startup_indication() 823 priv->wsm_caps.fw_cap = WSM_GET16(buf); wsm_startup_indication() 824 priv->wsm_caps.fw_type = WSM_GET16(buf); wsm_startup_indication() 825 priv->wsm_caps.fw_api = WSM_GET16(buf); wsm_startup_indication() 826 priv->wsm_caps.fw_build = WSM_GET16(buf); wsm_startup_indication() 827 priv->wsm_caps.fw_ver = WSM_GET16(buf); wsm_startup_indication() 828 WSM_GET(buf, priv->wsm_caps.fw_label, sizeof(priv->wsm_caps.fw_label)); wsm_startup_indication() 867 struct wsm_buf *buf, wsm_receive_indication() 875 rx.status = WSM_GET32(buf); wsm_receive_indication() 876 rx.channel_number = WSM_GET16(buf); wsm_receive_indication() 877 rx.rx_rate = WSM_GET8(buf); wsm_receive_indication() 878 rx.rcpi_rssi = WSM_GET8(buf); wsm_receive_indication() 879 rx.flags = WSM_GET32(buf); wsm_receive_indication() 897 fctl = *(__le16 *)buf->data; wsm_receive_indication() 898 hdr_len = buf->data - buf->begin; wsm_receive_indication() 920 static int wsm_event_indication(struct cw1200_common *priv, struct wsm_buf *buf) wsm_event_indication() argument 934 event->evt.id = WSM_GET32(buf); wsm_event_indication() 935 event->evt.data = WSM_GET32(buf); wsm_event_indication() 956 struct wsm_buf *buf) wsm_channel_switch_indication() 958 WARN_ON(WSM_GET32(buf)); wsm_channel_switch_indication() 972 struct wsm_buf *buf) wsm_set_pm_indication() 974 /* TODO: Check buf (struct wsm_set_pm_complete) for validity */ wsm_set_pm_indication() 983 struct wsm_buf *buf) wsm_scan_started() 985 u32 status = WSM_GET32(buf); wsm_scan_started() 998 struct wsm_buf *buf) wsm_scan_complete_indication() 1001 arg.status = WSM_GET32(buf); wsm_scan_complete_indication() 1002 arg.psm = WSM_GET8(buf); wsm_scan_complete_indication() 1003 arg.num_channels = WSM_GET8(buf); wsm_scan_complete_indication() 1013 struct wsm_buf *buf) wsm_join_complete_indication() 1016 arg.status = WSM_GET32(buf); wsm_join_complete_indication() 1027 struct wsm_buf *buf) wsm_find_complete_indication() 1034 struct wsm_buf *buf) wsm_ba_timeout_indication() 1041 dummy = WSM_GET32(buf); wsm_ba_timeout_indication() 1042 tid = WSM_GET8(buf); wsm_ba_timeout_indication() 1043 dummy2 = WSM_GET8(buf); wsm_ba_timeout_indication() 1044 WSM_GET(buf, addr, ETH_ALEN); wsm_ba_timeout_indication() 1056 int link_id, struct wsm_buf *buf) wsm_suspend_resume_indication() 1061 flags = WSM_GET32(buf); wsm_suspend_resume_indication() 1080 struct wsm_buf *buf, wsm_cmd_send() 1083 size_t buf_len = buf->data - buf->begin; wsm_cmd_send() 1104 cmd, __le16_to_cpu(((__le16 *)buf->begin)[2]), wsm_cmd_send() 1117 ((__le16 *)buf->begin)[0] = __cpu_to_le16(buf_len); wsm_cmd_send() 1118 ((__le16 *)buf->begin)[1] = __cpu_to_le16(cmd); wsm_cmd_send() 1122 priv->wsm_cmd.ptr = buf->begin; wsm_cmd_send() 1145 buf->begin, buf_len); wsm_cmd_send() 1160 wsm_buf_reset(buf); wsm_cmd_send() 1248 struct wsm_buf buf; wsm_handle_exception() local 1261 buf.begin = buf.data = data; wsm_handle_exception() 1262 buf.end = &buf.begin[len]; wsm_handle_exception() 1264 reason = WSM_GET32(&buf); wsm_handle_exception() 1266 reg[i] = WSM_GET32(&buf); wsm_handle_exception() 1267 WSM_GET(&buf, fname, sizeof(fname)); wsm_handle_exception() 1782 void wsm_buf_init(struct wsm_buf *buf) wsm_buf_init() argument 1784 BUG_ON(buf->begin); wsm_buf_init() 1785 buf->begin = kmalloc(FWLOAD_BLOCK_SIZE, GFP_KERNEL | GFP_DMA); wsm_buf_init() 1786 buf->end = buf->begin ? &buf->begin[FWLOAD_BLOCK_SIZE] : buf->begin; wsm_buf_init() 1787 wsm_buf_reset(buf); wsm_buf_init() 1790 void wsm_buf_deinit(struct wsm_buf *buf) wsm_buf_deinit() argument 1792 kfree(buf->begin); wsm_buf_deinit() 1793 buf->begin = buf->data = buf->end = NULL; wsm_buf_deinit() 1796 static void wsm_buf_reset(struct wsm_buf *buf) wsm_buf_reset() argument 1798 if (buf->begin) { wsm_buf_reset() 1799 buf->data = &buf->begin[4]; wsm_buf_reset() 1800 *(u32 *)buf->begin = 0; wsm_buf_reset() 1802 buf->data = buf->begin; wsm_buf_reset() 1806 static int wsm_buf_reserve(struct wsm_buf *buf, size_t extra_size) wsm_buf_reserve() argument 1808 size_t pos = buf->data - buf->begin; wsm_buf_reserve() 1813 buf->begin = krealloc(buf->begin, size, GFP_KERNEL | GFP_DMA); wsm_buf_reserve() 1814 if (buf->begin) { wsm_buf_reserve() 1815 buf->data = &buf->begin[pos]; wsm_buf_reserve() 1816 buf->end = &buf->begin[size]; wsm_buf_reserve() 1819 buf->end = buf->data = buf->begin; wsm_buf_reserve() 94 wsm_generic_confirm(struct cw1200_common *priv, void *arg, struct wsm_buf *buf) wsm_generic_confirm() argument 137 wsm_configuration_confirm(struct cw1200_common *priv, struct wsm_configuration *arg, struct wsm_buf *buf) wsm_configuration_confirm() argument 217 wsm_read_mib_confirm(struct cw1200_common *priv, struct wsm_mib *arg, struct wsm_buf *buf) wsm_read_mib_confirm() argument 270 wsm_write_mib_confirm(struct cw1200_common *priv, struct wsm_mib *arg, struct wsm_buf *buf) wsm_write_mib_confirm() argument 355 wsm_tx_confirm(struct cw1200_common *priv, struct wsm_buf *buf, int link_id) wsm_tx_confirm() argument 377 wsm_multi_tx_confirm(struct cw1200_common *priv, struct wsm_buf *buf, int link_id) wsm_multi_tx_confirm() argument 412 wsm_join_confirm(struct cw1200_common *priv, struct wsm_join_cnf *arg, struct wsm_buf *buf) wsm_join_confirm() argument 815 wsm_startup_indication(struct cw1200_common *priv, struct wsm_buf *buf) wsm_startup_indication() argument 865 wsm_receive_indication(struct cw1200_common *priv, int link_id, struct wsm_buf *buf, struct sk_buff **skb_p) wsm_receive_indication() argument 955 wsm_channel_switch_indication(struct cw1200_common *priv, struct wsm_buf *buf) wsm_channel_switch_indication() argument 971 wsm_set_pm_indication(struct cw1200_common *priv, struct wsm_buf *buf) wsm_set_pm_indication() argument 982 wsm_scan_started(struct cw1200_common *priv, void *arg, struct wsm_buf *buf) wsm_scan_started() argument 997 wsm_scan_complete_indication(struct cw1200_common *priv, struct wsm_buf *buf) wsm_scan_complete_indication() argument 1012 wsm_join_complete_indication(struct cw1200_common *priv, struct wsm_buf *buf) wsm_join_complete_indication() argument 1026 wsm_find_complete_indication(struct cw1200_common *priv, struct wsm_buf *buf) wsm_find_complete_indication() argument 1033 wsm_ba_timeout_indication(struct cw1200_common *priv, struct wsm_buf *buf) wsm_ba_timeout_indication() argument 1055 wsm_suspend_resume_indication(struct cw1200_common *priv, int link_id, struct wsm_buf *buf) wsm_suspend_resume_indication() argument 1079 wsm_cmd_send(struct cw1200_common *priv, struct wsm_buf *buf, void *arg, u16 cmd, long tmo) wsm_cmd_send() argument
|
/linux-4.4.14/net/ax25/ |
H A D | ax25_addr.c | 49 char *ax2asc(char *buf, const ax25_address *a) ax2asc() argument 54 for (n = 0, s = buf; n < 6; n++) { ax2asc() 70 if (*buf == '\0' || *buf == '-') ax2asc() 73 return buf; ax2asc() 159 const unsigned char *ax25_addr_parse(const unsigned char *buf, int len, ax25_addr_parse() argument 170 if (buf[6] & AX25_CBIT) ax25_addr_parse() 172 if (buf[13] & AX25_CBIT) ax25_addr_parse() 177 *dama = ~buf[13] & AX25_DAMA_FLAG; ax25_addr_parse() 181 memcpy(dest, buf + 0, AX25_ADDR_LEN); ax25_addr_parse() 183 memcpy(src, buf + 7, AX25_ADDR_LEN); ax25_addr_parse() 185 buf += 2 * AX25_ADDR_LEN; ax25_addr_parse() 191 while (!(buf[-1] & AX25_EBIT)) { ax25_addr_parse() 197 memcpy(&digi->calls[d], buf, AX25_ADDR_LEN); ax25_addr_parse() 200 if (buf[6] & AX25_HBIT) { ax25_addr_parse() 207 buf += AX25_ADDR_LEN; ax25_addr_parse() 212 return buf; ax25_addr_parse() 218 int ax25_addr_build(unsigned char *buf, const ax25_address *src, ax25_addr_build() argument 224 memcpy(buf, dest, AX25_ADDR_LEN); ax25_addr_build() 225 buf[6] &= ~(AX25_EBIT | AX25_CBIT); ax25_addr_build() 226 buf[6] |= AX25_SSSID_SPARE; ax25_addr_build() 228 if (flag == AX25_COMMAND) buf[6] |= AX25_CBIT; ax25_addr_build() 230 buf += AX25_ADDR_LEN; ax25_addr_build() 233 memcpy(buf, src, AX25_ADDR_LEN); ax25_addr_build() 234 buf[6] &= ~(AX25_EBIT | AX25_CBIT); ax25_addr_build() 235 buf[6] &= ~AX25_SSSID_SPARE; ax25_addr_build() 238 buf[6] |= AX25_SSSID_SPARE; ax25_addr_build() 240 buf[6] |= AX25_ESSID_SPARE; ax25_addr_build() 242 if (flag == AX25_RESPONSE) buf[6] |= AX25_CBIT; ax25_addr_build() 248 buf[6] |= AX25_EBIT; ax25_addr_build() 252 buf += AX25_ADDR_LEN; ax25_addr_build() 256 memcpy(buf, &d->calls[ct], AX25_ADDR_LEN); ax25_addr_build() 259 buf[6] |= AX25_HBIT; ax25_addr_build() 261 buf[6] &= ~AX25_HBIT; ax25_addr_build() 263 buf[6] &= ~AX25_EBIT; ax25_addr_build() 264 buf[6] |= AX25_SSSID_SPARE; ax25_addr_build() 266 buf += AX25_ADDR_LEN; ax25_addr_build() 271 buf[-1] |= AX25_EBIT; ax25_addr_build()
|
/linux-4.4.14/security/keys/ |
H A D | trusted.h | 74 static inline void dump_tpm_buf(unsigned char *buf) dump_tpm_buf() argument 79 len = LOAD32(buf, TPM_SIZE_OFFSET); dump_tpm_buf() 80 print_hex_dump(KERN_INFO, "", DUMP_PREFIX_NONE, 16, 1, buf, len, 0); dump_tpm_buf() 95 static inline void dump_tpm_buf(unsigned char *buf) dump_tpm_buf() argument 100 static inline void store8(struct tpm_buf *buf, const unsigned char value) store8() argument 102 buf->data[buf->len++] = value; store8() 105 static inline void store16(struct tpm_buf *buf, const uint16_t value) store16() argument 107 *(uint16_t *) & buf->data[buf->len] = htons(value); store16() 108 buf->len += sizeof value; store16() 111 static inline void store32(struct tpm_buf *buf, const uint32_t value) store32() argument 113 *(uint32_t *) & buf->data[buf->len] = htonl(value); store32() 114 buf->len += sizeof value; store32() 117 static inline void storebytes(struct tpm_buf *buf, const unsigned char *in, storebytes() argument 120 memcpy(buf->data + buf->len, in, len); storebytes() 121 buf->len += len; storebytes()
|
/linux-4.4.14/tools/perf/util/intel-pt-decoder/ |
H A D | intel-pt-pkt-decoder.c | 73 static int intel_pt_get_long_tnt(const unsigned char *buf, size_t len, intel_pt_get_long_tnt() argument 82 payload = le64_to_cpu(*(uint64_t *)buf); intel_pt_get_long_tnt() 96 static int intel_pt_get_pip(const unsigned char *buf, size_t len, intel_pt_get_pip() argument 105 memcpy_le64(&payload, buf + 2, 6); intel_pt_get_pip() 119 static int intel_pt_get_cbr(const unsigned char *buf, size_t len, intel_pt_get_cbr() argument 125 packet->payload = buf[2]; intel_pt_get_cbr() 129 static int intel_pt_get_vmcs(const unsigned char *buf, size_t len, intel_pt_get_vmcs() argument 142 memcpy_le64(&packet->payload, buf + 2, count); intel_pt_get_vmcs() 153 static int intel_pt_get_psb(const unsigned char *buf, size_t len, intel_pt_get_psb() argument 162 if (buf[i] != 2 || buf[i + 1] != 0x82) intel_pt_get_psb() 176 static int intel_pt_get_tma(const unsigned char *buf, size_t len, intel_pt_get_tma() argument 183 packet->payload = buf[2] | (buf[3] << 8); intel_pt_get_tma() 184 packet->count = buf[5] | ((buf[6] & BIT(0)) << 8); intel_pt_get_tma() 194 static int intel_pt_get_mnt(const unsigned char *buf, size_t len, intel_pt_get_mnt() argument 200 memcpy_le64(&packet->payload, buf + 3, 8); intel_pt_get_mnt() 205 static int intel_pt_get_3byte(const unsigned char *buf, size_t len, intel_pt_get_3byte() argument 211 switch (buf[2]) { intel_pt_get_3byte() 213 return intel_pt_get_mnt(buf, len, packet); intel_pt_get_3byte() 219 static int intel_pt_get_ext(const unsigned char *buf, size_t len, intel_pt_get_ext() argument 225 switch (buf[1]) { intel_pt_get_ext() 227 return intel_pt_get_long_tnt(buf, len, packet); intel_pt_get_ext() 229 return intel_pt_get_pip(buf, len, packet); intel_pt_get_ext() 233 return intel_pt_get_cbr(buf, len, packet); intel_pt_get_ext() 235 return intel_pt_get_vmcs(buf, len, packet); intel_pt_get_ext() 239 return intel_pt_get_psb(buf, len, packet); intel_pt_get_ext() 243 return intel_pt_get_tma(buf, len, packet); intel_pt_get_ext() 245 return intel_pt_get_3byte(buf, len, packet); intel_pt_get_ext() 269 static int intel_pt_get_cyc(unsigned int byte, const unsigned char *buf, intel_pt_get_cyc() argument 282 byte = buf[offs++]; intel_pt_get_cyc() 292 const unsigned char *buf, size_t len, intel_pt_get_ip() 303 packet->payload = le16_to_cpu(*(uint16_t *)(buf + 1)); intel_pt_get_ip() 309 packet->payload = le32_to_cpu(*(uint32_t *)(buf + 1)); intel_pt_get_ip() 316 memcpy_le64(&packet->payload, buf + 1, 6); intel_pt_get_ip() 327 static int intel_pt_get_mode(const unsigned char *buf, size_t len, intel_pt_get_mode() argument 333 switch (buf[1] >> 5) { intel_pt_get_mode() 336 switch (buf[1] & 3) { intel_pt_get_mode() 352 if ((buf[1] & 3) == 3) intel_pt_get_mode() 354 packet->payload = buf[1] & 3; intel_pt_get_mode() 363 static int intel_pt_get_tsc(const unsigned char *buf, size_t len, intel_pt_get_tsc() argument 369 memcpy_le64(&packet->payload, buf + 1, 7); intel_pt_get_tsc() 373 static int intel_pt_get_mtc(const unsigned char *buf, size_t len, intel_pt_get_mtc() argument 379 packet->payload = buf[1]; intel_pt_get_mtc() 383 static int intel_pt_do_get_packet(const unsigned char *buf, size_t len, intel_pt_do_get_packet() argument 393 byte = buf[0]; intel_pt_do_get_packet() 398 return intel_pt_get_ext(buf, len, packet); intel_pt_do_get_packet() 403 return intel_pt_get_cyc(byte, buf, len, packet); intel_pt_do_get_packet() 407 return intel_pt_get_ip(INTEL_PT_TIP, byte, buf, len, packet); intel_pt_do_get_packet() 409 return intel_pt_get_ip(INTEL_PT_TIP_PGE, byte, buf, len, intel_pt_do_get_packet() 412 return intel_pt_get_ip(INTEL_PT_TIP_PGD, byte, buf, len, intel_pt_do_get_packet() 415 return intel_pt_get_ip(INTEL_PT_FUP, byte, buf, len, packet); intel_pt_do_get_packet() 419 return intel_pt_get_mode(buf, len, packet); intel_pt_do_get_packet() 421 return intel_pt_get_tsc(buf, len, packet); intel_pt_do_get_packet() 423 return intel_pt_get_mtc(buf, len, packet); intel_pt_do_get_packet() 432 int intel_pt_get_packet(const unsigned char *buf, size_t len, intel_pt_get_packet() argument 437 ret = intel_pt_do_get_packet(buf, len, packet); intel_pt_get_packet() 439 while (ret < 8 && len > (size_t)ret && !buf[ret]) intel_pt_get_packet() 445 int intel_pt_pkt_desc(const struct intel_pt_pkt *packet, char *buf, intel_pt_pkt_desc() argument 459 return snprintf(buf, buf_len, "%s", name); intel_pt_pkt_desc() 463 ret = snprintf(buf, blen, "%s ", name); intel_pt_pkt_desc() 466 buf += ret; intel_pt_pkt_desc() 470 ret = snprintf(buf, blen, "T"); intel_pt_pkt_desc() 472 ret = snprintf(buf, blen, "N"); intel_pt_pkt_desc() 475 buf += ret; intel_pt_pkt_desc() 479 ret = snprintf(buf, blen, " (%d)", packet->count); intel_pt_pkt_desc() 490 return snprintf(buf, buf_len, "%s no ip", name); intel_pt_pkt_desc() 497 return snprintf(buf, buf_len, "%s 0x%llx", name, payload); intel_pt_pkt_desc() 499 return snprintf(buf, buf_len, "%s CTC 0x%x FC 0x%x", name, intel_pt_pkt_desc() 502 return snprintf(buf, buf_len, "%s %lld", name, payload); intel_pt_pkt_desc() 504 return snprintf(buf, buf_len, "%s TXAbort:%u InTX:%u", intel_pt_pkt_desc() 510 ret = snprintf(buf, buf_len, "%s 0x%llx (NR=%d)", intel_pt_pkt_desc() 516 return snprintf(buf, buf_len, "%s 0x%llx (%d)", intel_pt_pkt_desc() 291 intel_pt_get_ip(enum intel_pt_pkt_type type, unsigned int byte, const unsigned char *buf, size_t len, struct intel_pt_pkt *packet) intel_pt_get_ip() argument
|
/linux-4.4.14/Documentation/spi/ |
H A D | spidev_fdx.c | 19 unsigned char buf[32], *bp; do_read() local 25 else if (len > sizeof(buf)) do_read() 26 len = sizeof(buf); do_read() 27 memset(buf, 0, sizeof buf); do_read() 29 status = read(fd, buf, len); do_read() 40 buf[0], buf[1]); do_read() 42 bp = buf + 2; do_read() 51 unsigned char buf[32], *bp; do_msg() local 55 memset(buf, 0, sizeof buf); do_msg() 57 if (len > sizeof buf) do_msg() 58 len = sizeof buf; do_msg() 60 buf[0] = 0xaa; do_msg() 61 xfer[0].tx_buf = (unsigned long)buf; do_msg() 64 xfer[1].rx_buf = (unsigned long) buf; do_msg() 74 for (bp = buf; len; len--) do_msg()
|
/linux-4.4.14/sound/usb/caiaq/ |
H A D | input.c | 204 int axis, const unsigned char *buf, snd_caiaq_input_report_abs() 208 (buf[offset * 2] << 8) | buf[offset * 2 + 1]); snd_caiaq_input_report_abs() 212 const unsigned char *buf, snd_caiaq_input_read_analog() 219 snd_caiaq_input_report_abs(cdev, ABS_X, buf, 2); snd_caiaq_input_read_analog() 220 snd_caiaq_input_report_abs(cdev, ABS_Y, buf, 0); snd_caiaq_input_read_analog() 221 snd_caiaq_input_report_abs(cdev, ABS_Z, buf, 1); snd_caiaq_input_read_analog() 226 snd_caiaq_input_report_abs(cdev, ABS_X, buf, 0); snd_caiaq_input_read_analog() 227 snd_caiaq_input_report_abs(cdev, ABS_Y, buf, 1); snd_caiaq_input_read_analog() 228 snd_caiaq_input_report_abs(cdev, ABS_Z, buf, 2); snd_caiaq_input_read_analog() 231 snd_caiaq_input_report_abs(cdev, ABS_HAT0X, buf, 4); snd_caiaq_input_read_analog() 232 snd_caiaq_input_report_abs(cdev, ABS_HAT0Y, buf, 2); snd_caiaq_input_read_analog() 233 snd_caiaq_input_report_abs(cdev, ABS_HAT1X, buf, 6); snd_caiaq_input_read_analog() 234 snd_caiaq_input_report_abs(cdev, ABS_HAT1Y, buf, 1); snd_caiaq_input_read_analog() 235 snd_caiaq_input_report_abs(cdev, ABS_HAT2X, buf, 7); snd_caiaq_input_read_analog() 236 snd_caiaq_input_report_abs(cdev, ABS_HAT2Y, buf, 0); snd_caiaq_input_read_analog() 237 snd_caiaq_input_report_abs(cdev, ABS_HAT3X, buf, 5); snd_caiaq_input_read_analog() 238 snd_caiaq_input_report_abs(cdev, ABS_HAT3Y, buf, 3); snd_caiaq_input_read_analog() 246 const char *buf, unsigned int len) snd_caiaq_input_read_erp() 253 i = decode_erp(buf[0], buf[1]); snd_caiaq_input_read_erp() 259 i = decode_erp(buf[7], buf[5]); snd_caiaq_input_read_erp() 261 i = decode_erp(buf[12], buf[14]); snd_caiaq_input_read_erp() 263 i = decode_erp(buf[15], buf[13]); snd_caiaq_input_read_erp() 265 i = decode_erp(buf[0], buf[2]); snd_caiaq_input_read_erp() 267 i = decode_erp(buf[3], buf[1]); snd_caiaq_input_read_erp() 269 i = decode_erp(buf[8], buf[10]); snd_caiaq_input_read_erp() 271 i = decode_erp(buf[11], buf[9]); snd_caiaq_input_read_erp() 273 i = decode_erp(buf[4], buf[6]); snd_caiaq_input_read_erp() 280 input_report_abs(input_dev, ABS_HAT0X, decode_erp(buf[21], buf[20])); snd_caiaq_input_read_erp() 281 input_report_abs(input_dev, ABS_HAT0Y, decode_erp(buf[15], buf[14])); snd_caiaq_input_read_erp() 282 input_report_abs(input_dev, ABS_HAT1X, decode_erp(buf[9], buf[8])); snd_caiaq_input_read_erp() 283 input_report_abs(input_dev, ABS_HAT1Y, decode_erp(buf[3], buf[2])); snd_caiaq_input_read_erp() 286 input_report_abs(input_dev, ABS_HAT2X, decode_erp(buf[19], buf[18])); snd_caiaq_input_read_erp() 287 input_report_abs(input_dev, ABS_HAT2Y, decode_erp(buf[13], buf[12])); snd_caiaq_input_read_erp() 288 input_report_abs(input_dev, ABS_HAT3X, decode_erp(buf[7], buf[6])); snd_caiaq_input_read_erp() 289 input_report_abs(input_dev, ABS_HAT3Y, decode_erp(buf[1], buf[0])); snd_caiaq_input_read_erp() 292 input_report_abs(input_dev, ABS_RX, decode_erp(buf[17], buf[16])); snd_caiaq_input_read_erp() 294 input_report_abs(input_dev, ABS_RY, decode_erp(buf[11], buf[10])); snd_caiaq_input_read_erp() 296 input_report_abs(input_dev, ABS_RZ, decode_erp(buf[5], buf[4])); snd_caiaq_input_read_erp() 304 unsigned char *buf, unsigned int len) snd_caiaq_input_read_io() 315 buf[i] = ~buf[i]; snd_caiaq_input_read_io() 319 buf[i / 8] & (1 << (i % 8))); snd_caiaq_input_read_io() 324 input_report_abs(cdev->input_dev, ABS_MISC, 255 - buf[4]); snd_caiaq_input_read_io() 328 input_report_abs(cdev->input_dev, ABS_X, buf[5] & 0xf); snd_caiaq_input_read_io() 329 input_report_abs(cdev->input_dev, ABS_Y, buf[5] >> 4); snd_caiaq_input_read_io() 330 input_report_abs(cdev->input_dev, ABS_Z, buf[6] & 0xf); snd_caiaq_input_read_io() 331 input_report_abs(cdev->input_dev, ABS_MISC, buf[6] >> 4); snd_caiaq_input_read_io() 341 const unsigned char *buf, snd_usb_caiaq_tks4_dispatch() 347 unsigned int i, block_id = (buf[0] << 8) | buf[1]; snd_usb_caiaq_tks4_dispatch() 354 (buf[4 + (i / 8)] >> (i % 8)) & 1); snd_usb_caiaq_tks4_dispatch() 359 input_report_abs(cdev->input_dev, KONTROLS4_ABS(36), buf[9] | ((buf[8] & 0x3) << 8)); snd_usb_caiaq_tks4_dispatch() 361 input_report_abs(cdev->input_dev, KONTROLS4_ABS(37), buf[13] | ((buf[12] & 0x3) << 8)); snd_usb_caiaq_tks4_dispatch() 364 input_report_abs(cdev->input_dev, KONTROLS4_ABS(38), buf[3] & 0xf); snd_usb_caiaq_tks4_dispatch() 365 input_report_abs(cdev->input_dev, KONTROLS4_ABS(39), buf[4] >> 4); snd_usb_caiaq_tks4_dispatch() 366 input_report_abs(cdev->input_dev, KONTROLS4_ABS(40), buf[4] & 0xf); snd_usb_caiaq_tks4_dispatch() 367 input_report_abs(cdev->input_dev, KONTROLS4_ABS(41), buf[5] >> 4); snd_usb_caiaq_tks4_dispatch() 368 input_report_abs(cdev->input_dev, KONTROLS4_ABS(42), buf[5] & 0xf); snd_usb_caiaq_tks4_dispatch() 369 input_report_abs(cdev->input_dev, KONTROLS4_ABS(43), buf[6] >> 4); snd_usb_caiaq_tks4_dispatch() 370 input_report_abs(cdev->input_dev, KONTROLS4_ABS(44), buf[6] & 0xf); snd_usb_caiaq_tks4_dispatch() 371 input_report_abs(cdev->input_dev, KONTROLS4_ABS(45), buf[7] >> 4); snd_usb_caiaq_tks4_dispatch() 372 input_report_abs(cdev->input_dev, KONTROLS4_ABS(46), buf[7] & 0xf); snd_usb_caiaq_tks4_dispatch() 377 snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(0), buf, 1); snd_usb_caiaq_tks4_dispatch() 379 snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(1), buf, 2); snd_usb_caiaq_tks4_dispatch() 381 snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(2), buf, 3); snd_usb_caiaq_tks4_dispatch() 383 snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(3), buf, 4); snd_usb_caiaq_tks4_dispatch() 385 snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(4), buf, 6); snd_usb_caiaq_tks4_dispatch() 387 snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(7), buf, 7); snd_usb_caiaq_tks4_dispatch() 393 snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(6), buf, 3); snd_usb_caiaq_tks4_dispatch() 395 snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(5), buf, 4); snd_usb_caiaq_tks4_dispatch() 397 snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(8), buf, 6); snd_usb_caiaq_tks4_dispatch() 399 snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(9), buf, 7); snd_usb_caiaq_tks4_dispatch() 405 snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(10), buf, 1); snd_usb_caiaq_tks4_dispatch() 407 snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(11), buf, 2); snd_usb_caiaq_tks4_dispatch() 409 snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(12), buf, 3); snd_usb_caiaq_tks4_dispatch() 411 snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(13), buf, 4); snd_usb_caiaq_tks4_dispatch() 413 snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(14), buf, 5); snd_usb_caiaq_tks4_dispatch() 415 snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(15), buf, 6); snd_usb_caiaq_tks4_dispatch() 417 snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(16), buf, 7); snd_usb_caiaq_tks4_dispatch() 423 snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(17), buf, 1); snd_usb_caiaq_tks4_dispatch() 425 snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(18), buf, 2); snd_usb_caiaq_tks4_dispatch() 427 snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(19), buf, 3); snd_usb_caiaq_tks4_dispatch() 429 snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(20), buf, 4); snd_usb_caiaq_tks4_dispatch() 431 snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(21), buf, 5); snd_usb_caiaq_tks4_dispatch() 433 snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(22), buf, 6); snd_usb_caiaq_tks4_dispatch() 435 snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(23), buf, 7); snd_usb_caiaq_tks4_dispatch() 441 snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(24), buf, 1); snd_usb_caiaq_tks4_dispatch() 443 snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(25), buf, 2); snd_usb_caiaq_tks4_dispatch() 445 snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(26), buf, 3); snd_usb_caiaq_tks4_dispatch() 447 snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(27), buf, 4); snd_usb_caiaq_tks4_dispatch() 449 snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(28), buf, 5); snd_usb_caiaq_tks4_dispatch() 451 snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(29), buf, 6); snd_usb_caiaq_tks4_dispatch() 453 snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(30), buf, 7); snd_usb_caiaq_tks4_dispatch() 459 snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(31), buf, 1); snd_usb_caiaq_tks4_dispatch() 461 snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(32), buf, 2); snd_usb_caiaq_tks4_dispatch() 463 snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(33), buf, 3); snd_usb_caiaq_tks4_dispatch() 465 snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(34), buf, 4); snd_usb_caiaq_tks4_dispatch() 467 snd_caiaq_input_report_abs(cdev, KONTROLS4_ABS(35), buf, 5); snd_usb_caiaq_tks4_dispatch() 478 buf += TKS4_MSGBLOCK_SIZE; snd_usb_caiaq_tks4_dispatch() 487 const unsigned char *buf, snd_usb_caiaq_maschine_dispatch() 491 __le16 *pressure = (__le16 *) buf; snd_usb_caiaq_maschine_dispatch() 506 unsigned char *buf = urb->transfer_buffer; snd_usb_caiaq_ep4_reply_dispatch() local 518 if (buf[0] & 0x3) snd_usb_caiaq_ep4_reply_dispatch() 519 snd_caiaq_input_read_io(cdev, buf + 1, 7); snd_usb_caiaq_ep4_reply_dispatch() 521 if (buf[0] & 0x4) snd_usb_caiaq_ep4_reply_dispatch() 522 snd_caiaq_input_read_analog(cdev, buf + 8, 16); snd_usb_caiaq_ep4_reply_dispatch() 527 snd_usb_caiaq_tks4_dispatch(cdev, buf, urb->actual_length); snd_usb_caiaq_ep4_reply_dispatch() 534 snd_usb_caiaq_maschine_dispatch(cdev, buf, urb->actual_length); snd_usb_caiaq_ep4_reply_dispatch() 581 char *buf, snd_usb_caiaq_input_dispatch() 587 switch (buf[0]) { snd_usb_caiaq_input_dispatch() 589 snd_caiaq_input_read_analog(cdev, buf + 1, len - 1); snd_usb_caiaq_input_dispatch() 592 snd_caiaq_input_read_erp(cdev, buf + 1, len - 1); snd_usb_caiaq_input_dispatch() 595 snd_caiaq_input_read_io(cdev, buf + 1, len - 1); snd_usb_caiaq_input_dispatch() 203 snd_caiaq_input_report_abs(struct snd_usb_caiaqdev *cdev, int axis, const unsigned char *buf, int offset) snd_caiaq_input_report_abs() argument 211 snd_caiaq_input_read_analog(struct snd_usb_caiaqdev *cdev, const unsigned char *buf, unsigned int len) snd_caiaq_input_read_analog() argument 245 snd_caiaq_input_read_erp(struct snd_usb_caiaqdev *cdev, const char *buf, unsigned int len) snd_caiaq_input_read_erp() argument 303 snd_caiaq_input_read_io(struct snd_usb_caiaqdev *cdev, unsigned char *buf, unsigned int len) snd_caiaq_input_read_io() argument 340 snd_usb_caiaq_tks4_dispatch(struct snd_usb_caiaqdev *cdev, const unsigned char *buf, unsigned int len) snd_usb_caiaq_tks4_dispatch() argument 486 snd_usb_caiaq_maschine_dispatch(struct snd_usb_caiaqdev *cdev, const unsigned char *buf, unsigned int len) snd_usb_caiaq_maschine_dispatch() argument 580 snd_usb_caiaq_input_dispatch(struct snd_usb_caiaqdev *cdev, char *buf, unsigned int len) snd_usb_caiaq_input_dispatch() argument
|
H A D | input.h | 4 void snd_usb_caiaq_input_dispatch(struct snd_usb_caiaqdev *cdev, char *buf, unsigned int len);
|
H A D | midi.h | 6 int port, const char *buf, int len);
|
/linux-4.4.14/drivers/media/usb/pvrusb2/ |
H A D | pvrusb2-debugifc.c | 32 static unsigned int debugifc_count_whitespace(const char *buf, debugifc_count_whitespace() argument 39 ch = buf[scnt]; debugifc_count_whitespace() 49 static unsigned int debugifc_count_nonwhitespace(const char *buf, debugifc_count_nonwhitespace() argument 56 ch = buf[scnt]; debugifc_count_nonwhitespace() 65 static unsigned int debugifc_isolate_word(const char *buf,unsigned int count, debugifc_isolate_word() argument 76 scnt = debugifc_count_whitespace(buf,count); debugifc_isolate_word() 77 consume_cnt += scnt; count -= scnt; buf += scnt; debugifc_isolate_word() 80 scnt = debugifc_count_nonwhitespace(buf,count); debugifc_isolate_word() 82 wptr = buf; debugifc_isolate_word() 84 consume_cnt += scnt; count -= scnt; buf += scnt; debugifc_isolate_word() 93 static int debugifc_parse_unsigned_number(const char *buf,unsigned int count, debugifc_parse_unsigned_number() argument 98 if ((count >= 2) && (buf[0] == '0') && debugifc_parse_unsigned_number() 99 ((buf[1] == 'x') || (buf[1] == 'X'))) { debugifc_parse_unsigned_number() 102 buf += 2; debugifc_parse_unsigned_number() 103 } else if ((count >= 1) && (buf[0] == '0')) { debugifc_parse_unsigned_number() 108 int val = hex_to_bin(*buf++); debugifc_parse_unsigned_number() 119 static int debugifc_match_keyword(const char *buf,unsigned int count, debugifc_match_keyword() argument 126 return !memcmp(buf,keyword,kl); debugifc_match_keyword() 130 int pvr2_debugifc_print_info(struct pvr2_hdw *hdw,char *buf,unsigned int acnt) pvr2_debugifc_print_info() argument 134 ccnt = scnprintf(buf, acnt, "Driver hardware description: %s\n", pvr2_debugifc_print_info() 136 bcnt += ccnt; acnt -= ccnt; buf += ccnt; pvr2_debugifc_print_info() 137 ccnt = scnprintf(buf,acnt,"Driver state info:\n"); pvr2_debugifc_print_info() 138 bcnt += ccnt; acnt -= ccnt; buf += ccnt; pvr2_debugifc_print_info() 139 ccnt = pvr2_hdw_state_report(hdw,buf,acnt); pvr2_debugifc_print_info() 140 bcnt += ccnt; acnt -= ccnt; buf += ccnt; pvr2_debugifc_print_info() 147 char *buf,unsigned int acnt) pvr2_debugifc_print_status() 157 ccnt = scnprintf(buf,acnt,"USB link speed: %s\n", pvr2_debugifc_print_status() 159 bcnt += ccnt; acnt -= ccnt; buf += ccnt; pvr2_debugifc_print_status() 165 ccnt = scnprintf(buf,acnt,"GPIO state: dir=0x%x in=0x%x out=0x%x\n", pvr2_debugifc_print_status() 167 bcnt += ccnt; acnt -= ccnt; buf += ccnt; pvr2_debugifc_print_status() 169 ccnt = scnprintf(buf,acnt,"Streaming is %s\n", pvr2_debugifc_print_status() 171 bcnt += ccnt; acnt -= ccnt; buf += ccnt; pvr2_debugifc_print_status() 178 buf,acnt, pvr2_debugifc_print_status() 188 bcnt += ccnt; acnt -= ccnt; buf += ccnt; pvr2_debugifc_print_status() 195 static int pvr2_debugifc_do1cmd(struct pvr2_hdw *hdw,const char *buf, pvr2_debugifc_do1cmd() argument 202 scnt = debugifc_isolate_word(buf,count,&wptr,&wlen); pvr2_debugifc_do1cmd() 204 count -= scnt; buf += scnt; pvr2_debugifc_do1cmd() 209 scnt = debugifc_isolate_word(buf,count,&wptr,&wlen); pvr2_debugifc_do1cmd() 211 count -= scnt; buf += scnt; pvr2_debugifc_do1cmd() 236 scnt = debugifc_isolate_word(buf,count,&wptr,&wlen); pvr2_debugifc_do1cmd() 238 count -= scnt; buf += scnt; pvr2_debugifc_do1cmd() 241 scnt = debugifc_isolate_word(buf,count,&wptr,&wlen); pvr2_debugifc_do1cmd() 243 count -= scnt; buf += scnt; pvr2_debugifc_do1cmd() 269 scnt = debugifc_isolate_word(buf,count,&wptr,&wlen); pvr2_debugifc_do1cmd() 271 count -= scnt; buf += scnt; pvr2_debugifc_do1cmd() 278 scnt = debugifc_isolate_word(buf,count,&wptr,&wlen); pvr2_debugifc_do1cmd() 280 count -= scnt; buf += scnt; pvr2_debugifc_do1cmd() 284 scnt = debugifc_isolate_word(buf,count,&wptr,&wlen); pvr2_debugifc_do1cmd() 305 int pvr2_debugifc_docmd(struct pvr2_hdw *hdw,const char *buf, pvr2_debugifc_docmd() argument 313 if (buf[bcnt] == '\n') break; pvr2_debugifc_docmd() 316 ret = pvr2_debugifc_do1cmd(hdw,buf,bcnt); pvr2_debugifc_docmd() 319 buf += bcnt; pvr2_debugifc_docmd() 146 pvr2_debugifc_print_status(struct pvr2_hdw *hdw, char *buf,unsigned int acnt) pvr2_debugifc_print_status() argument
|
/linux-4.4.14/arch/x86/kernel/cpu/ |
H A D | perf_event_intel_bts.c | 60 struct bts_phys buf[0]; member in struct:bts_buffer 73 struct bts_buffer *buf; bts_buffer_setup_aux() local 95 buf = kzalloc_node(offsetof(struct bts_buffer, buf[nbuf]), GFP_KERNEL, node); bts_buffer_setup_aux() 96 if (!buf) bts_buffer_setup_aux() 99 buf->nr_pages = nr_pages; bts_buffer_setup_aux() 100 buf->nr_bufs = nbuf; bts_buffer_setup_aux() 101 buf->snapshot = overwrite; bts_buffer_setup_aux() 102 buf->data_pages = pages; bts_buffer_setup_aux() 103 buf->real_size = size - size % BTS_RECORD_SIZE; bts_buffer_setup_aux() 105 for (pg = 0, nbuf = 0, offset = 0, pad = 0; nbuf < buf->nr_bufs; nbuf++) { bts_buffer_setup_aux() 110 buf->buf[nbuf].page = page; bts_buffer_setup_aux() 111 buf->buf[nbuf].offset = offset; bts_buffer_setup_aux() 112 buf->buf[nbuf].displacement = (pad ? BTS_RECORD_SIZE - pad : 0); bts_buffer_setup_aux() 113 buf->buf[nbuf].size = buf_size(page) - buf->buf[nbuf].displacement; bts_buffer_setup_aux() 114 pad = buf->buf[nbuf].size % BTS_RECORD_SIZE; bts_buffer_setup_aux() 115 buf->buf[nbuf].size -= pad; bts_buffer_setup_aux() 121 return buf; bts_buffer_setup_aux() 129 static unsigned long bts_buffer_offset(struct bts_buffer *buf, unsigned int idx) bts_buffer_offset() argument 131 return buf->buf[idx].offset + buf->buf[idx].displacement; bts_buffer_offset() 135 bts_config_buffer(struct bts_buffer *buf) bts_config_buffer() argument 139 struct bts_phys *phys = &buf->buf[buf->cur_buf]; bts_config_buffer() 143 index = local_read(&buf->head); bts_config_buffer() 145 if (!buf->snapshot) { bts_config_buffer() 146 if (buf->end < phys->offset + buf_size(page)) bts_config_buffer() 147 end = buf->end - phys->offset - phys->displacement; bts_config_buffer() 162 ds->bts_interrupt_threshold = !buf->snapshot bts_config_buffer() 174 static bool bts_buffer_is_full(struct bts_buffer *buf, struct bts_ctx *bts) bts_buffer_is_full() argument 176 if (buf->snapshot) bts_buffer_is_full() 179 if (local_read(&buf->data_size) >= bts->handle.size || bts_buffer_is_full() 180 bts->handle.size - local_read(&buf->data_size) < BTS_RECORD_SIZE) bts_buffer_is_full() 190 struct bts_buffer *buf = perf_get_aux(&bts->handle); bts_update() local 193 if (!buf) bts_update() 196 head = index + bts_buffer_offset(buf, buf->cur_buf); bts_update() 197 old = local_xchg(&buf->head, head); bts_update() 199 if (!buf->snapshot) { bts_update() 204 local_inc(&buf->lost); bts_update() 210 local_add(head - old, &buf->data_size); bts_update() 212 local_set(&buf->data_size, head); bts_update() 219 struct bts_buffer *buf = perf_get_aux(&bts->handle); __bts_event_start() local 222 if (!buf || bts_buffer_is_full(buf, bts)) __bts_event_start() 228 if (!buf->snapshot) __bts_event_start() 235 bts_config_buffer(buf); __bts_event_start() 300 bts_buffer_reset(struct bts_buffer *buf, struct perf_output_handle *handle) bts_buffer_reset() argument 307 if (buf->snapshot) bts_buffer_reset() 310 head = handle->head & ((buf->nr_pages << PAGE_SHIFT) - 1); bts_buffer_reset() 311 if (WARN_ON_ONCE(head != local_read(&buf->head))) bts_buffer_reset() 314 phys = &buf->buf[buf->cur_buf]; bts_buffer_reset() 323 next_buf = buf->cur_buf + 1; bts_buffer_reset() 324 if (next_buf >= buf->nr_bufs) bts_buffer_reset() 326 next_phys = &buf->buf[next_buf]; bts_buffer_reset() 351 buf->cur_buf = next_buf; bts_buffer_reset() 352 local_set(&buf->head, head); bts_buffer_reset() 365 buf->end = head + space; bts_buffer_reset() 381 struct bts_buffer *buf; intel_bts_interrupt() local 388 buf = perf_get_aux(&bts->handle); intel_bts_interrupt() 394 if (!buf || buf->snapshot) intel_bts_interrupt() 397 old_head = local_read(&buf->head); intel_bts_interrupt() 401 if (old_head == local_read(&buf->head)) intel_bts_interrupt() 404 perf_aux_output_end(&bts->handle, local_xchg(&buf->data_size, 0), intel_bts_interrupt() 405 !!local_xchg(&buf->lost, 0)); intel_bts_interrupt() 407 buf = perf_aux_output_begin(&bts->handle, event); intel_bts_interrupt() 408 if (!buf) intel_bts_interrupt() 411 err = bts_buffer_reset(buf, &bts->handle); intel_bts_interrupt() 422 struct bts_buffer *buf = perf_get_aux(&bts->handle); bts_event_del() local 426 if (buf) { bts_event_del() 427 if (buf->snapshot) bts_event_del() 429 local_xchg(&buf->data_size, bts_event_del() 430 buf->nr_pages << PAGE_SHIFT); bts_event_del() 431 perf_aux_output_end(&bts->handle, local_xchg(&buf->data_size, 0), bts_event_del() 432 !!local_xchg(&buf->lost, 0)); bts_event_del() 443 struct bts_buffer *buf; bts_event_add() local 457 buf = perf_aux_output_begin(&bts->handle, event); bts_event_add() 458 if (!buf) bts_event_add() 461 ret = bts_buffer_reset(buf, &bts->handle); bts_event_add()
|
H A D | perf_event_intel_pt.c | 90 char *buf) pt_cap_show() 96 return snprintf(buf, PAGE_SIZE, "%x\n", pt_cap_get(cap)); pt_cap_show() 297 static void pt_config_buffer(void *buf, unsigned int topa_idx, pt_config_buffer() argument 302 wrmsrl(MSR_IA32_RTIT_OUTPUT_BASE, virt_to_phys(buf)); pt_config_buffer() 381 * @buf: PT buffer that's being extended. 388 static void topa_insert_table(struct pt_buffer *buf, struct topa *topa) topa_insert_table() argument 390 struct topa *last = buf->last; topa_insert_table() 392 list_add_tail(&topa->list, &buf->tables); topa_insert_table() 394 if (!buf->first) { topa_insert_table() 395 buf->first = buf->last = buf->cur = topa; topa_insert_table() 400 buf->last = topa; topa_insert_table() 426 * @buf: PT buffer being initialized. 434 static int topa_insert_pages(struct pt_buffer *buf, gfp_t gfp) topa_insert_pages() argument 436 struct topa *topa = buf->last; topa_insert_pages() 440 p = virt_to_page(buf->data_pages[buf->nr_pages]); topa_insert_pages() 445 topa = topa_alloc(buf->cpu, gfp); topa_insert_pages() 449 topa_insert_table(buf, topa); topa_insert_pages() 454 if (!buf->snapshot && !pt_cap_get(PT_CAP_topa_multiple_entries)) { topa_insert_pages() 462 buf->nr_pages += 1ul << order; topa_insert_pages() 469 * @buf: PT buffer. 471 static void pt_topa_dump(struct pt_buffer *buf) pt_topa_dump() argument 475 list_for_each_entry(topa, &buf->tables, list) { pt_topa_dump() 499 * @buf: PT buffer. 503 static void pt_buffer_advance(struct pt_buffer *buf) pt_buffer_advance() argument 505 buf->output_off = 0; pt_buffer_advance() 506 buf->cur_idx++; pt_buffer_advance() 508 if (buf->cur_idx == buf->cur->last) { pt_buffer_advance() 509 if (buf->cur == buf->last) pt_buffer_advance() 510 buf->cur = buf->first; pt_buffer_advance() 512 buf->cur = list_entry(buf->cur->list.next, struct topa, pt_buffer_advance() 514 buf->cur_idx = 0; pt_buffer_advance() 526 struct pt_buffer *buf = perf_get_aux(&pt->handle); pt_update_head() local 529 /* offset of the first region in this table from the beginning of buf */ pt_update_head() 530 base = buf->cur->offset + buf->output_off; pt_update_head() 533 for (topa_idx = 0; topa_idx < buf->cur_idx; topa_idx++) pt_update_head() 534 base += sizes(buf->cur->table[topa_idx].size); pt_update_head() 536 if (buf->snapshot) { pt_update_head() 537 local_set(&buf->data_size, base); pt_update_head() 539 old = (local64_xchg(&buf->head, base) & pt_update_head() 540 ((buf->nr_pages << PAGE_SHIFT) - 1)); pt_update_head() 542 base += buf->nr_pages << PAGE_SHIFT; pt_update_head() 544 local_add(base - old, &buf->data_size); pt_update_head() 550 * @buf: PT buffer. 552 static void *pt_buffer_region(struct pt_buffer *buf) pt_buffer_region() argument 554 return phys_to_virt(buf->cur->table[buf->cur_idx].base << TOPA_SHIFT); pt_buffer_region() 559 * @buf: PT buffer. 561 static size_t pt_buffer_region_size(struct pt_buffer *buf) pt_buffer_region_size() argument 563 return sizes(buf->cur->table[buf->cur_idx].size); pt_buffer_region_size() 572 struct pt_buffer *buf = perf_get_aux(&pt->handle); pt_handle_status() local 580 pt_topa_dump(buf); pt_handle_status() 593 buf->output_off == sizes(TOPA_ENTRY(buf->cur, buf->cur_idx)->size)) { pt_handle_status() 594 local_inc(&buf->lost); pt_handle_status() 603 if (!pt_cap_get(PT_CAP_topa_multiple_entries) && !buf->snapshot && pt_handle_status() 604 pt_buffer_region_size(buf) - buf->output_off <= TOPA_PMI_MARGIN) { pt_handle_status() 605 void *head = pt_buffer_region(buf); pt_handle_status() 608 memset(head + buf->output_off, 0, pt_handle_status() 609 pt_buffer_region_size(buf) - pt_handle_status() 610 buf->output_off); pt_handle_status() 615 pt_buffer_advance(buf); pt_handle_status() 622 * @buf: PT buffer. 626 static void pt_read_offset(struct pt_buffer *buf) pt_read_offset() argument 631 buf->cur = phys_to_virt(base_topa); pt_read_offset() 635 buf->output_off = offset >> 32; pt_read_offset() 637 buf->cur_idx = (offset & 0xffffff80) >> 7; pt_read_offset() 642 * @buf: PT buffer. 649 static unsigned int pt_topa_next_entry(struct pt_buffer *buf, unsigned int pg) pt_topa_next_entry() argument 651 struct topa_entry *te = buf->topa_index[pg]; pt_topa_next_entry() 654 if (buf->first == buf->last && buf->first->last == 1) pt_topa_next_entry() 659 pg &= buf->nr_pages - 1; pt_topa_next_entry() 660 } while (buf->topa_index[pg] == te); pt_topa_next_entry() 667 * @buf: PT buffer. 674 * This obviously relies on buf::head to figure out buffer markers, so it has 678 static int pt_buffer_reset_markers(struct pt_buffer *buf, pt_buffer_reset_markers() argument 682 unsigned long head = local64_read(&buf->head); pt_buffer_reset_markers() 686 if (buf->output_off + handle->size + 1 < pt_buffer_reset_markers() 687 sizes(TOPA_ENTRY(buf->cur, buf->cur_idx)->size)) pt_buffer_reset_markers() 696 buf->topa_index[buf->stop_pos]->stop = 0; pt_buffer_reset_markers() 697 buf->topa_index[buf->stop_pos]->intr = 0; pt_buffer_reset_markers() 698 buf->topa_index[buf->intr_pos]->intr = 0; pt_buffer_reset_markers() 708 idx &= buf->nr_pages - 1; pt_buffer_reset_markers() 709 buf->stop_pos = idx; pt_buffer_reset_markers() 718 idx &= buf->nr_pages - 1; pt_buffer_reset_markers() 719 buf->intr_pos = idx; pt_buffer_reset_markers() 721 buf->topa_index[buf->stop_pos]->stop = 1; pt_buffer_reset_markers() 722 buf->topa_index[buf->stop_pos]->intr = 1; pt_buffer_reset_markers() 723 buf->topa_index[buf->intr_pos]->intr = 1; pt_buffer_reset_markers() 730 * @buf: PT buffer. 735 static void pt_buffer_setup_topa_index(struct pt_buffer *buf) pt_buffer_setup_topa_index() argument 737 struct topa *cur = buf->first, *prev = buf->last; pt_buffer_setup_topa_index() 742 while (pg < buf->nr_pages) { pt_buffer_setup_topa_index() 747 buf->topa_index[pg] = te_prev; pt_buffer_setup_topa_index() 765 * @buf: PT buffer. 773 * This function modifies buf::{cur,cur_idx,output_off} that will be programmed 774 * into PT msrs when the tracing is enabled and buf::head and buf::data_size, 778 static void pt_buffer_reset_offsets(struct pt_buffer *buf, unsigned long head) pt_buffer_reset_offsets() argument 782 if (buf->snapshot) pt_buffer_reset_offsets() 783 head &= (buf->nr_pages << PAGE_SHIFT) - 1; pt_buffer_reset_offsets() 785 pg = (head >> PAGE_SHIFT) & (buf->nr_pages - 1); pt_buffer_reset_offsets() 786 pg = pt_topa_next_entry(buf, pg); pt_buffer_reset_offsets() 788 buf->cur = (struct topa *)((unsigned long)buf->topa_index[pg] & PAGE_MASK); pt_buffer_reset_offsets() 789 buf->cur_idx = ((unsigned long)buf->topa_index[pg] - pt_buffer_reset_offsets() 790 (unsigned long)buf->cur) / sizeof(struct topa_entry); pt_buffer_reset_offsets() 791 buf->output_off = head & (sizes(buf->cur->table[buf->cur_idx].size) - 1); pt_buffer_reset_offsets() 793 local64_set(&buf->head, head); pt_buffer_reset_offsets() 794 local_set(&buf->data_size, 0); pt_buffer_reset_offsets() 799 * @buf: PT buffer. 801 static void pt_buffer_fini_topa(struct pt_buffer *buf) pt_buffer_fini_topa() argument 805 list_for_each_entry_safe(topa, iter, &buf->tables, list) { pt_buffer_fini_topa() 816 * @buf: PT buffer. 820 static int pt_buffer_init_topa(struct pt_buffer *buf, unsigned long nr_pages, pt_buffer_init_topa() argument 826 topa = topa_alloc(buf->cpu, gfp); pt_buffer_init_topa() 830 topa_insert_table(buf, topa); pt_buffer_init_topa() 832 while (buf->nr_pages < nr_pages) { pt_buffer_init_topa() 833 err = topa_insert_pages(buf, gfp); pt_buffer_init_topa() 835 pt_buffer_fini_topa(buf); pt_buffer_init_topa() 840 pt_buffer_setup_topa_index(buf); pt_buffer_init_topa() 844 TOPA_ENTRY(buf->last, -1)->base = buf->first->phys >> TOPA_SHIFT; pt_buffer_init_topa() 845 TOPA_ENTRY(buf->last, -1)->end = 1; pt_buffer_init_topa() 848 pt_topa_dump(buf); pt_buffer_init_topa() 867 struct pt_buffer *buf; pt_buffer_setup_aux() local 877 buf = kzalloc_node(offsetof(struct pt_buffer, topa_index[nr_pages]), pt_buffer_setup_aux() 879 if (!buf) pt_buffer_setup_aux() 882 buf->cpu = cpu; pt_buffer_setup_aux() 883 buf->snapshot = snapshot; pt_buffer_setup_aux() 884 buf->data_pages = pages; pt_buffer_setup_aux() 886 INIT_LIST_HEAD(&buf->tables); pt_buffer_setup_aux() 888 ret = pt_buffer_init_topa(buf, nr_pages, GFP_KERNEL); pt_buffer_setup_aux() 890 kfree(buf); pt_buffer_setup_aux() 894 return buf; pt_buffer_setup_aux() 903 struct pt_buffer *buf = data; pt_buffer_free_aux() local 905 pt_buffer_fini_topa(buf); pt_buffer_free_aux() 906 kfree(buf); pt_buffer_free_aux() 911 * @buf: PT buffer. 918 static bool pt_buffer_is_full(struct pt_buffer *buf, struct pt *pt) pt_buffer_is_full() argument 920 if (buf->snapshot) pt_buffer_is_full() 923 if (local_read(&buf->data_size) >= pt->handle.size) pt_buffer_is_full() 935 struct pt_buffer *buf; intel_pt_interrupt() local 951 buf = perf_get_aux(&pt->handle); intel_pt_interrupt() 952 if (!buf) intel_pt_interrupt() 955 pt_read_offset(buf); intel_pt_interrupt() 961 perf_aux_output_end(&pt->handle, local_xchg(&buf->data_size, 0), intel_pt_interrupt() 962 local_xchg(&buf->lost, 0)); intel_pt_interrupt() 967 buf = perf_aux_output_begin(&pt->handle, event); intel_pt_interrupt() 968 if (!buf) { intel_pt_interrupt() 973 pt_buffer_reset_offsets(buf, pt->handle.head); intel_pt_interrupt() 975 ret = pt_buffer_reset_markers(buf, &pt->handle); intel_pt_interrupt() 981 pt_config_buffer(buf->cur->table, buf->cur_idx, intel_pt_interrupt() 982 buf->output_off); intel_pt_interrupt() 994 struct pt_buffer *buf = perf_get_aux(&pt->handle); pt_event_start() local 996 if (!buf || pt_buffer_is_full(buf, pt)) { pt_event_start() 1004 pt_config_buffer(buf->cur->table, buf->cur_idx, pt_event_start() 1005 buf->output_off); pt_event_start() 1026 struct pt_buffer *buf = perf_get_aux(&pt->handle); pt_event_stop() local 1028 if (!buf) pt_event_stop() 1034 pt_read_offset(buf); pt_event_stop() 1045 struct pt_buffer *buf; pt_event_del() local 1049 buf = perf_get_aux(&pt->handle); pt_event_del() 1051 if (buf) { pt_event_del() 1052 if (buf->snapshot) pt_event_del() 1054 local_xchg(&buf->data_size, pt_event_del() 1055 buf->nr_pages << PAGE_SHIFT); pt_event_del() 1056 perf_aux_output_end(&pt->handle, local_xchg(&buf->data_size, 0), pt_event_del() 1057 local_xchg(&buf->lost, 0)); pt_event_del() 1063 struct pt_buffer *buf; pt_event_add() local 1071 buf = perf_aux_output_begin(&pt->handle, event); pt_event_add() 1073 if (!buf) pt_event_add() 1076 pt_buffer_reset_offsets(buf, pt->handle.head); pt_event_add() 1077 if (!buf->snapshot) { pt_event_add() 1078 ret = pt_buffer_reset_markers(buf, &pt->handle); pt_event_add() 88 pt_cap_show(struct device *cdev, struct device_attribute *attr, char *buf) pt_cap_show() argument
|
/linux-4.4.14/sound/soc/codecs/ |
H A D | sigmadsp-i2c.c | 20 uint8_t *buf; sigmadsp_write_i2c() local 23 buf = kzalloc(2 + len, GFP_KERNEL | GFP_DMA); sigmadsp_write_i2c() 24 if (!buf) sigmadsp_write_i2c() 27 put_unaligned_be16(addr, buf); sigmadsp_write_i2c() 28 memcpy(buf + 2, data, len); sigmadsp_write_i2c() 30 ret = i2c_master_send(control_data, buf, len + 2); sigmadsp_write_i2c() 32 kfree(buf); sigmadsp_write_i2c() 42 uint8_t buf[2]; sigmadsp_read_i2c() local 45 put_unaligned_be16(addr, buf); sigmadsp_read_i2c() 48 msgs[0].len = sizeof(buf); sigmadsp_read_i2c() 49 msgs[0].buf = buf; sigmadsp_read_i2c() 54 msgs[1].buf = data; sigmadsp_read_i2c()
|
/linux-4.4.14/drivers/net/bonding/ |
H A D | bond_sysfs_slave.c | 31 static ssize_t state_show(struct slave *slave, char *buf) state_show() argument 35 return sprintf(buf, "active\n"); state_show() 37 return sprintf(buf, "backup\n"); state_show() 39 return sprintf(buf, "UNKNOWN\n"); state_show() 44 static ssize_t mii_status_show(struct slave *slave, char *buf) mii_status_show() argument 46 return sprintf(buf, "%s\n", bond_slave_link_status(slave->link)); mii_status_show() 50 static ssize_t link_failure_count_show(struct slave *slave, char *buf) link_failure_count_show() argument 52 return sprintf(buf, "%d\n", slave->link_failure_count); link_failure_count_show() 56 static ssize_t perm_hwaddr_show(struct slave *slave, char *buf) perm_hwaddr_show() argument 58 return sprintf(buf, "%pM\n", slave->perm_hwaddr); perm_hwaddr_show() 62 static ssize_t queue_id_show(struct slave *slave, char *buf) queue_id_show() argument 64 return sprintf(buf, "%d\n", slave->queue_id); queue_id_show() 68 static ssize_t ad_aggregator_id_show(struct slave *slave, char *buf) ad_aggregator_id_show() argument 75 return sprintf(buf, "%d\n", ad_aggregator_id_show() 79 return sprintf(buf, "N/A\n"); ad_aggregator_id_show() 83 static ssize_t ad_actor_oper_port_state_show(struct slave *slave, char *buf) ad_actor_oper_port_state_show() argument 90 return sprintf(buf, "%u\n", ad_actor_oper_port_state_show() 94 return sprintf(buf, "N/A\n"); ad_actor_oper_port_state_show() 98 static ssize_t ad_partner_oper_port_state_show(struct slave *slave, char *buf) ad_partner_oper_port_state_show() argument 105 return sprintf(buf, "%u\n", ad_partner_oper_port_state_show() 109 return sprintf(buf, "N/A\n"); ad_partner_oper_port_state_show() 129 struct attribute *attr, char *buf) slave_show() 134 return slave_attr->show(slave, buf); slave_show() 128 slave_show(struct kobject *kobj, struct attribute *attr, char *buf) slave_show() argument
|
/linux-4.4.14/drivers/rtc/ |
H A D | rtc-s35390a.c | 62 static int s35390a_set_reg(struct s35390a *s35390a, int reg, char *buf, int len) s35390a_set_reg() argument 69 .buf = buf s35390a_set_reg() 79 static int s35390a_get_reg(struct s35390a *s35390a, int reg, char *buf, int len) s35390a_get_reg() argument 87 .buf = buf s35390a_get_reg() 99 char buf[1]; s35390a_reset() local 101 if (s35390a_get_reg(s35390a, S35390A_CMD_STATUS1, buf, sizeof(buf)) < 0) s35390a_reset() 104 if (!(buf[0] & (S35390A_FLAG_POC | S35390A_FLAG_BLD))) s35390a_reset() 107 buf[0] |= (S35390A_FLAG_RESET | S35390A_FLAG_24H); s35390a_reset() 108 buf[0] &= 0xf0; s35390a_reset() 109 return s35390a_set_reg(s35390a, S35390A_CMD_STATUS1, buf, sizeof(buf)); s35390a_reset() 114 char buf[1]; s35390a_disable_test_mode() local 116 if (s35390a_get_reg(s35390a, S35390A_CMD_STATUS2, buf, sizeof(buf)) < 0) s35390a_disable_test_mode() 119 if (!(buf[0] & S35390A_FLAG_TEST)) s35390a_disable_test_mode() 122 buf[0] &= ~S35390A_FLAG_TEST; s35390a_disable_test_mode() 123 return s35390a_set_reg(s35390a, S35390A_CMD_STATUS2, buf, sizeof(buf)); s35390a_disable_test_mode() 155 char buf[7]; s35390a_set_datetime() local 162 buf[S35390A_BYTE_YEAR] = bin2bcd(tm->tm_year - 100); s35390a_set_datetime() 163 buf[S35390A_BYTE_MONTH] = bin2bcd(tm->tm_mon + 1); s35390a_set_datetime() 164 buf[S35390A_BYTE_DAY] = bin2bcd(tm->tm_mday); s35390a_set_datetime() 165 buf[S35390A_BYTE_WDAY] = bin2bcd(tm->tm_wday); s35390a_set_datetime() 166 buf[S35390A_BYTE_HOURS] = s35390a_hr2reg(s35390a, tm->tm_hour); s35390a_set_datetime() 167 buf[S35390A_BYTE_MINS] = bin2bcd(tm->tm_min); s35390a_set_datetime() 168 buf[S35390A_BYTE_SECS] = bin2bcd(tm->tm_sec); s35390a_set_datetime() 172 buf[i] = bitrev8(buf[i]); s35390a_set_datetime() 174 err = s35390a_set_reg(s35390a, S35390A_CMD_TIME1, buf, sizeof(buf)); s35390a_set_datetime() 182 char buf[7]; s35390a_get_datetime() local 185 err = s35390a_get_reg(s35390a, S35390A_CMD_TIME1, buf, sizeof(buf)); s35390a_get_datetime() 191 buf[i] = bitrev8(buf[i]); s35390a_get_datetime() 193 tm->tm_sec = bcd2bin(buf[S35390A_BYTE_SECS]); s35390a_get_datetime() 194 tm->tm_min = bcd2bin(buf[S35390A_BYTE_MINS]); s35390a_get_datetime() 195 tm->tm_hour = s35390a_reg2hr(s35390a, buf[S35390A_BYTE_HOURS]); s35390a_get_datetime() 196 tm->tm_wday = bcd2bin(buf[S35390A_BYTE_WDAY]); s35390a_get_datetime() 197 tm->tm_mday = bcd2bin(buf[S35390A_BYTE_DAY]); s35390a_get_datetime() 198 tm->tm_mon = bcd2bin(buf[S35390A_BYTE_MONTH]) - 1; s35390a_get_datetime() 199 tm->tm_year = bcd2bin(buf[S35390A_BYTE_YEAR]) + 100; s35390a_get_datetime() 212 char buf[3], sts = 0; s35390a_set_alarm() local 244 buf[S35390A_ALRM_BYTE_WDAY] = bin2bcd(alm->time.tm_wday) | 0x80; s35390a_set_alarm() 246 buf[S35390A_ALRM_BYTE_HOURS] = s35390a_hr2reg(s35390a, s35390a_set_alarm() 248 buf[S35390A_ALRM_BYTE_MINS] = bin2bcd(alm->time.tm_min) | 0x80; s35390a_set_alarm() 251 buf[S35390A_ALRM_BYTE_HOURS] |= 0x40; s35390a_set_alarm() 254 buf[i] = bitrev8(buf[i]); s35390a_set_alarm() 256 err = s35390a_set_reg(s35390a, S35390A_CMD_INT2_REG1, buf, s35390a_set_alarm() 257 sizeof(buf)); s35390a_set_alarm() 265 char buf[3], sts; s35390a_read_alarm() local 275 err = s35390a_get_reg(s35390a, S35390A_CMD_INT2_REG1, buf, sizeof(buf)); s35390a_read_alarm() 281 buf[i] = bitrev8(buf[i]); s35390a_read_alarm() 282 buf[i] &= ~0x80; s35390a_read_alarm() 285 alm->time.tm_wday = bcd2bin(buf[S35390A_ALRM_BYTE_WDAY]); s35390a_read_alarm() 287 buf[S35390A_ALRM_BYTE_HOURS]); s35390a_read_alarm() 288 alm->time.tm_min = bcd2bin(buf[S35390A_ALRM_BYTE_MINS]); s35390a_read_alarm() 334 char buf[1]; s35390a_probe() local 375 err = s35390a_get_reg(s35390a, S35390A_CMD_STATUS1, buf, sizeof(buf)); s35390a_probe() 380 if (buf[0] & S35390A_FLAG_24H) s35390a_probe()
|
H A D | rtc-em3027.c | 50 unsigned char buf[7]; em3027_get_time() local 56 .buf = &addr em3027_get_time() 62 .buf = buf em3027_get_time() 72 tm->tm_sec = bcd2bin(buf[0]); em3027_get_time() 73 tm->tm_min = bcd2bin(buf[1]); em3027_get_time() 74 tm->tm_hour = bcd2bin(buf[2]); em3027_get_time() 75 tm->tm_mday = bcd2bin(buf[3]); em3027_get_time() 76 tm->tm_wday = bcd2bin(buf[4]); em3027_get_time() 77 tm->tm_mon = bcd2bin(buf[5]); em3027_get_time() 78 tm->tm_year = bcd2bin(buf[6]) + 100; em3027_get_time() 86 unsigned char buf[8]; em3027_set_time() local 91 .buf = buf, /* write time/date */ em3027_set_time() 94 buf[0] = EM3027_REG_WATCH_SEC; em3027_set_time() 95 buf[1] = bin2bcd(tm->tm_sec); em3027_set_time() 96 buf[2] = bin2bcd(tm->tm_min); em3027_set_time() 97 buf[3] = bin2bcd(tm->tm_hour); em3027_set_time() 98 buf[4] = bin2bcd(tm->tm_mday); em3027_set_time() 99 buf[5] = bin2bcd(tm->tm_wday); em3027_set_time() 100 buf[6] = bin2bcd(tm->tm_mon); em3027_set_time() 101 buf[7] = bin2bcd(tm->tm_year % 100); em3027_set_time()
|
H A D | rtc-pcf8563.c | 93 unsigned char length, unsigned char *buf) pcf8563_read_block_data() 99 .buf = ®, pcf8563_read_block_data() 105 .buf = buf pcf8563_read_block_data() 119 unsigned char *buf) pcf8563_write_block_data() 124 unsigned char data[2] = { reg + i, buf[i] }; pcf8563_write_block_data() 140 unsigned char buf; pcf8563_set_alarm_mode() local 143 err = pcf8563_read_block_data(client, PCF8563_REG_ST2, 1, &buf); pcf8563_set_alarm_mode() 148 buf |= PCF8563_BIT_AIE; pcf8563_set_alarm_mode() 150 buf &= ~PCF8563_BIT_AIE; pcf8563_set_alarm_mode() 152 buf &= ~(PCF8563_BIT_AF | PCF8563_BITS_ST2_N); pcf8563_set_alarm_mode() 154 err = pcf8563_write_block_data(client, PCF8563_REG_ST2, 1, &buf); pcf8563_set_alarm_mode() 166 unsigned char buf; pcf8563_get_alarm_mode() local 169 err = pcf8563_read_block_data(client, PCF8563_REG_ST2, 1, &buf); pcf8563_get_alarm_mode() 174 *en = !!(buf & PCF8563_BIT_AIE); pcf8563_get_alarm_mode() 176 *pen = !!(buf & PCF8563_BIT_AF); pcf8563_get_alarm_mode() 207 unsigned char buf[9]; pcf8563_get_datetime() local 210 err = pcf8563_read_block_data(client, PCF8563_REG_ST1, 9, buf); pcf8563_get_datetime() 214 if (buf[PCF8563_REG_SC] & PCF8563_SC_LV) { pcf8563_get_datetime() 225 buf[0], buf[1], buf[2], buf[3], pcf8563_get_datetime() 226 buf[4], buf[5], buf[6], buf[7], pcf8563_get_datetime() 227 buf[8]); pcf8563_get_datetime() 230 tm->tm_sec = bcd2bin(buf[PCF8563_REG_SC] & 0x7F); pcf8563_get_datetime() 231 tm->tm_min = bcd2bin(buf[PCF8563_REG_MN] & 0x7F); pcf8563_get_datetime() 232 tm->tm_hour = bcd2bin(buf[PCF8563_REG_HR] & 0x3F); /* rtc hr 0-23 */ pcf8563_get_datetime() 233 tm->tm_mday = bcd2bin(buf[PCF8563_REG_DM] & 0x3F); pcf8563_get_datetime() 234 tm->tm_wday = buf[PCF8563_REG_DW] & 0x07; pcf8563_get_datetime() 235 tm->tm_mon = bcd2bin(buf[PCF8563_REG_MO] & 0x1F) - 1; /* rtc mn 1-12 */ pcf8563_get_datetime() 236 tm->tm_year = bcd2bin(buf[PCF8563_REG_YR]); pcf8563_get_datetime() 240 pcf8563->c_polarity = (buf[PCF8563_REG_MO] & PCF8563_MO_C) ? pcf8563_get_datetime() 255 unsigned char buf[9]; pcf8563_set_datetime() local 264 buf[PCF8563_REG_SC] = bin2bcd(tm->tm_sec); pcf8563_set_datetime() 265 buf[PCF8563_REG_MN] = bin2bcd(tm->tm_min); pcf8563_set_datetime() 266 buf[PCF8563_REG_HR] = bin2bcd(tm->tm_hour); pcf8563_set_datetime() 268 buf[PCF8563_REG_DM] = bin2bcd(tm->tm_mday); pcf8563_set_datetime() 271 buf[PCF8563_REG_MO] = bin2bcd(tm->tm_mon + 1); pcf8563_set_datetime() 274 buf[PCF8563_REG_YR] = bin2bcd(tm->tm_year % 100); pcf8563_set_datetime() 276 buf[PCF8563_REG_MO] |= PCF8563_MO_C; pcf8563_set_datetime() 278 buf[PCF8563_REG_DW] = tm->tm_wday & 0x07; pcf8563_set_datetime() 281 9 - PCF8563_REG_SC, buf + PCF8563_REG_SC); pcf8563_set_datetime() 335 unsigned char buf[4]; pcf8563_rtc_read_alarm() local 338 err = pcf8563_read_block_data(client, PCF8563_REG_AMN, 4, buf); pcf8563_rtc_read_alarm() 344 __func__, buf[0], buf[1], buf[2], buf[3]); pcf8563_rtc_read_alarm() 346 tm->time.tm_min = bcd2bin(buf[0] & 0x7F); pcf8563_rtc_read_alarm() 347 tm->time.tm_hour = bcd2bin(buf[1] & 0x3F); pcf8563_rtc_read_alarm() 348 tm->time.tm_mday = bcd2bin(buf[2] & 0x3F); pcf8563_rtc_read_alarm() 349 tm->time.tm_wday = bcd2bin(buf[3] & 0x7); pcf8563_rtc_read_alarm() 370 unsigned char buf[4]; pcf8563_rtc_set_alarm() local 386 buf[0] = bin2bcd(tm->time.tm_min); pcf8563_rtc_set_alarm() 387 buf[1] = bin2bcd(tm->time.tm_hour); pcf8563_rtc_set_alarm() 388 buf[2] = bin2bcd(tm->time.tm_mday); pcf8563_rtc_set_alarm() 389 buf[3] = tm->time.tm_wday & 0x07; pcf8563_rtc_set_alarm() 391 err = pcf8563_write_block_data(client, PCF8563_REG_AMN, 4, buf); pcf8563_rtc_set_alarm() 423 unsigned char buf; pcf8563_clkout_recalc_rate() local 424 int ret = pcf8563_read_block_data(client, PCF8563_REG_CLKO, 1, &buf); pcf8563_clkout_recalc_rate() 429 buf &= PCF8563_REG_CLKO_F_MASK; pcf8563_clkout_recalc_rate() 450 unsigned char buf; pcf8563_clkout_set_rate() local 451 int ret = pcf8563_read_block_data(client, PCF8563_REG_CLKO, 1, &buf); pcf8563_clkout_set_rate() 459 buf &= ~PCF8563_REG_CLKO_F_MASK; pcf8563_clkout_set_rate() 460 buf |= i; pcf8563_clkout_set_rate() 463 &buf); pcf8563_clkout_set_rate() 474 unsigned char buf; pcf8563_clkout_control() local 475 int ret = pcf8563_read_block_data(client, PCF8563_REG_CLKO, 1, &buf); pcf8563_clkout_control() 481 buf |= PCF8563_REG_CLKO_FE; pcf8563_clkout_control() 483 buf &= ~PCF8563_REG_CLKO_FE; pcf8563_clkout_control() 485 ret = pcf8563_write_block_data(client, PCF8563_REG_CLKO, 1, &buf); pcf8563_clkout_control() 503 unsigned char buf; pcf8563_clkout_is_prepared() local 504 int ret = pcf8563_read_block_data(client, PCF8563_REG_CLKO, 1, &buf); pcf8563_clkout_is_prepared() 509 return !!(buf & PCF8563_REG_CLKO_FE); pcf8563_clkout_is_prepared() 528 unsigned char buf; pcf8563_clkout_register_clk() local 531 buf = 0; pcf8563_clkout_register_clk() 532 ret = pcf8563_write_block_data(client, PCF8563_REG_CLKO, 1, &buf); pcf8563_clkout_register_clk() 570 unsigned char buf; pcf8563_probe() local 590 buf = PCF8563_TMRC_1_60; pcf8563_probe() 591 err = pcf8563_write_block_data(client, PCF8563_REG_TMRC, 1, &buf); pcf8563_probe() 92 pcf8563_read_block_data(struct i2c_client *client, unsigned char reg, unsigned char length, unsigned char *buf) pcf8563_read_block_data() argument 117 pcf8563_write_block_data(struct i2c_client *client, unsigned char reg, unsigned char length, unsigned char *buf) pcf8563_write_block_data() argument
|
H A D | rtc-88pm80x.c | 116 unsigned char buf[4]; pm80x_rtc_read_time() local 118 regmap_raw_read(info->map, PM800_RTC_EXPIRE2_1, buf, 4); pm80x_rtc_read_time() 119 base = (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0]; pm80x_rtc_read_time() 120 dev_dbg(info->dev, "%x-%x-%x-%x\n", buf[0], buf[1], buf[2], buf[3]); pm80x_rtc_read_time() 123 regmap_raw_read(info->map, PM800_RTC_COUNTER1, buf, 4); pm80x_rtc_read_time() 124 data = (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0]; pm80x_rtc_read_time() 135 unsigned char buf[4]; pm80x_rtc_set_time() local 146 regmap_raw_read(info->map, PM800_RTC_COUNTER1, buf, 4); pm80x_rtc_set_time() 147 data = (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0]; pm80x_rtc_set_time() 151 buf[0] = base & 0xFF; pm80x_rtc_set_time() 152 buf[1] = (base >> 8) & 0xFF; pm80x_rtc_set_time() 153 buf[2] = (base >> 16) & 0xFF; pm80x_rtc_set_time() 154 buf[3] = (base >> 24) & 0xFF; pm80x_rtc_set_time() 155 regmap_raw_write(info->map, PM800_RTC_EXPIRE2_1, buf, 4); pm80x_rtc_set_time() 163 unsigned char buf[4]; pm80x_rtc_read_alarm() local 167 regmap_raw_read(info->map, PM800_RTC_EXPIRE2_1, buf, 4); pm80x_rtc_read_alarm() 168 base = (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0]; pm80x_rtc_read_alarm() 169 dev_dbg(info->dev, "%x-%x-%x-%x\n", buf[0], buf[1], buf[2], buf[3]); pm80x_rtc_read_alarm() 171 regmap_raw_read(info->map, PM800_RTC_EXPIRE1_1, buf, 4); pm80x_rtc_read_alarm() 172 data = (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0]; pm80x_rtc_read_alarm() 189 unsigned char buf[4]; pm80x_rtc_set_alarm() local 194 regmap_raw_read(info->map, PM800_RTC_EXPIRE2_1, buf, 4); pm80x_rtc_set_alarm() 195 base = (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0]; pm80x_rtc_set_alarm() 196 dev_dbg(info->dev, "%x-%x-%x-%x\n", buf[0], buf[1], buf[2], buf[3]); pm80x_rtc_set_alarm() 199 regmap_raw_read(info->map, PM800_RTC_COUNTER1, buf, 4); pm80x_rtc_set_alarm() 200 data = (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0]; pm80x_rtc_set_alarm() 213 buf[0] = data & 0xff; pm80x_rtc_set_alarm() 214 buf[1] = (data >> 8) & 0xff; pm80x_rtc_set_alarm() 215 buf[2] = (data >> 16) & 0xff; pm80x_rtc_set_alarm() 216 buf[3] = (data >> 24) & 0xff; pm80x_rtc_set_alarm() 217 regmap_raw_write(info->map, PM800_RTC_EXPIRE1_1, buf, 4); pm80x_rtc_set_alarm()
|
H A D | rtc-m41t94.c | 35 u8 buf[8]; /* write cmd + 7 registers */ m41t94_set_time() local 43 buf[0] = 0x80 | M41T94_REG_SECONDS; /* write time + date */ m41t94_set_time() 44 buf[M41T94_REG_SECONDS] = bin2bcd(tm->tm_sec); m41t94_set_time() 45 buf[M41T94_REG_MINUTES] = bin2bcd(tm->tm_min); m41t94_set_time() 46 buf[M41T94_REG_HOURS] = bin2bcd(tm->tm_hour); m41t94_set_time() 47 buf[M41T94_REG_WDAY] = bin2bcd(tm->tm_wday + 1); m41t94_set_time() 48 buf[M41T94_REG_DAY] = bin2bcd(tm->tm_mday); m41t94_set_time() 49 buf[M41T94_REG_MONTH] = bin2bcd(tm->tm_mon + 1); m41t94_set_time() 51 buf[M41T94_REG_HOURS] |= M41T94_BIT_CEB; m41t94_set_time() 53 buf[M41T94_REG_HOURS] |= M41T94_BIT_CB; m41t94_set_time() 54 buf[M41T94_REG_YEAR] = bin2bcd(tm->tm_year % 100); m41t94_set_time() 56 return spi_write(spi, buf, 8); m41t94_set_time() 62 u8 buf[2]; m41t94_read_time() local 70 buf[0] = 0x80 | M41T94_REG_HT; m41t94_read_time() 71 buf[1] = ret & ~M41T94_BIT_HALT; m41t94_read_time() 72 spi_write(spi, buf, 2); m41t94_read_time() 80 buf[0] = 0x80 | M41T94_REG_SECONDS; m41t94_read_time() 81 buf[1] = ret & ~M41T94_BIT_STOP; m41t94_read_time() 82 spi_write(spi, buf, 2); m41t94_read_time()
|
H A D | rtc-max8925.c | 85 static int tm_calc(struct rtc_time *tm, unsigned char *buf, int len) tm_calc() argument 89 tm->tm_year = (buf[RTC_YEAR2] >> 4) * 1000 tm_calc() 90 + (buf[RTC_YEAR2] & 0xf) * 100 tm_calc() 91 + (buf[RTC_YEAR1] >> 4) * 10 tm_calc() 92 + (buf[RTC_YEAR1] & 0xf); tm_calc() 94 tm->tm_mon = ((buf[RTC_MONTH] >> 4) & 0x01) * 10 tm_calc() 95 + (buf[RTC_MONTH] & 0x0f); tm_calc() 96 tm->tm_mday = ((buf[RTC_DATE] >> 4) & 0x03) * 10 tm_calc() 97 + (buf[RTC_DATE] & 0x0f); tm_calc() 98 tm->tm_wday = buf[RTC_WEEKDAY] & 0x07; tm_calc() 99 if (buf[RTC_HOUR] & HOUR_12) { tm_calc() 100 tm->tm_hour = ((buf[RTC_HOUR] >> 4) & 0x1) * 10 tm_calc() 101 + (buf[RTC_HOUR] & 0x0f); tm_calc() 102 if (buf[RTC_HOUR] & HOUR_AM_PM) tm_calc() 105 tm->tm_hour = ((buf[RTC_HOUR] >> 4) & 0x03) * 10 tm_calc() 106 + (buf[RTC_HOUR] & 0x0f); tm_calc() 107 tm->tm_min = ((buf[RTC_MIN] >> 4) & 0x7) * 10 tm_calc() 108 + (buf[RTC_MIN] & 0x0f); tm_calc() 109 tm->tm_sec = ((buf[RTC_SEC] >> 4) & 0x7) * 10 tm_calc() 110 + (buf[RTC_SEC] & 0x0f); tm_calc() 114 static int data_calc(unsigned char *buf, struct rtc_time *tm, int len) data_calc() argument 124 buf[RTC_YEAR2] = (high << 4) + low; data_calc() 129 buf[RTC_YEAR1] = (high << 4) + low; data_calc() 133 buf[RTC_MONTH] = (high << 4) + low; data_calc() 137 buf[RTC_DATE] = (high << 4) + low; data_calc() 138 buf[RTC_WEEKDAY] = tm->tm_wday; data_calc() 142 buf[RTC_HOUR] = (high << 4) + low; data_calc() 146 buf[RTC_MIN] = (high << 4) + low; data_calc() 150 buf[RTC_SEC] = (high << 4) + low; data_calc() 157 unsigned char buf[TIME_NUM]; max8925_rtc_read_time() local 160 ret = max8925_bulk_read(info->rtc, MAX8925_RTC_SEC, TIME_NUM, buf); max8925_rtc_read_time() 163 ret = tm_calc(tm, buf, TIME_NUM); max8925_rtc_read_time() 171 unsigned char buf[TIME_NUM]; max8925_rtc_set_time() local 174 ret = data_calc(buf, tm, TIME_NUM); max8925_rtc_set_time() 177 ret = max8925_bulk_write(info->rtc, MAX8925_RTC_SEC, TIME_NUM, buf); max8925_rtc_set_time() 185 unsigned char buf[TIME_NUM]; max8925_rtc_read_alarm() local 188 ret = max8925_bulk_read(info->rtc, MAX8925_ALARM0_SEC, TIME_NUM, buf); max8925_rtc_read_alarm() 191 ret = tm_calc(&alrm->time, buf, TIME_NUM); max8925_rtc_read_alarm() 223 unsigned char buf[TIME_NUM]; max8925_rtc_set_alarm() local 226 ret = data_calc(buf, &alrm->time, TIME_NUM); max8925_rtc_set_alarm() 229 ret = max8925_bulk_write(info->rtc, MAX8925_ALARM0_SEC, TIME_NUM, buf); max8925_rtc_set_alarm()
|
H A D | rtc-ds1347.c | 49 unsigned char buf[2]; ds1347_write_reg() local 51 buf[0] = address & 0x7F; ds1347_write_reg() 52 buf[1] = data; ds1347_write_reg() 54 return spi_write_then_read(spi, buf, 2, NULL, 0); ds1347_write_reg() 61 unsigned char buf[8]; ds1347_read_time() local 63 buf[0] = DS1347_CLOCK_BURST | 0x80; ds1347_read_time() 65 err = spi_write_then_read(spi, buf, 1, buf, 8); ds1347_read_time() 69 dt->tm_sec = bcd2bin(buf[0]); ds1347_read_time() 70 dt->tm_min = bcd2bin(buf[1]); ds1347_read_time() 71 dt->tm_hour = bcd2bin(buf[2] & 0x3F); ds1347_read_time() 72 dt->tm_mday = bcd2bin(buf[3]); ds1347_read_time() 73 dt->tm_mon = bcd2bin(buf[4]) - 1; ds1347_read_time() 74 dt->tm_wday = bcd2bin(buf[5]) - 1; ds1347_read_time() 75 dt->tm_year = bcd2bin(buf[6]) + 100; ds1347_read_time() 83 unsigned char buf[9]; ds1347_set_time() local 85 buf[0] = DS1347_CLOCK_BURST & 0x7F; ds1347_set_time() 86 buf[1] = bin2bcd(dt->tm_sec); ds1347_set_time() 87 buf[2] = bin2bcd(dt->tm_min); ds1347_set_time() 88 buf[3] = (bin2bcd(dt->tm_hour) & 0x3F); ds1347_set_time() 89 buf[4] = bin2bcd(dt->tm_mday); ds1347_set_time() 90 buf[5] = bin2bcd(dt->tm_mon + 1); ds1347_set_time() 91 buf[6] = bin2bcd(dt->tm_wday + 1); ds1347_set_time() 97 buf[7] = bin2bcd(dt->tm_year); ds1347_set_time() 98 buf[8] = bin2bcd(0x00); ds1347_set_time() 101 return spi_write_then_read(spi, buf, 9, NULL, 0); ds1347_set_time()
|
H A D | rtc-88pm860x.c | 112 unsigned char buf[8]; pm860x_rtc_read_time() local 115 pm860x_page_bulk_read(info->i2c, REG0_ADDR, 8, buf); pm860x_rtc_read_time() 116 dev_dbg(info->dev, "%x-%x-%x-%x-%x-%x-%x-%x\n", buf[0], buf[1], pm860x_rtc_read_time() 117 buf[2], buf[3], buf[4], buf[5], buf[6], buf[7]); pm860x_rtc_read_time() 118 base = (buf[1] << 24) | (buf[3] << 16) | (buf[5] << 8) | buf[7]; pm860x_rtc_read_time() 121 pm860x_bulk_read(info->i2c, PM8607_RTC_COUNTER1, 4, buf); pm860x_rtc_read_time() 122 data = (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0]; pm860x_rtc_read_time() 135 unsigned char buf[4]; pm860x_rtc_set_time() local 147 pm860x_bulk_read(info->i2c, PM8607_RTC_COUNTER1, 4, buf); pm860x_rtc_set_time() 148 data = (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0]; pm860x_rtc_set_time() 166 unsigned char buf[8]; pm860x_rtc_read_alarm() local 170 pm860x_page_bulk_read(info->i2c, REG0_ADDR, 8, buf); pm860x_rtc_read_alarm() 171 dev_dbg(info->dev, "%x-%x-%x-%x-%x-%x-%x-%x\n", buf[0], buf[1], pm860x_rtc_read_alarm() 172 buf[2], buf[3], buf[4], buf[5], buf[6], buf[7]); pm860x_rtc_read_alarm() 173 base = (buf[1] << 24) | (buf[3] << 16) | (buf[5] << 8) | buf[7]; pm860x_rtc_read_alarm() 175 pm860x_bulk_read(info->i2c, PM8607_RTC_EXPIRE1, 4, buf); pm860x_rtc_read_alarm() 176 data = (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0]; pm860x_rtc_read_alarm() 193 unsigned char buf[8]; pm860x_rtc_set_alarm() local 198 pm860x_page_bulk_read(info->i2c, REG0_ADDR, 8, buf); pm860x_rtc_set_alarm() 199 dev_dbg(info->dev, "%x-%x-%x-%x-%x-%x-%x-%x\n", buf[0], buf[1], pm860x_rtc_set_alarm() 200 buf[2], buf[3], buf[4], buf[5], buf[6], buf[7]); pm860x_rtc_set_alarm() 201 base = (buf[1] << 24) | (buf[3] << 16) | (buf[5] << 8) | buf[7]; pm860x_rtc_set_alarm() 204 pm860x_bulk_read(info->i2c, PM8607_RTC_COUNTER1, 4, buf); pm860x_rtc_set_alarm() 205 data = (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0]; pm860x_rtc_set_alarm() 216 buf[0] = data & 0xff; pm860x_rtc_set_alarm() 217 buf[1] = (data >> 8) & 0xff; pm860x_rtc_set_alarm() 218 buf[2] = (data >> 16) & 0xff; pm860x_rtc_set_alarm() 219 buf[3] = (data >> 24) & 0xff; pm860x_rtc_set_alarm() 220 pm860x_bulk_write(info->i2c, PM8607_RTC_EXPIRE1, 4, buf); pm860x_rtc_set_alarm() 245 unsigned char buf[2]; calibrate_vrtc_work() local 251 pm860x_bulk_read(info->i2c, REG_VRTC_MEAS1, 2, buf); calibrate_vrtc_work() 252 data = (buf[0] << 4) | buf[1]; calibrate_vrtc_work()
|
H A D | rtc-pcf85063.c | 49 unsigned char buf[13] = { PCF85063_REG_CTRL1 }; pcf85063_get_datetime() local 54 .buf = buf pcf85063_get_datetime() 60 .buf = buf pcf85063_get_datetime() 70 tm->tm_sec = bcd2bin(buf[PCF85063_REG_SC] & 0x7F); pcf85063_get_datetime() 71 tm->tm_min = bcd2bin(buf[PCF85063_REG_MN] & 0x7F); pcf85063_get_datetime() 72 tm->tm_hour = bcd2bin(buf[PCF85063_REG_HR] & 0x3F); /* rtc hr 0-23 */ pcf85063_get_datetime() 73 tm->tm_mday = bcd2bin(buf[PCF85063_REG_DM] & 0x3F); pcf85063_get_datetime() 74 tm->tm_wday = buf[PCF85063_REG_DW] & 0x07; pcf85063_get_datetime() 75 tm->tm_mon = bcd2bin(buf[PCF85063_REG_MO] & 0x1F) - 1; /* rtc mn 1-12 */ pcf85063_get_datetime() 76 tm->tm_year = bcd2bin(buf[PCF85063_REG_YR]); pcf85063_get_datetime() 80 pcf85063->c_polarity = (buf[PCF85063_REG_MO] & PCF85063_MO_C) ? pcf85063_get_datetime() 89 unsigned char buf[11]; pcf85063_set_datetime() local 92 buf[PCF85063_REG_CTRL1] = 0; pcf85063_set_datetime() 93 buf[PCF85063_REG_CTRL2] = 5; pcf85063_set_datetime() 96 buf[PCF85063_REG_SC] = bin2bcd(tm->tm_sec) & 0x7F; pcf85063_set_datetime() 98 buf[PCF85063_REG_MN] = bin2bcd(tm->tm_min); pcf85063_set_datetime() 99 buf[PCF85063_REG_HR] = bin2bcd(tm->tm_hour); pcf85063_set_datetime() 102 buf[PCF85063_REG_DM] = bin2bcd(tm->tm_mday); pcf85063_set_datetime() 105 buf[PCF85063_REG_DW] = tm->tm_wday & 0x07; pcf85063_set_datetime() 108 buf[PCF85063_REG_MO] = bin2bcd(tm->tm_mon + 1); pcf85063_set_datetime() 111 buf[PCF85063_REG_YR] = bin2bcd(tm->tm_year % 100); pcf85063_set_datetime() 114 for (i = 0; i < sizeof(buf); i++) { pcf85063_set_datetime() 115 unsigned char data[2] = { i, buf[i] }; pcf85063_set_datetime()
|
H A D | rtc-max6902.c | 36 unsigned char buf[2]; max6902_set_reg() local 39 buf[0] = address & 0x7f; max6902_set_reg() 40 buf[1] = data; max6902_set_reg() 42 return spi_write_then_read(spi, buf, 2, NULL, 0); max6902_set_reg() 60 unsigned char buf[8]; max6902_read_time() local 62 buf[0] = 0xbf; /* Burst read */ max6902_read_time() 64 err = spi_write_then_read(spi, buf, 1, buf, 8); max6902_read_time() 70 dt->tm_sec = bcd2bin(buf[0]); max6902_read_time() 71 dt->tm_min = bcd2bin(buf[1]); max6902_read_time() 72 dt->tm_hour = bcd2bin(buf[2]); max6902_read_time() 73 dt->tm_mday = bcd2bin(buf[3]); max6902_read_time() 74 dt->tm_mon = bcd2bin(buf[4]) - 1; max6902_read_time() 75 dt->tm_wday = bcd2bin(buf[5]); max6902_read_time() 76 dt->tm_year = bcd2bin(buf[6]); max6902_read_time() 79 err = max6902_get_reg(dev, MAX6902_REG_CENTURY, &buf[0]); max6902_read_time() 83 century = bcd2bin(buf[0]) * 100; max6902_read_time()
|
H A D | rtc-isl12022.c | 63 .buf = data isl12022_read_regs() 69 .buf = data isl12022_read_regs() 111 uint8_t buf[ISL12022_REG_INT + 1]; isl12022_get_datetime() local 114 ret = isl12022_read_regs(client, ISL12022_REG_SC, buf, sizeof(buf)); isl12022_get_datetime() 118 if (buf[ISL12022_REG_SR] & (ISL12022_SR_LBAT85 | ISL12022_SR_LBAT75)) { isl12022_get_datetime() 122 buf[ISL12022_REG_SR] & ISL12022_SR_LBAT85 ? 85 : 75); isl12022_get_datetime() 130 buf[ISL12022_REG_SC], isl12022_get_datetime() 131 buf[ISL12022_REG_MN], isl12022_get_datetime() 132 buf[ISL12022_REG_HR], isl12022_get_datetime() 133 buf[ISL12022_REG_DT], isl12022_get_datetime() 134 buf[ISL12022_REG_MO], isl12022_get_datetime() 135 buf[ISL12022_REG_YR], isl12022_get_datetime() 136 buf[ISL12022_REG_DW], isl12022_get_datetime() 137 buf[ISL12022_REG_SR], isl12022_get_datetime() 138 buf[ISL12022_REG_INT]); isl12022_get_datetime() 140 tm->tm_sec = bcd2bin(buf[ISL12022_REG_SC] & 0x7F); isl12022_get_datetime() 141 tm->tm_min = bcd2bin(buf[ISL12022_REG_MN] & 0x7F); isl12022_get_datetime() 142 tm->tm_hour = bcd2bin(buf[ISL12022_REG_HR] & 0x3F); isl12022_get_datetime() 143 tm->tm_mday = bcd2bin(buf[ISL12022_REG_DT] & 0x3F); isl12022_get_datetime() 144 tm->tm_wday = buf[ISL12022_REG_DW] & 0x07; isl12022_get_datetime() 145 tm->tm_mon = bcd2bin(buf[ISL12022_REG_MO] & 0x1F) - 1; isl12022_get_datetime() 146 tm->tm_year = bcd2bin(buf[ISL12022_REG_YR]) + 100; isl12022_get_datetime() 162 uint8_t buf[ISL12022_REG_DW + 1]; isl12022_set_datetime() local 172 ret = isl12022_read_regs(client, ISL12022_REG_INT, buf, 1); isl12022_set_datetime() 178 if (!(buf[0] & ISL12022_INT_WRTC)) { isl12022_set_datetime() 185 buf[0] | ISL12022_INT_WRTC); isl12022_set_datetime() 193 buf, 1); isl12022_set_datetime() 199 buf[0] | ISL12022_HR_MIL); isl12022_set_datetime() 208 buf[ISL12022_REG_SC] = bin2bcd(tm->tm_sec); isl12022_set_datetime() 209 buf[ISL12022_REG_MN] = bin2bcd(tm->tm_min); isl12022_set_datetime() 210 buf[ISL12022_REG_HR] = bin2bcd(tm->tm_hour) | ISL12022_HR_MIL; isl12022_set_datetime() 212 buf[ISL12022_REG_DT] = bin2bcd(tm->tm_mday); isl12022_set_datetime() 215 buf[ISL12022_REG_MO] = bin2bcd(tm->tm_mon + 1); isl12022_set_datetime() 218 buf[ISL12022_REG_YR] = bin2bcd(tm->tm_year % 100); isl12022_set_datetime() 220 buf[ISL12022_REG_DW] = tm->tm_wday & 0x07; isl12022_set_datetime() 223 for (i = 0; i < ARRAY_SIZE(buf); i++) { isl12022_set_datetime() 225 buf[ISL12022_REG_SC + i]); isl12022_set_datetime()
|
H A D | rtc-pcf2127.c | 51 unsigned char buf[10] = { PCF2127_REG_CTRL1 }; pcf2127_get_datetime() local 54 if (i2c_master_send(client, buf, 1) != 1 || pcf2127_get_datetime() 55 i2c_master_recv(client, buf, sizeof(buf)) != sizeof(buf)) { pcf2127_get_datetime() 60 if (buf[PCF2127_REG_CTRL3] & PCF2127_REG_CTRL3_BLF) pcf2127_get_datetime() 64 if (buf[PCF2127_REG_SC] & PCF2127_OSF) { pcf2127_get_datetime() 79 buf[0], buf[1], buf[2], pcf2127_get_datetime() 80 buf[3], buf[4], buf[5], pcf2127_get_datetime() 81 buf[6], buf[7], buf[8], buf[9]); pcf2127_get_datetime() 84 tm->tm_sec = bcd2bin(buf[PCF2127_REG_SC] & 0x7F); pcf2127_get_datetime() 85 tm->tm_min = bcd2bin(buf[PCF2127_REG_MN] & 0x7F); pcf2127_get_datetime() 86 tm->tm_hour = bcd2bin(buf[PCF2127_REG_HR] & 0x3F); /* rtc hr 0-23 */ pcf2127_get_datetime() 87 tm->tm_mday = bcd2bin(buf[PCF2127_REG_DM] & 0x3F); pcf2127_get_datetime() 88 tm->tm_wday = buf[PCF2127_REG_DW] & 0x07; pcf2127_get_datetime() 89 tm->tm_mon = bcd2bin(buf[PCF2127_REG_MO] & 0x1F) - 1; /* rtc mn 1-12 */ pcf2127_get_datetime() 90 tm->tm_year = bcd2bin(buf[PCF2127_REG_YR]); pcf2127_get_datetime() 105 unsigned char buf[8]; pcf2127_set_datetime() local 115 buf[i++] = PCF2127_REG_SC; pcf2127_set_datetime() 118 buf[i++] = bin2bcd(tm->tm_sec); /* this will also clear OSF flag */ pcf2127_set_datetime() 119 buf[i++] = bin2bcd(tm->tm_min); pcf2127_set_datetime() 120 buf[i++] = bin2bcd(tm->tm_hour); pcf2127_set_datetime() 121 buf[i++] = bin2bcd(tm->tm_mday); pcf2127_set_datetime() 122 buf[i++] = tm->tm_wday & 0x07; pcf2127_set_datetime() 125 buf[i++] = bin2bcd(tm->tm_mon + 1); pcf2127_set_datetime() 128 buf[i++] = bin2bcd(tm->tm_year % 100); pcf2127_set_datetime() 131 err = i2c_master_send(client, buf, i); pcf2127_set_datetime() 146 unsigned char buf = PCF2127_REG_CTRL3; pcf2127_rtc_ioctl() local 152 ret = i2c_master_send(client, &buf, 1); pcf2127_rtc_ioctl() 158 ret = i2c_master_recv(client, &buf, 1); pcf2127_rtc_ioctl() 164 touser = buf & PCF2127_REG_CTRL3_BLF ? 1 : 0; pcf2127_rtc_ioctl()
|
H A D | rtc-ds1672.c | 37 unsigned char buf[4]; ds1672_get_datetime() local 43 .buf = &addr ds1672_get_datetime() 49 .buf = buf ds1672_get_datetime() 61 __func__, buf[0], buf[1], buf[2], buf[3]); ds1672_get_datetime() 63 time = (buf[3] << 24) | (buf[2] << 16) | (buf[1] << 8) | buf[0]; ds1672_get_datetime() 78 unsigned char buf[6]; ds1672_set_mmss() local 80 buf[0] = DS1672_REG_CNT_BASE; ds1672_set_mmss() 81 buf[1] = secs & 0x000000FF; ds1672_set_mmss() 82 buf[2] = (secs & 0x0000FF00) >> 8; ds1672_set_mmss() 83 buf[3] = (secs & 0x00FF0000) >> 16; ds1672_set_mmss() 84 buf[4] = (secs & 0xFF000000) >> 24; ds1672_set_mmss() 85 buf[5] = 0; /* set control reg to enable counting */ ds1672_set_mmss() 87 xfer = i2c_master_send(client, buf, 6); ds1672_set_mmss() 114 .buf = &addr ds1672_get_control() 120 .buf = status ds1672_get_control() 135 char *buf) show_control() 145 return sprintf(buf, "%s\n", (control & DS1672_REG_CONTROL_EOSC) show_control() 134 show_control(struct device *dev, struct device_attribute *attr, char *buf) show_control() argument
|
H A D | rtc-pcf8583.c | 54 unsigned char buf[8], addr[1] = { 1 }; pcf8583_get_datetime() local 60 .buf = addr, pcf8583_get_datetime() 65 .buf = buf, pcf8583_get_datetime() 70 memset(buf, 0, sizeof(buf)); pcf8583_get_datetime() 74 dt->tm_year = buf[4] >> 6; pcf8583_get_datetime() 75 dt->tm_wday = buf[5] >> 5; pcf8583_get_datetime() 77 buf[4] &= 0x3f; pcf8583_get_datetime() 78 buf[5] &= 0x1f; pcf8583_get_datetime() 80 dt->tm_sec = bcd2bin(buf[1]); pcf8583_get_datetime() 81 dt->tm_min = bcd2bin(buf[2]); pcf8583_get_datetime() 82 dt->tm_hour = bcd2bin(buf[3]); pcf8583_get_datetime() 83 dt->tm_mday = bcd2bin(buf[4]); pcf8583_get_datetime() 84 dt->tm_mon = bcd2bin(buf[5]) - 1; pcf8583_get_datetime() 92 unsigned char buf[8]; pcf8583_set_datetime() local 95 buf[0] = 0; pcf8583_set_datetime() 96 buf[1] = get_ctrl(client) | 0x80; pcf8583_set_datetime() 97 buf[2] = 0; pcf8583_set_datetime() 98 buf[3] = bin2bcd(dt->tm_sec); pcf8583_set_datetime() 99 buf[4] = bin2bcd(dt->tm_min); pcf8583_set_datetime() 100 buf[5] = bin2bcd(dt->tm_hour); pcf8583_set_datetime() 104 buf[6] = bin2bcd(dt->tm_mday) | (dt->tm_year << 6); pcf8583_set_datetime() 105 buf[7] = bin2bcd(dt->tm_mon + 1) | (dt->tm_wday << 5); pcf8583_set_datetime() 108 ret = i2c_master_send(client, (char *)buf, len); pcf8583_set_datetime() 112 buf[1] = get_ctrl(client); pcf8583_set_datetime() 113 ret = i2c_master_send(client, (char *)buf, 2); pcf8583_set_datetime() 126 unsigned char buf[2]; pcf8583_set_ctrl() local 128 buf[0] = 0; pcf8583_set_ctrl() 129 buf[1] = *ctrl; pcf8583_set_ctrl() 132 return i2c_master_send(client, (char *)buf, 2); pcf8583_set_ctrl() 143 .buf = addr, pcf8583_read_mem() 148 .buf = mem->data, pcf8583_read_mem() 162 unsigned char buf[9]; pcf8583_write_mem() local 168 buf[0] = mem->loc; pcf8583_write_mem() 169 memcpy(buf + 1, mem->data, mem->nr); pcf8583_write_mem() 171 ret = i2c_master_send(client, buf, mem->nr + 1); pcf8583_write_mem()
|
H A D | rtc-ds1305.c | 146 u8 buf[2]; ds1305_alarm_irq_enable() local 149 buf[0] = DS1305_WRITE | DS1305_CONTROL; ds1305_alarm_irq_enable() 150 buf[1] = ds1305->ctrl[0]; ds1305_alarm_irq_enable() 155 buf[1] |= DS1305_AEI0; ds1305_alarm_irq_enable() 157 if (!(buf[1] & DS1305_AEI0)) ds1305_alarm_irq_enable() 159 buf[1] &= ~DS1305_AEI0; ds1305_alarm_irq_enable() 161 err = spi_write_then_read(ds1305->spi, buf, sizeof(buf), NULL, 0); ds1305_alarm_irq_enable() 163 ds1305->ctrl[0] = buf[1]; ds1305_alarm_irq_enable() 178 u8 buf[DS1305_RTC_LEN]; ds1305_get_time() local 185 buf, sizeof(buf)); ds1305_get_time() 190 "read", buf[0], buf[1], buf[2], buf[3], ds1305_get_time() 191 buf[4], buf[5], buf[6]); ds1305_get_time() 194 time->tm_sec = bcd2bin(buf[DS1305_SEC]); ds1305_get_time() 195 time->tm_min = bcd2bin(buf[DS1305_MIN]); ds1305_get_time() 196 time->tm_hour = bcd2hour(buf[DS1305_HOUR]); ds1305_get_time() 197 time->tm_wday = buf[DS1305_WDAY] - 1; ds1305_get_time() 198 time->tm_mday = bcd2bin(buf[DS1305_MDAY]); ds1305_get_time() 199 time->tm_mon = bcd2bin(buf[DS1305_MON]) - 1; ds1305_get_time() 200 time->tm_year = bcd2bin(buf[DS1305_YEAR]) + 100; ds1305_get_time() 215 u8 buf[1 + DS1305_RTC_LEN]; ds1305_set_time() local 216 u8 *bp = buf; ds1305_set_time() 236 "write", buf[1], buf[2], buf[3], ds1305_set_time() 237 buf[4], buf[5], buf[6], buf[7]); ds1305_set_time() 240 return spi_write_then_read(ds1305->spi, buf, sizeof(buf), ds1305_set_time() 281 u8 buf[DS1305_ALM_LEN]; ds1305_get_alarm() local 300 buf, sizeof(buf)); ds1305_get_alarm() 305 "alm0 read", buf[DS1305_SEC], buf[DS1305_MIN], ds1305_get_alarm() 306 buf[DS1305_HOUR], buf[DS1305_WDAY]); ds1305_get_alarm() 308 if ((DS1305_ALM_DISABLE & buf[DS1305_SEC]) ds1305_get_alarm() 309 || (DS1305_ALM_DISABLE & buf[DS1305_MIN]) ds1305_get_alarm() 310 || (DS1305_ALM_DISABLE & buf[DS1305_HOUR])) ds1305_get_alarm() 317 alm->time.tm_sec = bcd2bin(buf[DS1305_SEC]); ds1305_get_alarm() 318 alm->time.tm_min = bcd2bin(buf[DS1305_MIN]); ds1305_get_alarm() 319 alm->time.tm_hour = bcd2hour(buf[DS1305_HOUR]); ds1305_get_alarm() 341 u8 buf[1 + DS1305_ALM_LEN]; ds1305_set_alarm() local 366 buf[0] = DS1305_WRITE | DS1305_CONTROL; ds1305_set_alarm() 367 buf[1] = ds1305->ctrl[0]; ds1305_set_alarm() 368 status = spi_write_then_read(ds1305->spi, buf, 2, NULL, 0); ds1305_set_alarm() 374 buf[0] = DS1305_WRITE | DS1305_ALM0(DS1305_SEC); ds1305_set_alarm() 375 buf[1 + DS1305_SEC] = bin2bcd(alm->time.tm_sec); ds1305_set_alarm() 376 buf[1 + DS1305_MIN] = bin2bcd(alm->time.tm_min); ds1305_set_alarm() 377 buf[1 + DS1305_HOUR] = hour2bcd(ds1305->hr12, alm->time.tm_hour); ds1305_set_alarm() 378 buf[1 + DS1305_WDAY] = DS1305_ALM_DISABLE; ds1305_set_alarm() 381 "alm0 write", buf[1 + DS1305_SEC], buf[1 + DS1305_MIN], ds1305_set_alarm() 382 buf[1 + DS1305_HOUR], buf[1 + DS1305_WDAY]); ds1305_set_alarm() 384 status = spi_write_then_read(spi, buf, sizeof(buf), NULL, 0); ds1305_set_alarm() 392 buf[0] = DS1305_WRITE | DS1305_CONTROL; ds1305_set_alarm() 393 buf[1] = ds1305->ctrl[0]; ds1305_set_alarm() 394 status = spi_write_then_read(ds1305->spi, buf, 2, NULL, 0); ds1305_set_alarm() 460 u8 buf[3]; ds1305_work() local 473 buf[0] = DS1305_WRITE | DS1305_CONTROL; ds1305_work() 474 buf[1] = ds1305->ctrl[0]; ds1305_work() 475 buf[2] = 0; ds1305_work() 477 status = spi_write_then_read(spi, buf, sizeof(buf), ds1305_work() 531 char *buf, loff_t off, size_t count) ds1305_nvram_read() 542 msg_init(&m, x, &addr, count, NULL, buf); ds1305_nvram_read() 553 char *buf, loff_t off, size_t count) ds1305_nvram_write() 564 msg_init(&m, x, &addr, count, buf, NULL); ds1305_nvram_write() 638 u8 buf[2]; ds1305_probe() local 642 buf[0] = DS1305_WRITE | DS1305_CONTROL; ds1305_probe() 643 buf[1] = ds1305->ctrl[0]; ds1305_probe() 644 status = spi_write_then_read(spi, buf, sizeof(buf), NULL, 0); ds1305_probe() 692 u8 buf[4]; ds1305_probe() local 694 buf[0] = DS1305_WRITE | DS1305_CONTROL; ds1305_probe() 695 buf[1] = ds1305->ctrl[0]; ds1305_probe() 696 buf[2] = ds1305->ctrl[1]; ds1305_probe() 697 buf[3] = ds1305->ctrl[2]; ds1305_probe() 698 status = spi_write_then_read(spi, buf, sizeof(buf), NULL, 0); ds1305_probe() 529 ds1305_nvram_read(struct file *filp, struct kobject *kobj, struct bin_attribute *attr, char *buf, loff_t off, size_t count) ds1305_nvram_read() argument 551 ds1305_nvram_write(struct file *filp, struct kobject *kobj, struct bin_attribute *attr, char *buf, loff_t off, size_t count) ds1305_nvram_write() argument
|
H A D | rtc-abx80x.c | 98 unsigned char buf[8]; abx80x_rtc_read_time() local 102 sizeof(buf), buf); abx80x_rtc_read_time() 108 tm->tm_sec = bcd2bin(buf[ABX8XX_REG_SC] & 0x7F); abx80x_rtc_read_time() 109 tm->tm_min = bcd2bin(buf[ABX8XX_REG_MN] & 0x7F); abx80x_rtc_read_time() 110 tm->tm_hour = bcd2bin(buf[ABX8XX_REG_HR] & 0x3F); abx80x_rtc_read_time() 111 tm->tm_wday = buf[ABX8XX_REG_WD] & 0x7; abx80x_rtc_read_time() 112 tm->tm_mday = bcd2bin(buf[ABX8XX_REG_DA] & 0x3F); abx80x_rtc_read_time() 113 tm->tm_mon = bcd2bin(buf[ABX8XX_REG_MO] & 0x1F) - 1; abx80x_rtc_read_time() 114 tm->tm_year = bcd2bin(buf[ABX8XX_REG_YR]) + 100; abx80x_rtc_read_time() 126 unsigned char buf[8]; abx80x_rtc_set_time() local 132 buf[ABX8XX_REG_HTH] = 0; abx80x_rtc_set_time() 133 buf[ABX8XX_REG_SC] = bin2bcd(tm->tm_sec); abx80x_rtc_set_time() 134 buf[ABX8XX_REG_MN] = bin2bcd(tm->tm_min); abx80x_rtc_set_time() 135 buf[ABX8XX_REG_HR] = bin2bcd(tm->tm_hour); abx80x_rtc_set_time() 136 buf[ABX8XX_REG_DA] = bin2bcd(tm->tm_mday); abx80x_rtc_set_time() 137 buf[ABX8XX_REG_MO] = bin2bcd(tm->tm_mon + 1); abx80x_rtc_set_time() 138 buf[ABX8XX_REG_YR] = bin2bcd(tm->tm_year - 100); abx80x_rtc_set_time() 139 buf[ABX8XX_REG_WD] = tm->tm_wday; abx80x_rtc_set_time() 142 sizeof(buf), buf); abx80x_rtc_set_time() 194 char buf[7]; abx80x_probe() local 206 sizeof(buf), buf); abx80x_probe() 212 partnumber = (buf[0] << 8) | buf[1]; abx80x_probe() 213 majrev = buf[2] >> 3; abx80x_probe() 214 minrev = buf[2] & 0x7; abx80x_probe() 215 lot = ((buf[4] & 0x80) << 2) | ((buf[6] & 0x80) << 1) | buf[3]; abx80x_probe() 216 uid = ((buf[4] & 0x7f) << 8) | buf[5]; abx80x_probe() 217 wafer = (buf[6] & 0x7c) >> 2; abx80x_probe()
|
H A D | rtc-m41t93.c | 39 u8 buf[2]; m41t93_set_reg() local 42 buf[0] = addr | 0x80; m41t93_set_reg() 43 buf[1] = data; m41t93_set_reg() 45 return spi_write(spi, buf, sizeof(buf)); m41t93_set_reg() 52 u8 buf[9] = {0x80}; /* write cmd + 8 data bytes */ m41t93_set_time() local 53 u8 * const data = &buf[1]; /* ptr to first data byte */ m41t93_set_time() 80 u8 reset_osc = buf[M41T93_REG_ST_SEC] | M41T93_FLAG_ST; m41t93_set_time() 100 return spi_write(spi, buf, sizeof(buf)); m41t93_set_time() 108 u8 buf[8]; m41t93_get_time() local 142 tmp = spi_write_then_read(spi, &start_addr, 1, buf, sizeof(buf)); m41t93_get_time() 146 tm->tm_sec = bcd2bin(buf[M41T93_REG_ST_SEC]); m41t93_get_time() 147 tm->tm_min = bcd2bin(buf[M41T93_REG_MIN]); m41t93_get_time() 148 tm->tm_hour = bcd2bin(buf[M41T93_REG_CENT_HOUR] & 0x3f); m41t93_get_time() 149 tm->tm_mday = bcd2bin(buf[M41T93_REG_DAY]); m41t93_get_time() 150 tm->tm_mon = bcd2bin(buf[M41T93_REG_MON]) - 1; m41t93_get_time() 151 tm->tm_wday = bcd2bin(buf[M41T93_REG_WDAY] & 0x0f) - 1; m41t93_get_time() 153 century_after_1900 = (buf[M41T93_REG_CENT_HOUR] >> 6) + 1; m41t93_get_time() 154 tm->tm_year = bcd2bin(buf[M41T93_REG_YEAR]) + century_after_1900 * 100; m41t93_get_time()
|
H A D | rtc-tx4939.c | 50 unsigned char buf[6]; tx4939_rtc_set_mmss() local 52 buf[0] = 0; tx4939_rtc_set_mmss() 53 buf[1] = 0; tx4939_rtc_set_mmss() 54 buf[2] = secs; tx4939_rtc_set_mmss() 55 buf[3] = secs >> 8; tx4939_rtc_set_mmss() 56 buf[4] = secs >> 16; tx4939_rtc_set_mmss() 57 buf[5] = secs >> 24; tx4939_rtc_set_mmss() 61 __raw_writel(buf[i], &rtcreg->dat); tx4939_rtc_set_mmss() 75 unsigned char buf[6]; tx4939_rtc_read_time() local 87 buf[i] = __raw_readl(&rtcreg->dat); tx4939_rtc_read_time() 89 sec = (buf[5] << 24) | (buf[4] << 16) | (buf[3] << 8) | buf[2]; tx4939_rtc_read_time() 100 unsigned char buf[6]; tx4939_rtc_set_alarm() local 110 buf[0] = 0; tx4939_rtc_set_alarm() 111 buf[1] = 0; tx4939_rtc_set_alarm() 112 buf[2] = sec; tx4939_rtc_set_alarm() 113 buf[3] = sec >> 8; tx4939_rtc_set_alarm() 114 buf[4] = sec >> 16; tx4939_rtc_set_alarm() 115 buf[5] = sec >> 24; tx4939_rtc_set_alarm() 119 __raw_writel(buf[i], &rtcreg->dat); tx4939_rtc_set_alarm() 132 unsigned char buf[6]; tx4939_rtc_read_alarm() local 145 buf[i] = __raw_readl(&rtcreg->dat); tx4939_rtc_read_alarm() 150 sec = (buf[5] << 24) | (buf[4] << 16) | (buf[3] << 8) | buf[2]; tx4939_rtc_read_alarm() 194 char *buf, loff_t pos, size_t size) tx4939_rtc_nvram_read() 204 *buf++ = __raw_readl(&rtcreg->dat); tx4939_rtc_nvram_read() 212 char *buf, loff_t pos, size_t size) tx4939_rtc_nvram_write() 222 __raw_writel(*buf++, &rtcreg->dat); tx4939_rtc_nvram_write() 192 tx4939_rtc_nvram_read(struct file *filp, struct kobject *kobj, struct bin_attribute *bin_attr, char *buf, loff_t pos, size_t size) tx4939_rtc_nvram_read() argument 210 tx4939_rtc_nvram_write(struct file *filp, struct kobject *kobj, struct bin_attribute *bin_attr, char *buf, loff_t pos, size_t size) tx4939_rtc_nvram_write() argument
|
/linux-4.4.14/sound/firewire/dice/ |
H A D | dice-proc.c | 115 } buf; dice_proc_read() local 126 quadlets = min_t(u32, sections[1], sizeof(buf.global) / 4); dice_proc_read() 127 if (dice_proc_read_mem(dice, &buf.global, sections[0], quadlets) < 0) dice_proc_read() 131 buf.global.owner_hi >> 16, dice_proc_read() 132 buf.global.owner_hi & 0xffff, buf.global.owner_lo); dice_proc_read() 133 snd_iprintf(buffer, " notification: %08x\n", buf.global.notification); dice_proc_read() 134 dice_proc_fixup_string(buf.global.nick_name, NICK_NAME_SIZE); dice_proc_read() 135 snd_iprintf(buffer, " nick name: %s\n", buf.global.nick_name); dice_proc_read() 138 buf.global.clock_select & CLOCK_SOURCE_MASK), dice_proc_read() 140 (buf.global.clock_select & CLOCK_RATE_MASK) dice_proc_read() 142 snd_iprintf(buffer, " enable: %u\n", buf.global.enable); dice_proc_read() 144 buf.global.status & STATUS_SOURCE_LOCKED ? "" : "un", dice_proc_read() 146 (buf.global.status & dice_proc_read() 149 snd_iprintf(buffer, " ext status: %08x\n", buf.global.extended_status); dice_proc_read() 150 snd_iprintf(buffer, " sample rate: %u\n", buf.global.sample_rate); dice_proc_read() 152 (buf.global.version >> 24) & 0xff, dice_proc_read() 153 (buf.global.version >> 16) & 0xff, dice_proc_read() 154 (buf.global.version >> 8) & 0xff, dice_proc_read() 155 (buf.global.version >> 0) & 0xff); dice_proc_read() 159 if (buf.global.clock_caps & (1 << i)) dice_proc_read() 162 if (buf.global.clock_caps & (1 << (16 + i))) dice_proc_read() 165 dice_proc_fixup_string(buf.global.clock_source_names, dice_proc_read() 168 buf.global.clock_source_names); dice_proc_read() 173 quadlets = min_t(u32, tx_rx_header.size, sizeof(buf.tx) / 4); dice_proc_read() 175 if (dice_proc_read_mem(dice, &buf.tx, sections[2] + 2 + dice_proc_read() 180 snd_iprintf(buffer, " iso channel: %d\n", (int)buf.tx.iso); dice_proc_read() 182 buf.tx.number_audio); dice_proc_read() 183 snd_iprintf(buffer, " midi ports: %u\n", buf.tx.number_midi); dice_proc_read() 184 snd_iprintf(buffer, " speed: S%u\n", 100u << buf.tx.speed); dice_proc_read() 186 dice_proc_fixup_string(buf.tx.names, TX_NAMES_SIZE); dice_proc_read() 187 snd_iprintf(buffer, " names: %s\n", buf.tx.names); dice_proc_read() 191 buf.tx.ac3_caps); dice_proc_read() 193 buf.tx.ac3_enable); dice_proc_read() 199 quadlets = min_t(u32, tx_rx_header.size, sizeof(buf.rx) / 4); dice_proc_read() 201 if (dice_proc_read_mem(dice, &buf.rx, sections[4] + 2 + dice_proc_read() 206 snd_iprintf(buffer, " iso channel: %d\n", (int)buf.rx.iso); dice_proc_read() 207 snd_iprintf(buffer, " sequence start: %u\n", buf.rx.seq_start); dice_proc_read() 209 buf.rx.number_audio); dice_proc_read() 210 snd_iprintf(buffer, " midi ports: %u\n", buf.rx.number_midi); dice_proc_read() 212 dice_proc_fixup_string(buf.rx.names, RX_NAMES_SIZE); dice_proc_read() 213 snd_iprintf(buffer, " names: %s\n", buf.rx.names); dice_proc_read() 217 buf.rx.ac3_caps); dice_proc_read() 219 buf.rx.ac3_enable); dice_proc_read() 223 quadlets = min_t(u32, sections[7], sizeof(buf.ext_sync) / 4); dice_proc_read() 225 if (dice_proc_read_mem(dice, &buf.ext_sync, dice_proc_read() 232 buf.ext_sync.clock_source)); dice_proc_read() 233 snd_iprintf(buffer, " locked: %u\n", buf.ext_sync.locked); dice_proc_read() 236 buf.ext_sync.rate)); dice_proc_read() 238 if (buf.ext_sync.adat_user_data & ADAT_USER_DATA_NO_DATA) dice_proc_read() 242 buf.ext_sync.adat_user_data); dice_proc_read()
|
/linux-4.4.14/drivers/ide/ |
H A D | ide-sysfs.c | 23 char *buf) media_show() 26 return sprintf(buf, "%s\n", ide_media_string(drive)); media_show() 31 char *buf) drivename_show() 34 return sprintf(buf, "%s\n", drive->name); drivename_show() 39 char *buf) modalias_show() 42 return sprintf(buf, "ide:m-%s\n", ide_media_string(drive)); modalias_show() 47 char *buf) model_show() 50 return sprintf(buf, "%s\n", (char *)&drive->id[ATA_ID_PROD]); model_show() 55 char *buf) firmware_show() 58 return sprintf(buf, "%s\n", (char *)&drive->id[ATA_ID_FW_REV]); firmware_show() 63 char *buf) serial_show() 66 return sprintf(buf, "%s\n", (char *)&drive->id[ATA_ID_SERNO]); serial_show() 94 const char *buf, size_t n) store_delete_devices() 98 if (strncmp(buf, "1", n)) store_delete_devices() 110 const char *buf, size_t n) store_scan() 114 if (strncmp(buf, "1", n)) store_scan() 22 media_show(struct device *dev, struct device_attribute *attr, char *buf) media_show() argument 30 drivename_show(struct device *dev, struct device_attribute *attr, char *buf) drivename_show() argument 38 modalias_show(struct device *dev, struct device_attribute *attr, char *buf) modalias_show() argument 46 model_show(struct device *dev, struct device_attribute *attr, char *buf) model_show() argument 54 firmware_show(struct device *dev, struct device_attribute *attr, char *buf) firmware_show() argument 62 serial_show(struct device *dev, struct device_attribute *attr, char *buf) serial_show() argument 92 store_delete_devices(struct device *portdev, struct device_attribute *attr, const char *buf, size_t n) store_delete_devices() argument 108 store_scan(struct device *portdev, struct device_attribute *attr, const char *buf, size_t n) store_scan() argument
|
/linux-4.4.14/arch/s390/pci/ |
H A D | pci_mmio.c | 39 void *buf; SYSCALL_DEFINE3() local 49 buf = kmalloc(length, GFP_KERNEL); SYSCALL_DEFINE3() 50 if (!buf) SYSCALL_DEFINE3() 53 buf = local_buf; SYSCALL_DEFINE3() 64 if (copy_from_user(buf, user_buffer, length)) SYSCALL_DEFINE3() 67 ret = zpci_memcpy_toio(io_addr, buf, length); SYSCALL_DEFINE3() 69 if (buf != local_buf) SYSCALL_DEFINE3() 70 kfree(buf); SYSCALL_DEFINE3() 79 void *buf; SYSCALL_DEFINE3() local 89 buf = kmalloc(length, GFP_KERNEL); SYSCALL_DEFINE3() 90 if (!buf) SYSCALL_DEFINE3() 93 buf = local_buf; SYSCALL_DEFINE3() 104 ret = zpci_memcpy_fromio(buf, io_addr, length); SYSCALL_DEFINE3() 107 if (copy_to_user(user_buffer, buf, length)) SYSCALL_DEFINE3() 111 if (buf != local_buf) SYSCALL_DEFINE3() 112 kfree(buf); SYSCALL_DEFINE3()
|
/linux-4.4.14/arch/mips/boot/compressed/ |
H A D | dbg.c | 28 unsigned char buf[10]; puthex() local 31 buf[i] = "0123456789ABCDEF"[val & 0x0F]; puthex() 34 buf[8] = '\0'; puthex() 35 puts(buf); puthex()
|
/linux-4.4.14/drivers/media/pci/cx88/ |
H A D | cx88-vbi.c | 48 struct cx88_buffer *buf) cx8800_start_vbi_dma() 54 VBI_LINE_LENGTH, buf->risc.dma); cx8800_start_vbi_dma() 96 struct cx88_buffer *buf; cx8800_restart_vbi_queue() local 101 buf = list_entry(q->active.next, struct cx88_buffer, list); cx8800_restart_vbi_queue() 103 buf, buf->vb.vb2_buf.index); cx8800_restart_vbi_queue() 104 cx8800_start_vbi_dma(dev, q, buf); cx8800_restart_vbi_queue() 130 struct cx88_buffer *buf = container_of(vbuf, struct cx88_buffer, vb); buffer_prepare() local 144 cx88_risc_buffer(dev->pci, &buf->risc, sgt->sgl, buffer_prepare() 155 struct cx88_buffer *buf = container_of(vbuf, struct cx88_buffer, vb); buffer_finish() local 156 struct cx88_riscmem *risc = &buf->risc; buffer_finish() 167 struct cx88_buffer *buf = container_of(vbuf, struct cx88_buffer, vb); buffer_queue() local 172 buf->risc.cpu[1] = cpu_to_le32(buf->risc.dma + 8); buffer_queue() 173 buf->risc.jmp[0] = cpu_to_le32(RISC_JUMP | RISC_CNT_INC); buffer_queue() 174 buf->risc.jmp[1] = cpu_to_le32(buf->risc.dma + 8); buffer_queue() 177 list_add_tail(&buf->list, &q->active); buffer_queue() 178 cx8800_start_vbi_dma(dev, q, buf); buffer_queue() 180 buf, buf->vb.vb2_buf.index); buffer_queue() 183 buf->risc.cpu[0] |= cpu_to_le32(RISC_IRQ1); buffer_queue() 185 list_add_tail(&buf->list, &q->active); buffer_queue() 186 prev->risc.jmp[1] = cpu_to_le32(buf->risc.dma); buffer_queue() 188 buf, buf->vb.vb2_buf.index); buffer_queue() 196 struct cx88_buffer *buf = list_entry(dmaq->active.next, start_streaming() local 199 cx8800_start_vbi_dma(dev, dmaq, buf); start_streaming() 215 struct cx88_buffer *buf = list_entry(dmaq->active.next, stop_streaming() local 218 list_del(&buf->list); stop_streaming() 219 vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_ERROR); stop_streaming() 46 cx8800_start_vbi_dma(struct cx8800_dev *dev, struct cx88_dmaqueue *q, struct cx88_buffer *buf) cx8800_start_vbi_dma() argument
|
/linux-4.4.14/tools/usb/usbip/libsrc/ |
H A D | names.c | 311 char buf[512], *cp; parse() local 320 while (fgets(buf, sizeof(buf), f)) { parse() 323 cp = strchr(buf, '\r'); parse() 326 cp = strchr(buf, '\n'); parse() 329 if (buf[0] == '#' || !buf[0]) parse() 331 cp = buf; parse() 332 if (buf[0] == 'P' && buf[1] == 'H' && buf[2] == 'Y' && parse() 333 buf[3] == 'S' && buf[4] == 'D' && parse() 334 buf[5] == 'E' && buf[6] == 'S' && /*isspace(buf[7])*/ parse() 335 buf[7] == ' ') { parse() 338 if (buf[0] == 'P' && buf[1] == 'H' && parse() 339 buf[2] == 'Y' && /*isspace(buf[3])*/ buf[3] == ' ') { parse() 342 if (buf[0] == 'B' && buf[1] == 'I' && buf[2] == 'A' && parse() 343 buf[3] == 'S' && /*isspace(buf[4])*/ buf[4] == ' ') { parse() 346 if (buf[0] == 'L' && /*isspace(buf[1])*/ buf[1] == ' ') { parse() 355 if (buf[0] == 'C' && /*isspace(buf[1])*/ buf[1] == ' ') { parse() 357 cp = buf+2; parse() 379 if (buf[0] == 'A' && buf[1] == 'T' && isspace(buf[2])) { parse() 383 if (buf[0] == 'H' && buf[1] == 'C' && buf[2] == 'C' parse() 384 && isspace(buf[3])) { parse() 405 if (buf[0] == '\t' && isxdigit(buf[1])) { parse() 407 u = strtoul(buf+1, &cp, 16); parse() 444 if (buf[0] == '\t' && buf[1] == '\t' && isxdigit(buf[2])) { parse() 446 u = strtoul(buf+2, &cp, 16); parse() 468 if (buf[0] == 'H' && buf[1] == 'I' && parse() 469 buf[2] == 'D' && /*isspace(buf[3])*/ buf[3] == ' ') { parse() 472 if (buf[0] == 'H' && buf[1] == 'U' && parse() 473 buf[2] == 'T' && /*isspace(buf[3])*/ buf[3] == ' ') { parse() 482 if (buf[0] == 'R' && buf[1] == ' ') parse() 485 if (buf[0] == 'V' && buf[1] == 'T') parse()
|
/linux-4.4.14/drivers/net/wireless/iwlwifi/dvm/ |
H A D | debugfs.c | 100 char *buf; iwl_dbgfs_sram_read() local 131 buf = kmalloc(bufsz, GFP_KERNEL); iwl_dbgfs_sram_read() 132 if (!buf) iwl_dbgfs_sram_read() 135 pos += scnprintf(buf + pos, bufsz - pos, "sram_len: 0x%x\n", iwl_dbgfs_sram_read() 137 pos += scnprintf(buf + pos, bufsz - pos, "sram_offset: 0x%x\n", iwl_dbgfs_sram_read() 150 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_sram_read() 154 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_sram_read() 157 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_sram_read() 170 pos += scnprintf(buf + pos, bufsz - pos, "\n"); iwl_dbgfs_sram_read() 172 pos += scnprintf(buf + pos, bufsz - pos, " "); iwl_dbgfs_sram_read() 174 pos += scnprintf(buf + pos, bufsz - pos, " "); iwl_dbgfs_sram_read() 178 pos += scnprintf(buf + pos, bufsz - pos, "\n"); iwl_dbgfs_sram_read() 180 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); iwl_dbgfs_sram_read() 181 kfree(buf); iwl_dbgfs_sram_read() 190 char buf[64]; iwl_dbgfs_sram_write() local 194 memset(buf, 0, sizeof(buf)); iwl_dbgfs_sram_write() 195 buf_size = min(count, sizeof(buf) - 1); iwl_dbgfs_sram_write() 196 if (copy_from_user(buf, user_buf, buf_size)) iwl_dbgfs_sram_write() 199 if (sscanf(buf, "%x,%x", &offset, &len) == 2) { iwl_dbgfs_sram_write() 202 } else if (sscanf(buf, "%x", &offset) == 1) { iwl_dbgfs_sram_write() 233 char *buf; iwl_dbgfs_stations_read() local 239 buf = kmalloc(bufsz, GFP_KERNEL); iwl_dbgfs_stations_read() 240 if (!buf) iwl_dbgfs_stations_read() 243 pos += scnprintf(buf + pos, bufsz - pos, "num of stations: %d\n\n", iwl_dbgfs_stations_read() 250 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_stations_read() 254 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_stations_read() 260 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_stations_read() 270 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_stations_read() 272 pos += scnprintf(buf + pos, bufsz - pos, "\n"); iwl_dbgfs_stations_read() 275 pos += scnprintf(buf + pos, bufsz - pos, "\n"); iwl_dbgfs_stations_read() 278 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); iwl_dbgfs_stations_read() 279 kfree(buf); iwl_dbgfs_stations_read() 292 char *buf; iwl_dbgfs_nvm_read() local 305 buf = kzalloc(buf_size, GFP_KERNEL); iwl_dbgfs_nvm_read() 306 if (!buf) iwl_dbgfs_nvm_read() 310 pos += scnprintf(buf + pos, buf_size - pos, iwl_dbgfs_nvm_read() 313 pos += scnprintf(buf + pos, buf_size - pos, "0x%.4x %16ph\n", iwl_dbgfs_nvm_read() 317 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); iwl_dbgfs_nvm_read() 318 kfree(buf); iwl_dbgfs_nvm_read() 329 char *buf; iwl_dbgfs_channels_read() local 332 buf = kzalloc(bufsz, GFP_KERNEL); iwl_dbgfs_channels_read() 333 if (!buf) iwl_dbgfs_channels_read() 340 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_channels_read() 345 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_channels_read() 363 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_channels_read() 368 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_channels_read() 382 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); iwl_dbgfs_channels_read() 383 kfree(buf); iwl_dbgfs_channels_read() 392 char buf[512]; iwl_dbgfs_status_read() local 394 const size_t bufsz = sizeof(buf); iwl_dbgfs_status_read() 396 pos += scnprintf(buf + pos, bufsz - pos, "STATUS_RF_KILL_HW:\t %d\n", iwl_dbgfs_status_read() 398 pos += scnprintf(buf + pos, bufsz - pos, "STATUS_CT_KILL:\t\t %d\n", iwl_dbgfs_status_read() 400 pos += scnprintf(buf + pos, bufsz - pos, "STATUS_ALIVE:\t\t %d\n", iwl_dbgfs_status_read() 402 pos += scnprintf(buf + pos, bufsz - pos, "STATUS_READY:\t\t %d\n", iwl_dbgfs_status_read() 404 pos += scnprintf(buf + pos, bufsz - pos, "STATUS_EXIT_PENDING:\t %d\n", iwl_dbgfs_status_read() 406 pos += scnprintf(buf + pos, bufsz - pos, "STATUS_STATISTICS:\t %d\n", iwl_dbgfs_status_read() 408 pos += scnprintf(buf + pos, bufsz - pos, "STATUS_SCANNING:\t %d\n", iwl_dbgfs_status_read() 410 pos += scnprintf(buf + pos, bufsz - pos, "STATUS_SCAN_ABORTING:\t %d\n", iwl_dbgfs_status_read() 412 pos += scnprintf(buf + pos, bufsz - pos, "STATUS_SCAN_HW:\t\t %d\n", iwl_dbgfs_status_read() 414 pos += scnprintf(buf + pos, bufsz - pos, "STATUS_POWER_PMI:\t %d\n", iwl_dbgfs_status_read() 416 pos += scnprintf(buf + pos, bufsz - pos, "STATUS_FW_ERROR:\t %d\n", iwl_dbgfs_status_read() 418 return simple_read_from_buffer(user_buf, count, ppos, buf, pos); iwl_dbgfs_status_read() 429 char *buf; iwl_dbgfs_rx_handlers_read() local 433 buf = kzalloc(bufsz, GFP_KERNEL); iwl_dbgfs_rx_handlers_read() 434 if (!buf) iwl_dbgfs_rx_handlers_read() 439 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_rx_handlers_read() 445 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); iwl_dbgfs_rx_handlers_read() 446 kfree(buf); iwl_dbgfs_rx_handlers_read() 456 char buf[8]; iwl_dbgfs_rx_handlers_write() local 460 memset(buf, 0, sizeof(buf)); iwl_dbgfs_rx_handlers_write() 461 buf_size = min(count, sizeof(buf) - 1); iwl_dbgfs_rx_handlers_write() 462 if (copy_from_user(buf, user_buf, buf_size)) iwl_dbgfs_rx_handlers_write() 464 if (sscanf(buf, "%x", &reset_flag) != 1) iwl_dbgfs_rx_handlers_write() 479 char buf[256 * NUM_IWL_RXON_CTX]; iwl_dbgfs_qos_read() local 480 const size_t bufsz = sizeof(buf); iwl_dbgfs_qos_read() 483 pos += scnprintf(buf + pos, bufsz - pos, "context %d:\n", for_each_context() 486 pos += scnprintf(buf + pos, bufsz - pos, for_each_context() 488 pos += scnprintf(buf + pos, bufsz - pos, for_each_context() 495 pos += scnprintf(buf + pos, bufsz - pos, "\n"); for_each_context() 497 return simple_read_from_buffer(user_buf, count, ppos, buf, pos); 507 char buf[100]; iwl_dbgfs_thermal_throttling_read() local 509 const size_t bufsz = sizeof(buf); iwl_dbgfs_thermal_throttling_read() 511 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_thermal_throttling_read() 514 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_thermal_throttling_read() 519 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_thermal_throttling_read() 522 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_thermal_throttling_read() 525 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_thermal_throttling_read() 529 return simple_read_from_buffer(user_buf, count, ppos, buf, pos); iwl_dbgfs_thermal_throttling_read() 537 char buf[8]; iwl_dbgfs_disable_ht40_write() local 541 memset(buf, 0, sizeof(buf)); iwl_dbgfs_disable_ht40_write() 542 buf_size = min(count, sizeof(buf) - 1); iwl_dbgfs_disable_ht40_write() 543 if (copy_from_user(buf, user_buf, buf_size)) iwl_dbgfs_disable_ht40_write() 545 if (sscanf(buf, "%d", &ht40) != 1) iwl_dbgfs_disable_ht40_write() 560 char buf[100]; iwl_dbgfs_disable_ht40_read() local 562 const size_t bufsz = sizeof(buf); iwl_dbgfs_disable_ht40_read() 564 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_disable_ht40_read() 567 return simple_read_from_buffer(user_buf, count, ppos, buf, pos); iwl_dbgfs_disable_ht40_read() 575 char buf[8]; iwl_dbgfs_temperature_read() local 577 const size_t bufsz = sizeof(buf); iwl_dbgfs_temperature_read() 579 pos += scnprintf(buf + pos, bufsz - pos, "%d\n", priv->temperature); iwl_dbgfs_temperature_read() 580 return simple_read_from_buffer(user_buf, count, ppos, buf, pos); iwl_dbgfs_temperature_read() 589 char buf[8]; iwl_dbgfs_sleep_level_override_write() local 593 memset(buf, 0, sizeof(buf)); iwl_dbgfs_sleep_level_override_write() 594 buf_size = min(count, sizeof(buf) - 1); iwl_dbgfs_sleep_level_override_write() 595 if (copy_from_user(buf, user_buf, buf_size)) iwl_dbgfs_sleep_level_override_write() 598 if (sscanf(buf, "%d", &value) != 1) iwl_dbgfs_sleep_level_override_write() 631 char buf[10]; iwl_dbgfs_sleep_level_override_read() local 633 const size_t bufsz = sizeof(buf); iwl_dbgfs_sleep_level_override_read() 640 pos = scnprintf(buf, bufsz, "%d\n", value); iwl_dbgfs_sleep_level_override_read() 641 return simple_read_from_buffer(user_buf, count, ppos, buf, pos); iwl_dbgfs_sleep_level_override_read() 649 char buf[200]; iwl_dbgfs_current_sleep_command_read() local 651 const size_t bufsz = sizeof(buf); iwl_dbgfs_current_sleep_command_read() 654 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_current_sleep_command_read() 656 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_current_sleep_command_read() 661 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_current_sleep_command_read() 665 return simple_read_from_buffer(user_buf, count, ppos, buf, pos); iwl_dbgfs_current_sleep_command_read() 688 static int iwl_statistics_flag(struct iwl_priv *priv, char *buf, int bufsz) iwl_statistics_flag() argument 697 p += scnprintf(buf + p, bufsz - p, "Statistics Flag(0x%X):\n", flag); iwl_statistics_flag() 699 p += scnprintf(buf + p, bufsz - p, iwl_statistics_flag() 701 p += scnprintf(buf + p, bufsz - p, "\tOperational Frequency: %s\n", iwl_statistics_flag() 704 p += scnprintf(buf + p, bufsz - p, "\tTGj Narrow Band: %s\n", iwl_statistics_flag() 717 char *buf; iwl_dbgfs_ucode_rx_stats_read() local 731 buf = kzalloc(bufsz, GFP_KERNEL); iwl_dbgfs_ucode_rx_stats_read() 732 if (!buf) iwl_dbgfs_ucode_rx_stats_read() 758 pos += iwl_statistics_flag(priv, buf, bufsz); iwl_dbgfs_ucode_rx_stats_read() 759 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 761 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 766 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 770 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 774 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 778 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 783 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 789 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 794 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 800 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 806 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 811 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 816 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 822 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 828 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 833 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 838 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 844 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 850 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 856 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 863 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 865 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 869 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 873 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 877 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 881 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 886 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 892 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 896 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 901 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 907 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 912 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 917 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 922 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 928 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 933 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 938 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 944 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 949 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 954 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 961 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 963 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 968 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 973 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 979 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 985 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 991 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 997 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 1003 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 1009 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 1015 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 1021 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 1027 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 1033 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 1039 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 1045 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 1051 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 1057 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 1063 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 1069 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 1075 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 1081 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 1088 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 1090 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 1094 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 1098 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 1104 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 1108 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 1112 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 1117 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 1122 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 1127 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 1131 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_rx_stats_read() 1139 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); iwl_dbgfs_ucode_rx_stats_read() 1140 kfree(buf); iwl_dbgfs_ucode_rx_stats_read() 1150 char *buf; iwl_dbgfs_ucode_tx_stats_read() local 1158 buf = kzalloc(bufsz, GFP_KERNEL); iwl_dbgfs_ucode_tx_stats_read() 1159 if (!buf) iwl_dbgfs_ucode_tx_stats_read() 1173 pos += iwl_statistics_flag(priv, buf, bufsz); iwl_dbgfs_ucode_tx_stats_read() 1174 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_tx_stats_read() 1176 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_tx_stats_read() 1181 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_tx_stats_read() 1186 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_tx_stats_read() 1192 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_tx_stats_read() 1198 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_tx_stats_read() 1203 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_tx_stats_read() 1207 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_tx_stats_read() 1212 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_tx_stats_read() 1218 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_tx_stats_read() 1224 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_tx_stats_read() 1230 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_tx_stats_read() 1236 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_tx_stats_read() 1242 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_tx_stats_read() 1248 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_tx_stats_read() 1254 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_tx_stats_read() 1260 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_tx_stats_read() 1266 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_tx_stats_read() 1272 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_tx_stats_read() 1278 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_tx_stats_read() 1284 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_tx_stats_read() 1290 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_tx_stats_read() 1296 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_tx_stats_read() 1301 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_tx_stats_read() 1307 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_tx_stats_read() 1315 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_tx_stats_read() 1319 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_tx_stats_read() 1324 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_tx_stats_read() 1329 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_tx_stats_read() 1336 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); iwl_dbgfs_ucode_tx_stats_read() 1337 kfree(buf); iwl_dbgfs_ucode_tx_stats_read() 1347 char *buf; iwl_dbgfs_ucode_general_stats_read() local 1358 buf = kzalloc(bufsz, GFP_KERNEL); iwl_dbgfs_ucode_general_stats_read() 1359 if (!buf) iwl_dbgfs_ucode_general_stats_read() 1382 pos += iwl_statistics_flag(priv, buf, bufsz); iwl_dbgfs_ucode_general_stats_read() 1383 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_general_stats_read() 1385 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_general_stats_read() 1388 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_general_stats_read() 1391 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_general_stats_read() 1394 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_general_stats_read() 1399 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_general_stats_read() 1404 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_general_stats_read() 1410 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_general_stats_read() 1415 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_general_stats_read() 1420 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_general_stats_read() 1425 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_general_stats_read() 1429 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_general_stats_read() 1433 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_general_stats_read() 1437 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_general_stats_read() 1441 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_general_stats_read() 1447 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_general_stats_read() 1456 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); iwl_dbgfs_ucode_general_stats_read() 1457 kfree(buf); iwl_dbgfs_ucode_general_stats_read() 1467 char *buf; iwl_dbgfs_ucode_bt_stats_read() local 1485 buf = kzalloc(bufsz, GFP_KERNEL); iwl_dbgfs_ucode_bt_stats_read() 1486 if (!buf) iwl_dbgfs_ucode_bt_stats_read() 1500 pos += iwl_statistics_flag(priv, buf, bufsz); iwl_dbgfs_ucode_bt_stats_read() 1501 pos += scnprintf(buf + pos, bufsz - pos, "Statistics_BT:\n"); iwl_dbgfs_ucode_bt_stats_read() 1502 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_bt_stats_read() 1504 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_bt_stats_read() 1508 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_bt_stats_read() 1512 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_bt_stats_read() 1516 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_bt_stats_read() 1520 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_bt_stats_read() 1524 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_bt_stats_read() 1528 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_bt_stats_read() 1532 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_bt_stats_read() 1537 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_ucode_bt_stats_read() 1544 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); iwl_dbgfs_ucode_bt_stats_read() 1545 kfree(buf); iwl_dbgfs_ucode_bt_stats_read() 1555 char *buf; iwl_dbgfs_reply_tx_error_read() local 1563 buf = kzalloc(bufsz, GFP_KERNEL); iwl_dbgfs_reply_tx_error_read() 1564 if (!buf) iwl_dbgfs_reply_tx_error_read() 1567 pos += scnprintf(buf + pos, bufsz - pos, "Statistics_TX_Error:\n"); iwl_dbgfs_reply_tx_error_read() 1568 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t\t%u\n", iwl_dbgfs_reply_tx_error_read() 1571 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", iwl_dbgfs_reply_tx_error_read() 1574 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", iwl_dbgfs_reply_tx_error_read() 1577 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", iwl_dbgfs_reply_tx_error_read() 1580 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", iwl_dbgfs_reply_tx_error_read() 1583 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t%u\n", iwl_dbgfs_reply_tx_error_read() 1587 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", iwl_dbgfs_reply_tx_error_read() 1590 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", iwl_dbgfs_reply_tx_error_read() 1593 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", iwl_dbgfs_reply_tx_error_read() 1596 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", iwl_dbgfs_reply_tx_error_read() 1599 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", iwl_dbgfs_reply_tx_error_read() 1602 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", iwl_dbgfs_reply_tx_error_read() 1605 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", iwl_dbgfs_reply_tx_error_read() 1608 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", iwl_dbgfs_reply_tx_error_read() 1611 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", iwl_dbgfs_reply_tx_error_read() 1614 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", iwl_dbgfs_reply_tx_error_read() 1617 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", iwl_dbgfs_reply_tx_error_read() 1620 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", iwl_dbgfs_reply_tx_error_read() 1623 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", iwl_dbgfs_reply_tx_error_read() 1626 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t%u\n", iwl_dbgfs_reply_tx_error_read() 1630 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", iwl_dbgfs_reply_tx_error_read() 1633 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t%u\n", iwl_dbgfs_reply_tx_error_read() 1637 pos += scnprintf(buf + pos, bufsz - pos, "UNKNOWN:\t\t\t%u\n", iwl_dbgfs_reply_tx_error_read() 1640 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_reply_tx_error_read() 1643 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", iwl_dbgfs_reply_tx_error_read() 1646 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", iwl_dbgfs_reply_tx_error_read() 1649 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", iwl_dbgfs_reply_tx_error_read() 1652 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", iwl_dbgfs_reply_tx_error_read() 1655 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t%u\n", iwl_dbgfs_reply_tx_error_read() 1659 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t%u\n", iwl_dbgfs_reply_tx_error_read() 1663 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t%u\n", iwl_dbgfs_reply_tx_error_read() 1667 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", iwl_dbgfs_reply_tx_error_read() 1670 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t%u\n", iwl_dbgfs_reply_tx_error_read() 1674 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", iwl_dbgfs_reply_tx_error_read() 1677 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", iwl_dbgfs_reply_tx_error_read() 1680 pos += scnprintf(buf + pos, bufsz - pos, "%s:\t\t\t%u\n", iwl_dbgfs_reply_tx_error_read() 1683 pos += scnprintf(buf + pos, bufsz - pos, "UNKNOWN:\t\t\t%u\n", iwl_dbgfs_reply_tx_error_read() 1686 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); iwl_dbgfs_reply_tx_error_read() 1687 kfree(buf); iwl_dbgfs_reply_tx_error_read() 1698 char *buf; iwl_dbgfs_sensitivity_read() local 1704 buf = kzalloc(bufsz, GFP_KERNEL); iwl_dbgfs_sensitivity_read() 1705 if (!buf) iwl_dbgfs_sensitivity_read() 1708 pos += scnprintf(buf + pos, bufsz - pos, "auto_corr_ofdm:\t\t\t %u\n", iwl_dbgfs_sensitivity_read() 1710 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_sensitivity_read() 1713 pos += scnprintf(buf + pos, bufsz - pos, "auto_corr_ofdm_x1:\t\t %u\n", iwl_dbgfs_sensitivity_read() 1715 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_sensitivity_read() 1718 pos += scnprintf(buf + pos, bufsz - pos, "auto_corr_cck:\t\t\t %u\n", iwl_dbgfs_sensitivity_read() 1720 pos += scnprintf(buf + pos, bufsz - pos, "auto_corr_cck_mrc:\t\t %u\n", iwl_dbgfs_sensitivity_read() 1722 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_sensitivity_read() 1725 pos += scnprintf(buf + pos, bufsz - pos, "last_fa_cnt_ofdm:\t\t %u\n", iwl_dbgfs_sensitivity_read() 1727 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_sensitivity_read() 1730 pos += scnprintf(buf + pos, bufsz - pos, "last_fa_cnt_cck:\t\t %u\n", iwl_dbgfs_sensitivity_read() 1732 pos += scnprintf(buf + pos, bufsz - pos, "nrg_curr_state:\t\t\t %u\n", iwl_dbgfs_sensitivity_read() 1734 pos += scnprintf(buf + pos, bufsz - pos, "nrg_prev_state:\t\t\t %u\n", iwl_dbgfs_sensitivity_read() 1736 pos += scnprintf(buf + pos, bufsz - pos, "nrg_value:\t\t\t"); iwl_dbgfs_sensitivity_read() 1738 pos += scnprintf(buf + pos, bufsz - pos, " %u", iwl_dbgfs_sensitivity_read() 1741 pos += scnprintf(buf + pos, bufsz - pos, "\n"); iwl_dbgfs_sensitivity_read() 1742 pos += scnprintf(buf + pos, bufsz - pos, "nrg_silence_rssi:\t\t"); iwl_dbgfs_sensitivity_read() 1744 pos += scnprintf(buf + pos, bufsz - pos, " %u", iwl_dbgfs_sensitivity_read() 1747 pos += scnprintf(buf + pos, bufsz - pos, "\n"); iwl_dbgfs_sensitivity_read() 1748 pos += scnprintf(buf + pos, bufsz - pos, "nrg_silence_ref:\t\t %u\n", iwl_dbgfs_sensitivity_read() 1750 pos += scnprintf(buf + pos, bufsz - pos, "nrg_energy_idx:\t\t\t %u\n", iwl_dbgfs_sensitivity_read() 1752 pos += scnprintf(buf + pos, bufsz - pos, "nrg_silence_idx:\t\t %u\n", iwl_dbgfs_sensitivity_read() 1754 pos += scnprintf(buf + pos, bufsz - pos, "nrg_th_cck:\t\t\t %u\n", iwl_dbgfs_sensitivity_read() 1756 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_sensitivity_read() 1759 pos += scnprintf(buf + pos, bufsz - pos, "num_in_cck_no_fa:\t\t %u\n", iwl_dbgfs_sensitivity_read() 1761 pos += scnprintf(buf + pos, bufsz - pos, "nrg_th_ofdm:\t\t\t %u\n", iwl_dbgfs_sensitivity_read() 1764 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); iwl_dbgfs_sensitivity_read() 1765 kfree(buf); iwl_dbgfs_sensitivity_read() 1777 char *buf; iwl_dbgfs_chain_noise_read() local 1783 buf = kzalloc(bufsz, GFP_KERNEL); iwl_dbgfs_chain_noise_read() 1784 if (!buf) iwl_dbgfs_chain_noise_read() 1787 pos += scnprintf(buf + pos, bufsz - pos, "active_chains:\t\t\t %u\n", iwl_dbgfs_chain_noise_read() 1789 pos += scnprintf(buf + pos, bufsz - pos, "chain_noise_a:\t\t\t %u\n", iwl_dbgfs_chain_noise_read() 1791 pos += scnprintf(buf + pos, bufsz - pos, "chain_noise_b:\t\t\t %u\n", iwl_dbgfs_chain_noise_read() 1793 pos += scnprintf(buf + pos, bufsz - pos, "chain_noise_c:\t\t\t %u\n", iwl_dbgfs_chain_noise_read() 1795 pos += scnprintf(buf + pos, bufsz - pos, "chain_signal_a:\t\t\t %u\n", iwl_dbgfs_chain_noise_read() 1797 pos += scnprintf(buf + pos, bufsz - pos, "chain_signal_b:\t\t\t %u\n", iwl_dbgfs_chain_noise_read() 1799 pos += scnprintf(buf + pos, bufsz - pos, "chain_signal_c:\t\t\t %u\n", iwl_dbgfs_chain_noise_read() 1801 pos += scnprintf(buf + pos, bufsz - pos, "beacon_count:\t\t\t %u\n", iwl_dbgfs_chain_noise_read() 1804 pos += scnprintf(buf + pos, bufsz - pos, "disconn_array:\t\t\t"); iwl_dbgfs_chain_noise_read() 1806 pos += scnprintf(buf + pos, bufsz - pos, " %u", iwl_dbgfs_chain_noise_read() 1809 pos += scnprintf(buf + pos, bufsz - pos, "\n"); iwl_dbgfs_chain_noise_read() 1810 pos += scnprintf(buf + pos, bufsz - pos, "delta_gain_code:\t\t"); iwl_dbgfs_chain_noise_read() 1812 pos += scnprintf(buf + pos, bufsz - pos, " %u", iwl_dbgfs_chain_noise_read() 1815 pos += scnprintf(buf + pos, bufsz - pos, "\n"); iwl_dbgfs_chain_noise_read() 1816 pos += scnprintf(buf + pos, bufsz - pos, "radio_write:\t\t\t %u\n", iwl_dbgfs_chain_noise_read() 1818 pos += scnprintf(buf + pos, bufsz - pos, "state:\t\t\t\t %u\n", iwl_dbgfs_chain_noise_read() 1821 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); iwl_dbgfs_chain_noise_read() 1822 kfree(buf); iwl_dbgfs_chain_noise_read() 1831 char buf[60]; iwl_dbgfs_power_save_status_read() local 1833 const size_t bufsz = sizeof(buf); iwl_dbgfs_power_save_status_read() 1839 pos += scnprintf(buf + pos, bufsz - pos, "Power Save Status: "); iwl_dbgfs_power_save_status_read() 1840 pos += scnprintf(buf + pos, bufsz - pos, "%s\n", iwl_dbgfs_power_save_status_read() 1846 return simple_read_from_buffer(user_buf, count, ppos, buf, pos); iwl_dbgfs_power_save_status_read() 1854 char buf[8]; iwl_dbgfs_clear_ucode_statistics_write() local 1858 memset(buf, 0, sizeof(buf)); iwl_dbgfs_clear_ucode_statistics_write() 1859 buf_size = min(count, sizeof(buf) - 1); iwl_dbgfs_clear_ucode_statistics_write() 1860 if (copy_from_user(buf, user_buf, buf_size)) iwl_dbgfs_clear_ucode_statistics_write() 1862 if (sscanf(buf, "%d", &clear) != 1) iwl_dbgfs_clear_ucode_statistics_write() 1879 char buf[128]; iwl_dbgfs_ucode_tracing_read() local 1880 const size_t bufsz = sizeof(buf); iwl_dbgfs_ucode_tracing_read() 1882 pos += scnprintf(buf + pos, bufsz - pos, "ucode trace timer is %s\n", iwl_dbgfs_ucode_tracing_read() 1884 pos += scnprintf(buf + pos, bufsz - pos, "non_wraps_count:\t\t %u\n", iwl_dbgfs_ucode_tracing_read() 1886 pos += scnprintf(buf + pos, bufsz - pos, "wraps_once_count:\t\t %u\n", iwl_dbgfs_ucode_tracing_read() 1888 pos += scnprintf(buf + pos, bufsz - pos, "wraps_more_count:\t\t %u\n", iwl_dbgfs_ucode_tracing_read() 1891 return simple_read_from_buffer(user_buf, count, ppos, buf, pos); iwl_dbgfs_ucode_tracing_read() 1899 char buf[8]; iwl_dbgfs_ucode_tracing_write() local 1903 memset(buf, 0, sizeof(buf)); iwl_dbgfs_ucode_tracing_write() 1904 buf_size = min(count, sizeof(buf) - 1); iwl_dbgfs_ucode_tracing_write() 1905 if (copy_from_user(buf, user_buf, buf_size)) iwl_dbgfs_ucode_tracing_write() 1907 if (sscanf(buf, "%d", &trace) != 1) iwl_dbgfs_ucode_tracing_write() 1930 char buf[20]; iwl_dbgfs_rxon_flags_read() local 1932 len = sprintf(buf, "0x%04X\n", iwl_dbgfs_rxon_flags_read() 1934 return simple_read_from_buffer(user_buf, count, ppos, buf, len); iwl_dbgfs_rxon_flags_read() 1943 char buf[20]; iwl_dbgfs_rxon_filter_flags_read() local 1945 len = sprintf(buf, "0x%04X\n", iwl_dbgfs_rxon_filter_flags_read() 1947 return simple_read_from_buffer(user_buf, count, ppos, buf, len); iwl_dbgfs_rxon_filter_flags_read() 1956 char buf[12]; iwl_dbgfs_missed_beacon_read() local 1957 const size_t bufsz = sizeof(buf); iwl_dbgfs_missed_beacon_read() 1959 pos += scnprintf(buf + pos, bufsz - pos, "%d\n", iwl_dbgfs_missed_beacon_read() 1962 return simple_read_from_buffer(user_buf, count, ppos, buf, pos); iwl_dbgfs_missed_beacon_read() 1970 char buf[8]; iwl_dbgfs_missed_beacon_write() local 1974 memset(buf, 0, sizeof(buf)); iwl_dbgfs_missed_beacon_write() 1975 buf_size = min(count, sizeof(buf) - 1); iwl_dbgfs_missed_beacon_write() 1976 if (copy_from_user(buf, user_buf, buf_size)) iwl_dbgfs_missed_beacon_write() 1978 if (sscanf(buf, "%d", &missed) != 1) iwl_dbgfs_missed_beacon_write() 1997 char buf[12]; iwl_dbgfs_plcp_delta_read() local 1998 const size_t bufsz = sizeof(buf); iwl_dbgfs_plcp_delta_read() 2000 pos += scnprintf(buf + pos, bufsz - pos, "%u\n", iwl_dbgfs_plcp_delta_read() 2003 return simple_read_from_buffer(user_buf, count, ppos, buf, pos); iwl_dbgfs_plcp_delta_read() 2011 char buf[8]; iwl_dbgfs_plcp_delta_write() local 2015 memset(buf, 0, sizeof(buf)); iwl_dbgfs_plcp_delta_write() 2016 buf_size = min(count, sizeof(buf) - 1); iwl_dbgfs_plcp_delta_write() 2017 if (copy_from_user(buf, user_buf, buf_size)) iwl_dbgfs_plcp_delta_write() 2019 if (sscanf(buf, "%d", &plcp) != 1) iwl_dbgfs_plcp_delta_write() 2036 char buf[300]; iwl_dbgfs_rf_reset_read() local 2037 const size_t bufsz = sizeof(buf); iwl_dbgfs_rf_reset_read() 2040 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_rf_reset_read() 2042 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_rf_reset_read() 2045 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_rf_reset_read() 2048 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_rf_reset_read() 2052 return simple_read_from_buffer(user_buf, count, ppos, buf, pos); iwl_dbgfs_rf_reset_read() 2071 char buf[8]; iwl_dbgfs_txfifo_flush_write() local 2075 memset(buf, 0, sizeof(buf)); iwl_dbgfs_txfifo_flush_write() 2076 buf_size = min(count, sizeof(buf) - 1); iwl_dbgfs_txfifo_flush_write() 2077 if (copy_from_user(buf, user_buf, buf_size)) iwl_dbgfs_txfifo_flush_write() 2079 if (sscanf(buf, "%d", &flush) != 1) iwl_dbgfs_txfifo_flush_write() 2096 char buf[200]; iwl_dbgfs_bt_traffic_read() local 2097 const size_t bufsz = sizeof(buf); iwl_dbgfs_bt_traffic_read() 2100 pos += scnprintf(buf + pos, bufsz - pos, "BT coex disabled\n"); iwl_dbgfs_bt_traffic_read() 2101 return simple_read_from_buffer(user_buf, count, ppos, buf, pos); iwl_dbgfs_bt_traffic_read() 2103 pos += scnprintf(buf + pos, bufsz - pos, "BT enable flag: 0x%x\n", iwl_dbgfs_bt_traffic_read() 2105 pos += scnprintf(buf + pos, bufsz - pos, "BT in %s mode\n", iwl_dbgfs_bt_traffic_read() 2107 pos += scnprintf(buf + pos, bufsz - pos, "BT status: %s, " iwl_dbgfs_bt_traffic_read() 2110 pos += scnprintf(buf + pos, bufsz - pos, "ch_announcement: %d, " iwl_dbgfs_bt_traffic_read() 2115 pos += scnprintf(buf + pos, bufsz - pos, "bluetooth traffic load: "); iwl_dbgfs_bt_traffic_read() 2118 pos += scnprintf(buf + pos, bufsz - pos, "Continuous\n"); iwl_dbgfs_bt_traffic_read() 2121 pos += scnprintf(buf + pos, bufsz - pos, "High\n"); iwl_dbgfs_bt_traffic_read() 2124 pos += scnprintf(buf + pos, bufsz - pos, "Low\n"); iwl_dbgfs_bt_traffic_read() 2128 pos += scnprintf(buf + pos, bufsz - pos, "None\n"); iwl_dbgfs_bt_traffic_read() 2132 return simple_read_from_buffer(user_buf, count, ppos, buf, pos); iwl_dbgfs_bt_traffic_read() 2142 char buf[40]; iwl_dbgfs_protection_mode_read() local 2143 const size_t bufsz = sizeof(buf); iwl_dbgfs_protection_mode_read() 2146 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_protection_mode_read() 2151 pos += scnprintf(buf + pos, bufsz - pos, "N/A"); iwl_dbgfs_protection_mode_read() 2153 return simple_read_from_buffer(user_buf, count, ppos, buf, pos); iwl_dbgfs_protection_mode_read() 2161 char buf[8]; iwl_dbgfs_protection_mode_write() local 2168 memset(buf, 0, sizeof(buf)); iwl_dbgfs_protection_mode_write() 2169 buf_size = min(count, sizeof(buf) - 1); iwl_dbgfs_protection_mode_write() 2170 if (copy_from_user(buf, user_buf, buf_size)) iwl_dbgfs_protection_mode_write() 2172 if (sscanf(buf, "%d", &rts) != 1) iwl_dbgfs_protection_mode_write() 2202 char buf[8]; iwl_dbgfs_echo_test_write() local 2205 memset(buf, 0, sizeof(buf)); iwl_dbgfs_echo_test_write() 2206 buf_size = min(count, sizeof(buf) - 1); iwl_dbgfs_echo_test_write() 2207 if (copy_from_user(buf, user_buf, buf_size)) iwl_dbgfs_echo_test_write() 2220 char *buf = NULL; iwl_dbgfs_log_event_read() local 2223 ret = iwl_dump_nic_event_log(priv, true, &buf); iwl_dbgfs_log_event_read() 2225 ret = simple_read_from_buffer(user_buf, count, ppos, buf, ret); iwl_dbgfs_log_event_read() 2226 kfree(buf); iwl_dbgfs_log_event_read() 2236 char buf[8]; iwl_dbgfs_log_event_write() local 2243 memset(buf, 0, sizeof(buf)); iwl_dbgfs_log_event_write() 2244 buf_size = min(count, sizeof(buf) - 1); iwl_dbgfs_log_event_write() 2245 if (copy_from_user(buf, user_buf, buf_size)) iwl_dbgfs_log_event_write() 2247 if (sscanf(buf, "%d", &event_log_flag) != 1) iwl_dbgfs_log_event_write() 2261 char buf[120]; iwl_dbgfs_calib_disabled_read() local 2263 const size_t bufsz = sizeof(buf); iwl_dbgfs_calib_disabled_read() 2265 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_calib_disabled_read() 2270 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_calib_disabled_read() 2275 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_calib_disabled_read() 2281 return simple_read_from_buffer(user_buf, count, ppos, buf, pos); iwl_dbgfs_calib_disabled_read() 2289 char buf[8]; iwl_dbgfs_calib_disabled_write() local 2293 memset(buf, 0, sizeof(buf)); iwl_dbgfs_calib_disabled_write() 2294 buf_size = min(count, sizeof(buf) - 1); iwl_dbgfs_calib_disabled_write() 2295 if (copy_from_user(buf, user_buf, buf_size)) iwl_dbgfs_calib_disabled_write() 2297 if (sscanf(buf, "%x", &calib_disabled) != 1) iwl_dbgfs_calib_disabled_write() 2422 char buf[100]; iwl_dbgfs_register() local 2429 snprintf(buf, 100, "../../%s/%s", root_dir->d_name.name, iwl_dbgfs_register() 2432 if (!debugfs_create_symlink("iwlwifi", mac80211_dir, buf)) iwl_dbgfs_register()
|
/linux-4.4.14/drivers/media/usb/uvc/ |
H A D | uvc_isight.c | 39 static int isight_decode(struct uvc_video_queue *queue, struct uvc_buffer *buf, isight_decode() argument 52 if (buf == NULL) isight_decode() 62 if (buf->state != UVC_BUF_STATE_ACTIVE) { isight_decode() 69 buf->state = UVC_BUF_STATE_ACTIVE; isight_decode() 77 if (is_header && buf->bytesused != 0) { isight_decode() 78 buf->state = UVC_BUF_STATE_DONE; isight_decode() 86 maxlen = buf->length - buf->bytesused; isight_decode() 87 mem = buf->mem + buf->bytesused; isight_decode() 90 buf->bytesused += nbytes; isight_decode() 92 if (len > maxlen || buf->bytesused == buf->length) { isight_decode() 95 buf->state = UVC_BUF_STATE_DONE; isight_decode() 103 struct uvc_buffer *buf) uvc_video_decode_isight() 123 ret = isight_decode(&stream->queue, buf, uvc_video_decode_isight() 128 if (buf == NULL) uvc_video_decode_isight() 131 if (buf->state == UVC_BUF_STATE_DONE || uvc_video_decode_isight() 132 buf->state == UVC_BUF_STATE_ERROR) uvc_video_decode_isight() 133 buf = uvc_queue_next_buffer(&stream->queue, uvc_video_decode_isight() 134 buf); uvc_video_decode_isight() 102 uvc_video_decode_isight(struct urb *urb, struct uvc_streaming *stream, struct uvc_buffer *buf) uvc_video_decode_isight() argument
|
H A D | uvc_debugfs.c | 35 struct uvc_debugfs_buffer *buf; uvc_debugfs_stats_open() local 37 buf = kmalloc(sizeof(*buf), GFP_KERNEL); uvc_debugfs_stats_open() 38 if (buf == NULL) uvc_debugfs_stats_open() 41 buf->count = uvc_video_stats_dump(stream, buf->data, sizeof(buf->data)); uvc_debugfs_stats_open() 43 file->private_data = buf; uvc_debugfs_stats_open() 50 struct uvc_debugfs_buffer *buf = file->private_data; uvc_debugfs_stats_read() local 52 return simple_read_from_buffer(user_buf, nbytes, ppos, buf->data, uvc_debugfs_stats_read() 53 buf->count); uvc_debugfs_stats_read()
|
H A D | uvc_queue.c | 59 struct uvc_buffer *buf = list_first_entry(&queue->irqqueue, uvc_queue_return_buffers() local 62 list_del(&buf->queue); uvc_queue_return_buffers() 63 buf->state = state; uvc_queue_return_buffers() 64 vb2_buffer_done(&buf->buf.vb2_buf, vb2_state); uvc_queue_return_buffers() 96 struct uvc_buffer *buf = container_of(vbuf, struct uvc_buffer, buf); uvc_buffer_prepare() local 107 buf->state = UVC_BUF_STATE_QUEUED; uvc_buffer_prepare() 108 buf->error = 0; uvc_buffer_prepare() 109 buf->mem = vb2_plane_vaddr(vb, 0); uvc_buffer_prepare() 110 buf->length = vb2_plane_size(vb, 0); uvc_buffer_prepare() 112 buf->bytesused = 0; uvc_buffer_prepare() 114 buf->bytesused = vb2_get_plane_payload(vb, 0); uvc_buffer_prepare() 123 struct uvc_buffer *buf = container_of(vbuf, struct uvc_buffer, buf); uvc_buffer_queue() local 128 list_add_tail(&buf->queue, &queue->irqqueue); uvc_buffer_queue() 133 buf->state = UVC_BUF_STATE_ERROR; uvc_buffer_queue() 145 struct uvc_buffer *buf = container_of(vbuf, struct uvc_buffer, buf); uvc_buffer_finish() local 148 uvc_video_clock_update(stream, vbuf, buf); uvc_buffer_finish() 244 int uvc_query_buffer(struct uvc_video_queue *queue, struct v4l2_buffer *buf) uvc_query_buffer() argument 249 ret = vb2_querybuf(&queue->queue, buf); uvc_query_buffer() 267 int uvc_queue_buffer(struct uvc_video_queue *queue, struct v4l2_buffer *buf) uvc_queue_buffer() argument 272 ret = vb2_qbuf(&queue->queue, buf); uvc_queue_buffer() 290 int uvc_dequeue_buffer(struct uvc_video_queue *queue, struct v4l2_buffer *buf, uvc_dequeue_buffer() argument 296 ret = vb2_dqbuf(&queue->queue, buf, nonblocking); uvc_dequeue_buffer() 397 struct uvc_buffer *buf) uvc_queue_next_buffer() 402 if ((queue->flags & UVC_QUEUE_DROP_CORRUPTED) && buf->error) { uvc_queue_next_buffer() 403 buf->error = 0; uvc_queue_next_buffer() 404 buf->state = UVC_BUF_STATE_QUEUED; uvc_queue_next_buffer() 405 buf->bytesused = 0; uvc_queue_next_buffer() 406 vb2_set_plane_payload(&buf->buf.vb2_buf, 0, 0); uvc_queue_next_buffer() 407 return buf; uvc_queue_next_buffer() 411 list_del(&buf->queue); uvc_queue_next_buffer() 419 buf->state = buf->error ? VB2_BUF_STATE_ERROR : UVC_BUF_STATE_DONE; uvc_queue_next_buffer() 420 vb2_set_plane_payload(&buf->buf.vb2_buf, 0, buf->bytesused); uvc_queue_next_buffer() 421 vb2_buffer_done(&buf->buf.vb2_buf, VB2_BUF_STATE_DONE); uvc_queue_next_buffer() 396 uvc_queue_next_buffer(struct uvc_video_queue *queue, struct uvc_buffer *buf) uvc_queue_next_buffer() argument
|
/linux-4.4.14/drivers/staging/wilc1000/ |
H A D | wilc_wlan_cfg.c | 166 u8 *buf; wilc_wlan_cfg_set_byte() local 171 buf = &frame[offset]; wilc_wlan_cfg_set_byte() 173 buf[0] = (u8)id; wilc_wlan_cfg_set_byte() 174 buf[1] = (u8)(id >> 8); wilc_wlan_cfg_set_byte() 175 buf[2] = 1; wilc_wlan_cfg_set_byte() 176 buf[3] = val8; wilc_wlan_cfg_set_byte() 182 u8 *buf; wilc_wlan_cfg_set_hword() local 187 buf = &frame[offset]; wilc_wlan_cfg_set_hword() 189 buf[0] = (u8)id; wilc_wlan_cfg_set_hword() 190 buf[1] = (u8)(id >> 8); wilc_wlan_cfg_set_hword() 191 buf[2] = 2; wilc_wlan_cfg_set_hword() 192 buf[3] = (u8)val16; wilc_wlan_cfg_set_hword() 193 buf[4] = (u8)(val16 >> 8); wilc_wlan_cfg_set_hword() 200 u8 *buf; wilc_wlan_cfg_set_word() local 205 buf = &frame[offset]; wilc_wlan_cfg_set_word() 207 buf[0] = (u8)id; wilc_wlan_cfg_set_word() 208 buf[1] = (u8)(id >> 8); wilc_wlan_cfg_set_word() 209 buf[2] = 4; wilc_wlan_cfg_set_word() 210 buf[3] = (u8)val32; wilc_wlan_cfg_set_word() 211 buf[4] = (u8)(val32 >> 8); wilc_wlan_cfg_set_word() 212 buf[5] = (u8)(val32 >> 16); wilc_wlan_cfg_set_word() 213 buf[6] = (u8)(val32 >> 24); wilc_wlan_cfg_set_word() 220 u8 *buf; wilc_wlan_cfg_set_str() local 225 buf = &frame[offset]; wilc_wlan_cfg_set_str() 227 buf[0] = (u8)id; wilc_wlan_cfg_set_str() 228 buf[1] = (u8)(id >> 8); wilc_wlan_cfg_set_str() 229 buf[2] = (u8)size; wilc_wlan_cfg_set_str() 232 memcpy(&buf[3], str, size); wilc_wlan_cfg_set_str() 239 u8 *buf; wilc_wlan_cfg_set_bin() local 246 buf = &frame[offset]; wilc_wlan_cfg_set_bin() 247 buf[0] = (u8)id; wilc_wlan_cfg_set_bin() 248 buf[1] = (u8)(id >> 8); wilc_wlan_cfg_set_bin() 249 buf[2] = (u8)size; wilc_wlan_cfg_set_bin() 250 buf[3] = (u8)(size >> 8); wilc_wlan_cfg_set_bin() 253 memcpy(&buf[4], b, size); wilc_wlan_cfg_set_bin() 255 checksum += buf[i + 4]; wilc_wlan_cfg_set_bin() 259 buf[size + 4] = checksum; wilc_wlan_cfg_set_bin() 389 int wilc_wlan_cfg_set_wid(u8 *frame, u32 offset, u16 id, u8 *buf, int size) wilc_wlan_cfg_set_wid() argument 396 ret = wilc_wlan_cfg_set_byte(frame, offset, id, *buf); wilc_wlan_cfg_set_wid() 399 ret = wilc_wlan_cfg_set_hword(frame, offset, id, *((u16 *)buf)); wilc_wlan_cfg_set_wid() 402 ret = wilc_wlan_cfg_set_word(frame, offset, id, *((u32 *)buf)); wilc_wlan_cfg_set_wid() 404 ret = wilc_wlan_cfg_set_str(frame, offset, id, buf, size); wilc_wlan_cfg_set_wid() 406 ret = wilc_wlan_cfg_set_bin(frame, offset, id, buf, size); wilc_wlan_cfg_set_wid() 416 u8 *buf; wilc_wlan_cfg_get_wid() local 421 buf = &frame[offset]; wilc_wlan_cfg_get_wid() 423 buf[0] = (u8)id; wilc_wlan_cfg_get_wid() 424 buf[1] = (u8)(id >> 8); wilc_wlan_cfg_get_wid()
|
/linux-4.4.14/drivers/input/joystick/ |
H A D | walkera0701.c | 52 unsigned char buf[25]; member in struct:walkera_dev 74 crc1 += w->buf[i] & 7; walkera0701_parse_frame() 75 crc2 += (w->buf[i] & 8) >> 3; walkera0701_parse_frame() 77 if ((w->buf[10] & 7) != (crc1 & 7)) walkera0701_parse_frame() 79 if (((w->buf[10] & 8) >> 3) != (((crc1 >> 3) + crc2) & 1)) walkera0701_parse_frame() 82 crc1 += w->buf[i] & 7; walkera0701_parse_frame() 83 crc2 += (w->buf[i] & 8) >> 3; walkera0701_parse_frame() 85 if ((w->buf[23] & 7) != (crc1 & 7)) walkera0701_parse_frame() 87 if (((w->buf[23] & 8) >> 3) != (((crc1 >> 3) + crc2) & 1)) walkera0701_parse_frame() 89 val1 = ((w->buf[0] & 7) * 256 + w->buf[1] * 16 + w->buf[2]) >> 2; walkera0701_parse_frame() 90 val1 *= ((w->buf[0] >> 2) & 2) - 1; /* sign */ walkera0701_parse_frame() 91 val2 = (w->buf[2] & 1) << 8 | (w->buf[3] << 4) | w->buf[4]; walkera0701_parse_frame() 92 val2 *= (w->buf[2] & 2) - 1; /* sign */ walkera0701_parse_frame() 93 val3 = ((w->buf[5] & 7) * 256 + w->buf[6] * 16 + w->buf[7]) >> 2; walkera0701_parse_frame() 94 val3 *= ((w->buf[5] >> 2) & 2) - 1; /* sign */ walkera0701_parse_frame() 95 val4 = (w->buf[7] & 1) << 8 | (w->buf[8] << 4) | w->buf[9]; walkera0701_parse_frame() 96 val4 *= (w->buf[7] & 2) - 1; /* sign */ walkera0701_parse_frame() 97 val5 = ((w->buf[11] & 7) * 256 + w->buf[12] * 16 + w->buf[13]) >> 2; walkera0701_parse_frame() 98 val5 *= ((w->buf[11] >> 2) & 2) - 1; /* sign */ walkera0701_parse_frame() 99 val6 = (w->buf[13] & 1) << 8 | (w->buf[14] << 4) | w->buf[15]; walkera0701_parse_frame() 100 val6 *= (w->buf[13] & 2) - 1; /* sign */ walkera0701_parse_frame() 101 val7 = ((w->buf[16] & 7) * 256 + w->buf[17] * 16 + w->buf[18]) >> 2; walkera0701_parse_frame() 102 val7 *= ((w->buf[16] >> 2) & 2) - 1; /*sign */ walkera0701_parse_frame() 103 val8 = (w->buf[18] & 1) << 8 | (w->buf[19] << 4) | w->buf[20]; walkera0701_parse_frame() 104 val8 *= (w->buf[18] & 2) - 1; /*sign */ walkera0701_parse_frame() 106 magic = (w->buf[21] << 4) | w->buf[22]; walkera0701_parse_frame() 107 magic_bit = (w->buf[24] & 8) >> 3; walkera0701_parse_frame() 145 w->buf[w->counter] = 8; walkera0701_irq_handler() 148 w->buf[w->counter] = 0; walkera0701_irq_handler() 160 w->buf[w->counter++] |= (pulse_time & 7); walkera0701_irq_handler()
|
/linux-4.4.14/net/sunrpc/ |
H A D | xdr.c | 116 * @buf: XDR buffer where string resides 121 xdr_terminate_string(struct xdr_buf *buf, const u32 len) xdr_terminate_string() argument 125 kaddr = kmap_atomic(buf->pages[0]); xdr_terminate_string() 126 kaddr[buf->page_base + len] = '\0'; xdr_terminate_string() 137 char *buf = (char *)head->iov_base; xdr_inline_pages() local 146 tail->iov_base = buf + offset; xdr_inline_pages() 308 * @buf: xdr_buf 309 * @len: bytes to remove from buf->head[0] 311 * Shrinks XDR buffer's header kvec buf->head[0] by 316 xdr_shrink_bufhead(struct xdr_buf *buf, size_t len) xdr_shrink_bufhead() argument 320 unsigned int pglen = buf->page_len; xdr_shrink_bufhead() 322 tail = buf->tail; xdr_shrink_bufhead() 323 head = buf->head; xdr_shrink_bufhead() 347 buf->pages, xdr_shrink_bufhead() 348 buf->page_base + pglen + offs - len, xdr_shrink_bufhead() 364 _shift_data_right_pages(buf->pages, xdr_shrink_bufhead() 365 buf->page_base + len, xdr_shrink_bufhead() 366 buf->page_base, xdr_shrink_bufhead() 371 _copy_to_pages(buf->pages, buf->page_base, xdr_shrink_bufhead() 376 buf->buflen -= len; xdr_shrink_bufhead() 378 if (buf->len > buf->buflen) xdr_shrink_bufhead() 379 buf->len = buf->buflen; xdr_shrink_bufhead() 384 * @buf: xdr_buf 385 * @len: bytes to remove from buf->pages 387 * Shrinks XDR buffer's page array buf->pages by 392 xdr_shrink_pagelen(struct xdr_buf *buf, size_t len) xdr_shrink_pagelen() argument 396 unsigned int pglen = buf->page_len; xdr_shrink_pagelen() 399 tail = buf->tail; xdr_shrink_pagelen() 402 tailbuf_len = buf->buflen - buf->head->iov_len - buf->page_len; xdr_shrink_pagelen() 420 buf->pages, buf->page_base + pglen - len, xdr_shrink_pagelen() 423 buf->page_len -= len; xdr_shrink_pagelen() 424 buf->buflen -= len; xdr_shrink_pagelen() 426 if (buf->len > buf->buflen) xdr_shrink_pagelen() 427 buf->len = buf->buflen; xdr_shrink_pagelen() 431 xdr_shift_buf(struct xdr_buf *buf, size_t len) xdr_shift_buf() argument 433 xdr_shrink_bufhead(buf, len); xdr_shift_buf() 443 return (unsigned int)(XDR_QUADLEN(xdr->buf->len) - xdr->nwords) << 2; xdr_stream_pos() 450 * @buf: pointer to XDR buffer in which to encode data 460 void xdr_init_encode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32 *p) xdr_init_encode() argument 462 struct kvec *iov = buf->head; xdr_init_encode() 463 int scratch_len = buf->buflen - buf->page_len - buf->tail[0].iov_len; xdr_init_encode() 467 xdr->buf = buf; xdr_init_encode() 479 buf->len += len; xdr_init_encode() 521 if (xdr->buf->len + nbytes > xdr->buf->buflen) xdr_get_next_encode_buffer() 528 xdr->buf->page_len += frag1bytes; xdr_get_next_encode_buffer() 546 space_left = xdr->buf->buflen - xdr->buf->len; xdr_get_next_encode_buffer() 548 xdr->buf->page_len += frag2bytes; xdr_get_next_encode_buffer() 549 xdr->buf->len += nbytes; xdr_get_next_encode_buffer() 578 xdr->buf->page_len += nbytes; xdr_reserve_space() 579 xdr->buf->len += nbytes; xdr_reserve_space() 589 * Truncates the xdr stream, so that xdr->buf->len == len, 605 struct xdr_buf *buf = xdr->buf; xdr_truncate_encode() local 606 struct kvec *head = buf->head; xdr_truncate_encode() 607 struct kvec *tail = buf->tail; xdr_truncate_encode() 611 if (len > buf->len) { xdr_truncate_encode() 617 fraglen = min_t(int, buf->len - len, tail->iov_len); xdr_truncate_encode() 619 buf->len -= fraglen; xdr_truncate_encode() 627 fraglen = min_t(int, buf->len - len, buf->page_len); xdr_truncate_encode() 628 buf->page_len -= fraglen; xdr_truncate_encode() 629 buf->len -= fraglen; xdr_truncate_encode() 631 new = buf->page_base + buf->page_len; xdr_truncate_encode() 633 xdr->page_ptr = buf->pages + (new >> PAGE_SHIFT); xdr_truncate_encode() 635 if (buf->page_len) { xdr_truncate_encode() 648 buf->len = len; xdr_truncate_encode() 650 xdr->iov = buf->head; xdr_truncate_encode() 662 * and does nothing. Otherwise, adjusts xdr->buf->buflen to newbuflen 668 struct xdr_buf *buf = xdr->buf; xdr_restrict_buflen() local 670 int end_offset = buf->len + left_in_this_buf; xdr_restrict_buflen() 672 if (newbuflen < 0 || newbuflen < buf->len) xdr_restrict_buflen() 674 if (newbuflen > buf->buflen) xdr_restrict_buflen() 678 buf->buflen = newbuflen; xdr_restrict_buflen() 694 struct xdr_buf *buf = xdr->buf; xdr_write_pages() local 695 struct kvec *iov = buf->tail; xdr_write_pages() 696 buf->pages = pages; xdr_write_pages() 697 buf->page_base = base; xdr_write_pages() 698 buf->page_len = len; xdr_write_pages() 713 buf->buflen += len; xdr_write_pages() 714 buf->len += len; xdr_write_pages() 738 maxlen = xdr->buf->page_len; xdr_set_page_base() 745 base += xdr->buf->page_base; xdr_set_page_base() 748 xdr->page_ptr = &xdr->buf->pages[pgnr]; xdr_set_page_base() 766 newbase = (1 + xdr->page_ptr - xdr->buf->pages) << PAGE_SHIFT; xdr_set_next_page() 767 newbase -= xdr->buf->page_base; xdr_set_next_page() 770 xdr_set_iov(xdr, xdr->buf->tail, xdr->buf->len); xdr_set_next_page() 777 else if (xdr->iov == xdr->buf->head) { xdr_set_next_buffer() 779 xdr_set_iov(xdr, xdr->buf->tail, xdr->buf->len); xdr_set_next_buffer() 787 * @buf: pointer to XDR buffer from which to decode data 790 void xdr_init_decode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32 *p) xdr_init_decode() argument 792 xdr->buf = buf; xdr_init_decode() 795 xdr->nwords = XDR_QUADLEN(buf->len); xdr_init_decode() 796 if (buf->head[0].iov_len != 0) xdr_init_decode() 797 xdr_set_iov(xdr, buf->head, buf->len); xdr_init_decode() 798 else if (buf->page_len != 0) xdr_init_decode() 799 xdr_set_page_base(xdr, 0, buf->len); xdr_init_decode() 810 * @buf: pointer to XDR buffer from which to decode data 814 void xdr_init_decode_pages(struct xdr_stream *xdr, struct xdr_buf *buf, xdr_init_decode_pages() argument 817 memset(buf, 0, sizeof(*buf)); xdr_init_decode_pages() 818 buf->pages = pages; xdr_init_decode_pages() 819 buf->page_len = len; xdr_init_decode_pages() 820 buf->buflen = len; xdr_init_decode_pages() 821 buf->len = len; xdr_init_decode_pages() 822 xdr_init_decode(xdr, buf, NULL); xdr_init_decode_pages() 842 * @buf: pointer to an empty buffer 843 * @buflen: size of 'buf' 850 void xdr_set_scratch_buffer(struct xdr_stream *xdr, void *buf, size_t buflen) xdr_set_scratch_buffer() argument 852 xdr->scratch.iov_base = buf; xdr_set_scratch_buffer() 904 struct xdr_buf *buf = xdr->buf; xdr_align_pages() local 912 iov = buf->head; xdr_align_pages() 914 xdr_shrink_bufhead(buf, iov->iov_len - cur); xdr_align_pages() 915 xdr->nwords = XDR_QUADLEN(buf->len - cur); xdr_align_pages() 922 if (buf->page_len <= len) xdr_align_pages() 923 len = buf->page_len; xdr_align_pages() 926 xdr_shrink_pagelen(buf, buf->page_len - len); xdr_align_pages() 927 xdr->nwords = XDR_QUADLEN(buf->len - cur); xdr_align_pages() 945 struct xdr_buf *buf = xdr->buf; xdr_read_pages() local 956 xdr->iov = iov = buf->tail; xdr_read_pages() 999 xdr_buf_from_iov(struct kvec *iov, struct xdr_buf *buf) xdr_buf_from_iov() argument 1001 buf->head[0] = *iov; xdr_buf_from_iov() 1002 buf->tail[0] = empty_iov; xdr_buf_from_iov() 1003 buf->page_len = 0; xdr_buf_from_iov() 1004 buf->buflen = buf->len = iov->iov_len; xdr_buf_from_iov() 1009 * xdr_buf_subsegment - set subbuf to a portion of buf 1010 * @buf: an xdr buffer 1015 * sets @subbuf to an xdr buffer representing the portion of @buf of 1018 * @buf and @subbuf may be pointers to the same struct xdr_buf. 1023 xdr_buf_subsegment(struct xdr_buf *buf, struct xdr_buf *subbuf, xdr_buf_subsegment() argument 1027 if (base < buf->head[0].iov_len) { xdr_buf_subsegment() 1028 subbuf->head[0].iov_base = buf->head[0].iov_base + base; xdr_buf_subsegment() 1030 buf->head[0].iov_len - base); xdr_buf_subsegment() 1034 base -= buf->head[0].iov_len; xdr_buf_subsegment() 1038 if (base < buf->page_len) { xdr_buf_subsegment() 1039 subbuf->page_len = min(buf->page_len - base, len); xdr_buf_subsegment() 1040 base += buf->page_base; xdr_buf_subsegment() 1042 subbuf->pages = &buf->pages[base >> PAGE_CACHE_SHIFT]; xdr_buf_subsegment() 1046 base -= buf->page_len; xdr_buf_subsegment() 1050 if (base < buf->tail[0].iov_len) { xdr_buf_subsegment() 1051 subbuf->tail[0].iov_base = buf->tail[0].iov_base + base; xdr_buf_subsegment() 1053 buf->tail[0].iov_len - base); xdr_buf_subsegment() 1057 base -= buf->tail[0].iov_len; xdr_buf_subsegment() 1068 * xdr_buf_trim - lop at most "len" bytes off the end of "buf" 1069 * @buf: buf to be trimmed 1070 * @len: number of bytes to reduce "buf" by 1077 void xdr_buf_trim(struct xdr_buf *buf, unsigned int len) xdr_buf_trim() argument 1082 if (buf->tail[0].iov_len) { xdr_buf_trim() 1083 cur = min_t(size_t, buf->tail[0].iov_len, trim); xdr_buf_trim() 1084 buf->tail[0].iov_len -= cur; xdr_buf_trim() 1090 if (buf->page_len) { xdr_buf_trim() 1091 cur = min_t(unsigned int, buf->page_len, trim); xdr_buf_trim() 1092 buf->page_len -= cur; xdr_buf_trim() 1098 if (buf->head[0].iov_len) { xdr_buf_trim() 1099 cur = min_t(size_t, buf->head[0].iov_len, trim); xdr_buf_trim() 1100 buf->head[0].iov_len -= cur; xdr_buf_trim() 1104 buf->len -= (len - trim); xdr_buf_trim() 1126 int read_bytes_from_xdr_buf(struct xdr_buf *buf, unsigned int base, void *obj, unsigned int len) read_bytes_from_xdr_buf() argument 1131 status = xdr_buf_subsegment(buf, &subbuf, base, len); read_bytes_from_xdr_buf() 1157 int write_bytes_to_xdr_buf(struct xdr_buf *buf, unsigned int base, void *obj, unsigned int len) write_bytes_to_xdr_buf() argument 1162 status = xdr_buf_subsegment(buf, &subbuf, base, len); write_bytes_to_xdr_buf() 1171 xdr_decode_word(struct xdr_buf *buf, unsigned int base, u32 *obj) xdr_decode_word() argument 1176 status = read_bytes_from_xdr_buf(buf, base, &raw, sizeof(*obj)); xdr_decode_word() 1185 xdr_encode_word(struct xdr_buf *buf, unsigned int base, u32 obj) xdr_encode_word() argument 1189 return write_bytes_to_xdr_buf(buf, base, &raw, sizeof(obj)); xdr_encode_word() 1197 int xdr_buf_read_netobj(struct xdr_buf *buf, struct xdr_netobj *obj, unsigned int offset) xdr_buf_read_netobj() argument 1201 if (xdr_decode_word(buf, offset, &obj->len)) xdr_buf_read_netobj() 1203 if (xdr_buf_subsegment(buf, &subbuf, offset + 4, obj->len)) xdr_buf_read_netobj() 1220 if (obj->len > buf->buflen - buf->len) xdr_buf_read_netobj() 1222 if (buf->tail[0].iov_len != 0) xdr_buf_read_netobj() 1223 obj->data = buf->tail[0].iov_base + buf->tail[0].iov_len; xdr_buf_read_netobj() 1225 obj->data = buf->head[0].iov_base + buf->head[0].iov_len; xdr_buf_read_netobj() 1233 xdr_xcode_array2(struct xdr_buf *buf, unsigned int base, xdr_xcode_array2() argument 1242 if (xdr_encode_word(buf, base, desc->array_len) != 0) xdr_xcode_array2() 1245 if (xdr_decode_word(buf, base, &desc->array_len) != 0 || xdr_xcode_array2() 1248 desc->elem_size > buf->len) xdr_xcode_array2() 1259 if (todo && base < buf->head->iov_len) { xdr_xcode_array2() 1260 c = buf->head->iov_base + base; xdr_xcode_array2() 1262 buf->head->iov_len - base); xdr_xcode_array2() 1288 base = buf->head->iov_len; /* align to start of pages */ xdr_xcode_array2() 1292 base -= buf->head->iov_len; xdr_xcode_array2() 1293 if (todo && base < buf->page_len) { xdr_xcode_array2() 1296 avail_here = min(todo, buf->page_len - base); xdr_xcode_array2() 1299 base += buf->page_base; xdr_xcode_array2() 1300 ppages = buf->pages + (base >> PAGE_CACHE_SHIFT); xdr_xcode_array2() 1388 base = buf->page_len; /* align to start of tail */ xdr_xcode_array2() 1392 base -= buf->page_len; xdr_xcode_array2() 1394 c = buf->tail->iov_base + base; xdr_xcode_array2() 1427 xdr_decode_array2(struct xdr_buf *buf, unsigned int base, xdr_decode_array2() argument 1430 if (base >= buf->len) xdr_decode_array2() 1433 return xdr_xcode_array2(buf, base, desc, 0); xdr_decode_array2() 1438 xdr_encode_array2(struct xdr_buf *buf, unsigned int base, xdr_encode_array2() argument 1442 buf->head->iov_len + buf->page_len + buf->tail->iov_len) xdr_encode_array2() 1445 return xdr_xcode_array2(buf, base, desc, 1); xdr_encode_array2() 1450 xdr_process_buf(struct xdr_buf *buf, unsigned int offset, unsigned int len, xdr_process_buf() argument 1459 if (offset >= buf->head[0].iov_len) { xdr_process_buf() 1460 offset -= buf->head[0].iov_len; xdr_process_buf() 1462 thislen = buf->head[0].iov_len - offset; xdr_process_buf() 1465 sg_set_buf(sg, buf->head[0].iov_base + offset, thislen); xdr_process_buf() 1475 if (offset >= buf->page_len) { xdr_process_buf() 1476 offset -= buf->page_len; xdr_process_buf() 1478 page_len = buf->page_len - offset; xdr_process_buf() 1482 page_offset = (offset + buf->page_base) & (PAGE_CACHE_SIZE - 1); xdr_process_buf() 1483 i = (offset + buf->page_base) >> PAGE_CACHE_SHIFT; xdr_process_buf() 1488 sg_set_page(sg, buf->pages[i], thislen, page_offset); xdr_process_buf() 1501 if (offset < buf->tail[0].iov_len) { xdr_process_buf() 1502 thislen = buf->tail[0].iov_len - offset; xdr_process_buf() 1505 sg_set_buf(sg, buf->tail[0].iov_base + offset, thislen); xdr_process_buf()
|
H A D | addr.c | 28 char *buf, const int buflen) rpc_ntop6_noscopeid() 39 return snprintf(buf, buflen, "::"); rpc_ntop6_noscopeid() 47 return snprintf(buf, buflen, "::1"); rpc_ntop6_noscopeid() 56 return snprintf(buf, buflen, "::ffff:%pI4", rpc_ntop6_noscopeid() 62 return snprintf(buf, buflen, "%pI6c", addr); rpc_ntop6_noscopeid() 66 char *buf, const size_t buflen) rpc_ntop6() 73 len = rpc_ntop6_noscopeid(sap, buf, buflen); rpc_ntop6() 91 strcat(buf, scopebuf); rpc_ntop6() 98 char *buf, const int buflen) rpc_ntop6_noscopeid() 104 char *buf, const size_t buflen) rpc_ntop6() 112 char *buf, const size_t buflen) rpc_ntop4() 116 return snprintf(buf, buflen, "%pI4", &sin->sin_addr); rpc_ntop4() 120 * rpc_ntop - construct a presentation address in @buf 122 * @buf: construction area 123 * @buflen: size of @buf, in bytes 125 * Plants a %NUL-terminated string in @buf and returns the length 128 size_t rpc_ntop(const struct sockaddr *sap, char *buf, const size_t buflen) rpc_ntop() argument 132 return rpc_ntop4(sap, buf, buflen); rpc_ntop() 134 return rpc_ntop6(sap, buf, buflen); rpc_ntop() 141 static size_t rpc_pton4(const char *buf, const size_t buflen, rpc_pton4() argument 152 if (in4_pton(buf, buflen, addr, '\0', NULL) == 0) rpc_pton4() 160 static int rpc_parse_scope_id(struct net *net, const char *buf, rpc_parse_scope_id() argument 167 if ((buf + buflen) == delim) rpc_parse_scope_id() 176 len = (buf + buflen) - delim - 1; rpc_parse_scope_id() 202 static size_t rpc_pton6(struct net *net, const char *buf, const size_t buflen, rpc_pton6() argument 215 if (in6_pton(buf, buflen, addr, IPV6_SCOPE_DELIMITER, &delim) == 0) rpc_pton6() 218 if (!rpc_parse_scope_id(net, buf, buflen, delim, sin6)) rpc_pton6() 225 static size_t rpc_pton6(struct net *net, const char *buf, const size_t buflen, rpc_pton6() argument 235 * @buf: C string containing presentation format IP address 247 size_t rpc_pton(struct net *net, const char *buf, const size_t buflen, rpc_pton() argument 253 if (buf[i] == ':') rpc_pton() 254 return rpc_pton6(net, buf, buflen, sap, salen); rpc_pton() 255 return rpc_pton4(buf, buflen, sap, salen); rpc_pton() 317 char *c, buf[RPCBIND_MAXUADDRLEN + sizeof('\0')]; rpc_uaddr2sockaddr() local 324 memcpy(buf, uaddr, uaddr_len); rpc_uaddr2sockaddr() 326 buf[uaddr_len] = '\0'; rpc_uaddr2sockaddr() 327 c = strrchr(buf, '.'); rpc_uaddr2sockaddr() 334 c = strrchr(buf, '.'); rpc_uaddr2sockaddr() 343 if (rpc_pton(net, buf, strlen(buf), sap, salen) == 0) rpc_uaddr2sockaddr() 27 rpc_ntop6_noscopeid(const struct sockaddr *sap, char *buf, const int buflen) rpc_ntop6_noscopeid() argument 65 rpc_ntop6(const struct sockaddr *sap, char *buf, const size_t buflen) rpc_ntop6() argument 97 rpc_ntop6_noscopeid(const struct sockaddr *sap, char *buf, const int buflen) rpc_ntop6_noscopeid() argument 103 rpc_ntop6(const struct sockaddr *sap, char *buf, const size_t buflen) rpc_ntop6() argument 111 rpc_ntop4(const struct sockaddr *sap, char *buf, const size_t buflen) rpc_ntop4() argument
|
/linux-4.4.14/arch/sparc/prom/ |
H A D | console_64.c | 15 static int __prom_console_write_buf(const char *buf, int len) __prom_console_write_buf() argument 24 args[4] = (unsigned long) buf; __prom_console_write_buf() 36 void prom_console_write_buf(const char *buf, int len) prom_console_write_buf() argument 39 int n = __prom_console_write_buf(buf, len); prom_console_write_buf() 43 buf += len; prom_console_write_buf()
|
H A D | console_32.c | 21 static int prom_nbputchar(const char *buf) prom_nbputchar() argument 29 if ((*(romvec->pv_nbputchar))(*buf)) prom_nbputchar() 35 buf, 0x1) == 1) prom_nbputchar() 46 void prom_console_write_buf(const char *buf, int len) prom_console_write_buf() argument 49 int n = prom_nbputchar(buf); prom_console_write_buf() 53 buf++; prom_console_write_buf()
|
/linux-4.4.14/samples/hidraw/ |
H A D | hid-example.c | 46 char buf[256]; main() local 65 memset(buf, 0x0, sizeof(buf)); main() 87 res = ioctl(fd, HIDIOCGRAWNAME(256), buf); main() 91 printf("Raw Name: %s\n", buf); main() 94 res = ioctl(fd, HIDIOCGRAWPHYS(256), buf); main() 98 printf("Raw Phys: %s\n", buf); main() 113 buf[0] = 0x9; /* Report Number */ main() 114 buf[1] = 0xff; main() 115 buf[2] = 0xff; main() 116 buf[3] = 0xff; main() 117 res = ioctl(fd, HIDIOCSFEATURE(4), buf); main() 124 buf[0] = 0x9; /* Report Number */ main() 125 res = ioctl(fd, HIDIOCGFEATURE(256), buf); main() 132 printf("%hhx ", buf[i]); main() 137 buf[0] = 0x1; /* Report Number */ main() 138 buf[1] = 0x77; main() 139 res = write(fd, buf, 2); main() 148 res = read(fd, buf, 16); main() 154 printf("%hhx ", buf[i]); main()
|
/linux-4.4.14/arch/arm/common/ |
H A D | dmabounce.c | 88 char *buf) dmabounce_show() 91 return sprintf(buf, "%lu %lu %lu %lu %lu %lu\n", dmabounce_show() 110 struct safe_buffer *buf; alloc_safe_buffer() local 126 buf = kmalloc(sizeof(struct safe_buffer), GFP_ATOMIC); alloc_safe_buffer() 127 if (buf == NULL) { alloc_safe_buffer() 132 buf->ptr = ptr; alloc_safe_buffer() 133 buf->size = size; alloc_safe_buffer() 134 buf->direction = dir; alloc_safe_buffer() 135 buf->pool = pool; alloc_safe_buffer() 138 buf->safe = dma_pool_alloc(pool->pool, GFP_ATOMIC, alloc_safe_buffer() 139 &buf->safe_dma_addr); alloc_safe_buffer() 141 buf->safe = dma_alloc_coherent(dev, size, &buf->safe_dma_addr, alloc_safe_buffer() 145 if (buf->safe == NULL) { alloc_safe_buffer() 149 kfree(buf); alloc_safe_buffer() 160 list_add(&buf->node, &device_info->safe_buffers); alloc_safe_buffer() 163 return buf; alloc_safe_buffer() 187 free_safe_buffer(struct dmabounce_device_info *device_info, struct safe_buffer *buf) free_safe_buffer() argument 191 dev_dbg(device_info->dev, "%s(buf=%p)\n", __func__, buf); free_safe_buffer() 195 list_del(&buf->node); free_safe_buffer() 199 if (buf->pool) free_safe_buffer() 200 dma_pool_free(buf->pool->pool, buf->safe, buf->safe_dma_addr); free_safe_buffer() 202 dma_free_coherent(device_info->dev, buf->size, buf->safe, free_safe_buffer() 203 buf->safe_dma_addr); free_safe_buffer() 205 kfree(buf); free_safe_buffer() 249 struct safe_buffer *buf; map_single() local 254 buf = alloc_safe_buffer(device_info, ptr, size, dir); map_single() 255 if (buf == NULL) { map_single() 262 __func__, buf->ptr, virt_to_dma(dev, buf->ptr), map_single() 263 buf->safe, buf->safe_dma_addr); map_single() 267 __func__, ptr, buf->safe, size); map_single() 268 memcpy(buf->safe, ptr, size); map_single() 271 return buf->safe_dma_addr; map_single() 274 static inline void unmap_single(struct device *dev, struct safe_buffer *buf, unmap_single() argument 277 BUG_ON(buf->size != size); unmap_single() 278 BUG_ON(buf->direction != dir); unmap_single() 281 __func__, buf->ptr, virt_to_dma(dev, buf->ptr), unmap_single() 282 buf->safe, buf->safe_dma_addr); unmap_single() 287 void *ptr = buf->ptr; unmap_single() 290 __func__, buf->safe, ptr, size); unmap_single() 291 memcpy(ptr, buf->safe, size); unmap_single() 300 free_safe_buffer(dev->archdata.dmabounce, buf); unmap_single() 349 struct safe_buffer *buf; dmabounce_unmap_page() local 354 buf = find_safe_buffer_dev(dev, dma_addr, __func__); dmabounce_unmap_page() 355 if (!buf) { dmabounce_unmap_page() 360 unmap_single(dev, buf, size, dir); dmabounce_unmap_page() 366 struct safe_buffer *buf; __dmabounce_sync_for_cpu() local 372 buf = find_safe_buffer_dev(dev, addr, __func__); __dmabounce_sync_for_cpu() 373 if (!buf) __dmabounce_sync_for_cpu() 376 off = addr - buf->safe_dma_addr; __dmabounce_sync_for_cpu() 378 BUG_ON(buf->direction != dir); __dmabounce_sync_for_cpu() 381 __func__, buf->ptr, virt_to_dma(dev, buf->ptr), off, __dmabounce_sync_for_cpu() 382 buf->safe, buf->safe_dma_addr); __dmabounce_sync_for_cpu() 388 __func__, buf->safe + off, buf->ptr + off, sz); __dmabounce_sync_for_cpu() 389 memcpy(buf->ptr + off, buf->safe + off, sz); __dmabounce_sync_for_cpu() 406 struct safe_buffer *buf; __dmabounce_sync_for_device() local 412 buf = find_safe_buffer_dev(dev, addr, __func__); __dmabounce_sync_for_device() 413 if (!buf) __dmabounce_sync_for_device() 416 off = addr - buf->safe_dma_addr; __dmabounce_sync_for_device() 418 BUG_ON(buf->direction != dir); __dmabounce_sync_for_device() 421 __func__, buf->ptr, virt_to_dma(dev, buf->ptr), off, __dmabounce_sync_for_device() 422 buf->safe, buf->safe_dma_addr); __dmabounce_sync_for_device() 428 __func__,buf->ptr + off, buf->safe + off, sz); __dmabounce_sync_for_device() 429 memcpy(buf->safe + off, buf->ptr + off, sz); __dmabounce_sync_for_device() 87 dmabounce_show(struct device *dev, struct device_attribute *attr, char *buf) dmabounce_show() argument
|
/linux-4.4.14/drivers/media/usb/dvb-usb/ |
H A D | dib0700_core.c | 41 st->buf, 16, USB_CTRL_GET_TIMEOUT); dib0700_get_version() 43 *hwversion = (st->buf[0] << 24) | (st->buf[1] << 16) | dib0700_get_version() 44 (st->buf[2] << 8) | st->buf[3]; dib0700_get_version() 46 *romversion = (st->buf[4] << 24) | (st->buf[5] << 16) | dib0700_get_version() 47 (st->buf[6] << 8) | st->buf[7]; dib0700_get_version() 49 *ramversion = (st->buf[8] << 24) | (st->buf[9] << 16) | dib0700_get_version() 50 (st->buf[10] << 8) | st->buf[11]; dib0700_get_version() 52 *fwtype = (st->buf[12] << 24) | (st->buf[13] << 16) | dib0700_get_version() 53 (st->buf[14] << 8) | st->buf[15]; dib0700_get_version() 124 st->buf[0] = REQUEST_SET_GPIO; dib0700_set_gpio() 125 st->buf[1] = gpio; dib0700_set_gpio() 126 st->buf[2] = ((gpio_dir & 0x01) << 7) | ((gpio_val & 0x01) << 6); dib0700_set_gpio() 128 ret = dib0700_ctrl_wr(d, st->buf, 3); dib0700_set_gpio() 145 st->buf[0] = REQUEST_SET_USB_XFER_LEN; dib0700_set_usb_xfer_len() 146 st->buf[1] = (nb_ts_packets >> 8) & 0xff; dib0700_set_usb_xfer_len() 147 st->buf[2] = nb_ts_packets & 0xff; dib0700_set_usb_xfer_len() 151 ret = dib0700_ctrl_wr(d, st->buf, 3); dib0700_set_usb_xfer_len() 216 value, index, msg[i].buf, dib0700_i2c_xfer_new() 225 debug_dump(msg[i].buf, msg[i].len, deb_data); dib0700_i2c_xfer_new() 234 st->buf[0] = REQUEST_NEW_I2C_WRITE; dib0700_i2c_xfer_new() 235 st->buf[1] = msg[i].addr << 1; dib0700_i2c_xfer_new() 236 st->buf[2] = (en_start << 7) | (en_stop << 6) | dib0700_i2c_xfer_new() 239 st->buf[3] = ((gen_mode << 6) & 0xC0) | dib0700_i2c_xfer_new() 242 memcpy(&st->buf[4], msg[i].buf, msg[i].len); dib0700_i2c_xfer_new() 245 debug_dump(st->buf, msg[i].len + 4, deb_data); dib0700_i2c_xfer_new() 251 0, 0, st->buf, msg[i].len + 4, dib0700_i2c_xfer_new() 284 st->buf[1] = msg[i].addr << 1; dib0700_i2c_xfer_legacy() 286 memcpy(&st->buf[2], msg[i].buf, msg[i].len); dib0700_i2c_xfer_legacy() 290 st->buf[0] = REQUEST_I2C_READ; dib0700_i2c_xfer_legacy() 291 st->buf[1] |= 1; dib0700_i2c_xfer_legacy() 294 len = dib0700_ctrl_rd(d, st->buf, msg[i].len + 2, dib0700_i2c_xfer_legacy() 295 msg[i+1].buf, msg[i+1].len); dib0700_i2c_xfer_legacy() 306 st->buf[0] = REQUEST_I2C_WRITE; dib0700_i2c_xfer_legacy() 307 if (dib0700_ctrl_wr(d, st->buf, msg[i].len + 2) < 0) dib0700_i2c_xfer_legacy() 377 st->buf[0] = REQUEST_SET_CLOCK; dib0700_set_clock() 378 st->buf[1] = (en_pll << 7) | (pll_src << 6) | dib0700_set_clock() 380 st->buf[2] = (pll_prediv >> 8) & 0xff; /* MSB */ dib0700_set_clock() 381 st->buf[3] = pll_prediv & 0xff; /* LSB */ dib0700_set_clock() 382 st->buf[4] = (pll_loopdiv >> 8) & 0xff; /* MSB */ dib0700_set_clock() 383 st->buf[5] = pll_loopdiv & 0xff; /* LSB */ dib0700_set_clock() 384 st->buf[6] = (free_div >> 8) & 0xff; /* MSB */ dib0700_set_clock() 385 st->buf[7] = free_div & 0xff; /* LSB */ dib0700_set_clock() 386 st->buf[8] = (dsuScaler >> 8) & 0xff; /* MSB */ dib0700_set_clock() 387 st->buf[9] = dsuScaler & 0xff; /* LSB */ dib0700_set_clock() 389 ret = dib0700_ctrl_wr(d, st->buf, 10); dib0700_set_clock() 409 st->buf[0] = REQUEST_SET_I2C_PARAM; dib0700_set_i2c_speed() 411 st->buf[1] = 0; dib0700_set_i2c_speed() 412 st->buf[2] = (u8) (divider >> 8); dib0700_set_i2c_speed() 413 st->buf[3] = (u8) (divider & 0xff); dib0700_set_i2c_speed() 415 st->buf[4] = (u8) (divider >> 8); dib0700_set_i2c_speed() 416 st->buf[5] = (u8) (divider & 0xff); dib0700_set_i2c_speed() 418 st->buf[6] = (u8) (divider >> 8); dib0700_set_i2c_speed() 419 st->buf[7] = (u8) (divider & 0xff); dib0700_set_i2c_speed() 422 (st->buf[2] << 8) | (st->buf[3]), (st->buf[4] << 8) | dib0700_set_i2c_speed() 423 st->buf[5], (st->buf[6] << 8) | st->buf[7], scl_kHz); dib0700_set_i2c_speed() 425 ret = dib0700_ctrl_wr(d, st->buf, 8); dib0700_set_i2c_speed() 444 u8 *buf; dib0700_jumpram() local 446 buf = kmalloc(8, GFP_KERNEL); dib0700_jumpram() 447 if (!buf) dib0700_jumpram() 449 buf[0] = REQUEST_JUMPRAM; dib0700_jumpram() 450 buf[1] = 0; dib0700_jumpram() 451 buf[2] = 0; dib0700_jumpram() 452 buf[3] = 0; dib0700_jumpram() 453 buf[4] = (address >> 24) & 0xff; dib0700_jumpram() 454 buf[5] = (address >> 16) & 0xff; dib0700_jumpram() 455 buf[6] = (address >> 8) & 0xff; dib0700_jumpram() 456 buf[7] = address & 0xff; dib0700_jumpram() 458 if ((ret = usb_bulk_msg(udev, usb_sndbulkpipe(udev, 0x01),buf,8,&actlen,1000)) < 0) { dib0700_jumpram() 468 kfree(buf); dib0700_jumpram() 476 u8 *buf; dib0700_download_firmware() local 479 buf = kmalloc(260, GFP_KERNEL); dib0700_download_firmware() 480 if (!buf) dib0700_download_firmware() 487 buf[0] = hx.len; dib0700_download_firmware() 488 buf[1] = (hx.addr >> 8) & 0xff; dib0700_download_firmware() 489 buf[2] = hx.addr & 0xff; dib0700_download_firmware() 490 buf[3] = hx.type; dib0700_download_firmware() 491 memcpy(&buf[4],hx.data,hx.len); dib0700_download_firmware() 492 buf[4+hx.len] = hx.chk; dib0700_download_firmware() 496 buf, dib0700_download_firmware() 524 buf, 16, USB_CTRL_GET_TIMEOUT); dib0700_download_firmware() 525 fw_version = (buf[8] << 24) | (buf[9] << 16) | (buf[10] << 8) | buf[11]; dib0700_download_firmware() 544 kfree(buf); dib0700_download_firmware() 566 st->buf[0] = REQUEST_ENABLE_VIDEO; dib0700_streaming_ctrl() 569 st->buf[1] = (onoff << 4) | 0x00; dib0700_streaming_ctrl() 572 st->buf[2] = 0x00; dib0700_streaming_ctrl() 574 st->buf[2] = 0x01 << 4; /* Master mode */ dib0700_streaming_ctrl() 576 st->buf[3] = 0x00; dib0700_streaming_ctrl() 595 st->buf[2] |= st->channel_state; dib0700_streaming_ctrl() 597 deb_info("data for streaming: %x %x\n", st->buf[1], st->buf[2]); dib0700_streaming_ctrl() 599 ret = dib0700_ctrl_wr(adap->dev, st->buf, 4); dib0700_streaming_ctrl() 616 st->buf[0] = REQUEST_SET_RC; dib0700_change_protocol() 617 st->buf[1] = 0; dib0700_change_protocol() 618 st->buf[2] = 0; dib0700_change_protocol() 639 st->buf[1] = new_proto; dib0700_change_protocol() 641 ret = dib0700_ctrl_wr(d, st->buf, 3); dib0700_change_protocol()
|
H A D | vp702x.c | 121 u8 *buf; vp702x_usb_inout_cmd() local 129 buf = kmalloc(buflen, GFP_KERNEL); vp702x_usb_inout_cmd() 130 if (!buf) { vp702x_usb_inout_cmd() 135 kfree(st->buf); vp702x_usb_inout_cmd() 136 st->buf = buf; vp702x_usb_inout_cmd() 139 buf = st->buf; vp702x_usb_inout_cmd() 142 buf[0] = 0x00; vp702x_usb_inout_cmd() 143 buf[1] = cmd; vp702x_usb_inout_cmd() 144 memcpy(&buf[2], o, olen); vp702x_usb_inout_cmd() 146 ret = vp702x_usb_inout_op(d, buf, olen+2, buf, ilen+1, msec); vp702x_usb_inout_cmd() 149 memcpy(i, &buf[1], ilen); vp702x_usb_inout_cmd() 159 u8 *buf; vp702x_set_pld_mode() local 163 buf = st->buf; vp702x_set_pld_mode() 164 memset(buf, 0, 16); vp702x_set_pld_mode() 167 0, buf, 16); vp702x_set_pld_mode() 176 u8 *buf; vp702x_set_pld_state() local 180 buf = st->buf; vp702x_set_pld_state() 181 memset(buf, 0, 16); vp702x_set_pld_state() 183 0, buf, 16); vp702x_set_pld_state() 194 u8 *buf; vp702x_set_pid() local 209 buf = dst->buf; vp702x_set_pid() 210 memset(buf, 0, 16); vp702x_set_pid() 211 vp702x_usb_in_op(adap->dev, 0xe0, (((pid >> 8) & 0xff) << 8) | (id), 0, buf, 16); vp702x_set_pid() 212 vp702x_usb_in_op(adap->dev, 0xe0, (((pid ) & 0xff) << 8) | (id+1), 0, buf, 16); vp702x_set_pid() 237 b = dst->buf; vp702x_init_pid_filter() 296 u8 i, *buf; vp702x_read_mac_addr() local 300 buf = st->buf; vp702x_read_mac_addr() 302 vp702x_usb_in_op(d, READ_EEPROM_REQ, i, 1, &buf[i - 6], 1); vp702x_read_mac_addr() 304 memcpy(mac, buf, 6); vp702x_read_mac_addr() 311 u8 buf[10] = { 0 }; vp702x_frontend_attach() local 316 buf, 10, 10)) vp702x_frontend_attach() 319 buf[9] = '\0'; vp702x_frontend_attach() 320 info("system string: %s",&buf[1]); vp702x_frontend_attach() 346 st->buf = kmalloc(st->buf_len, GFP_KERNEL); vp702x_usb_probe() 347 if (!st->buf) { vp702x_usb_probe() 364 kfree(st->buf); vp702x_usb_disconnect()
|
/linux-4.4.14/arch/cris/boot/tools/ |
H A D | build.c | 110 char buf[1024]; main() local 112 struct exec *ex = (struct exec *)buf; main() 144 for (i=0;i<sizeof buf; i++) buf[i]=0; main() 147 if (read(id,buf,MINIX_HEADER) != MINIX_HEADER) main() 149 if (((long *) buf)[0]!=intel_long(0x04100301)) main() 151 if (((long *) buf)[1]!=intel_long(MINIX_HEADER)) main() 153 if (((long *) buf)[3] != 0) main() 155 if (((long *) buf)[4] != 0) main() 157 if (((long *) buf)[5] != 0) main() 159 if (((long *) buf)[7] != 0) main() 161 i=read(id,buf,sizeof buf); main() 165 if ((*(unsigned short *)(buf+510)) != (unsigned short)intel_short(0xAA55)) main() 167 buf[508] = (char) minor_root; main() 168 buf[509] = (char) major_root; main() 169 i=write(1,buf,512); main() 176 if (read(id,buf,MINIX_HEADER) != MINIX_HEADER) main() 178 if (((long *) buf)[0]!=intel_long(0x04100301)) main() 180 if (((long *) buf)[1]!=intel_long(MINIX_HEADER)) main() 182 if (((long *) buf)[3] != 0) main() 184 if (((long *) buf)[4] != 0) main() 186 if (((long *) buf)[5] != 0) main() 188 if (((long *) buf)[7] != 0) main() 190 for (i=0 ; (c=read(id,buf,sizeof buf))>0 ; i+=c ) main() 196 memcpy(&tmp_long, &buf[2], sizeof(long)); main() 199 memcpy(&tmp_int, &buf[6], sizeof(int)); main() 202 buf[0x11] = 1; /* LOADED_HIGH */ main() 204 memcpy(&buf[0x14], &tmp_long, sizeof(long)); /* code32_start */ main() 207 if (write(1,buf,c)!=c) main() 220 for (c=0 ; c<sizeof(buf) ; c++) main() 221 buf[c] = '\0'; main() 224 if (c > sizeof(buf)) main() 225 c = sizeof(buf); main() 226 if (write(1,buf,c) != c) main() 234 if (read(id,buf,GCC_HEADER) != GCC_HEADER) main() 262 if (l > sizeof(buf)) main() 263 l = sizeof(buf); main() 264 if ((n=read(id, buf, l)) != l) { main() 271 if (write(1, buf, l) != l) main() 281 buf[0] = (sys_size & 0xff); main() 282 buf[1] = ((sys_size >> 8) & 0xff); main() 283 if (write(1, buf, 2) != 2) main()
|
/linux-4.4.14/tools/perf/util/ |
H A D | trace-event-read.c | 45 static int __do_read(int fd, void *buf, int size) __do_read() argument 50 int ret = read(fd, buf, size); __do_read() 56 int retw = write(STDOUT_FILENO, buf, ret); __do_read() 65 buf += ret; __do_read() 90 char buf[BUFSIZ]; skip() local 95 do_read(buf, r); skip() 120 char buf[BUFSIZ]; read_string() local 147 buf[size++] = c; read_string() 157 memcpy(str, buf, size); read_string() 188 char *buf; read_ftrace_printk() local 195 buf = malloc(size); read_ftrace_printk() 196 if (buf == NULL) read_ftrace_printk() 199 if (do_read(buf, size) < 0) { read_ftrace_printk() 200 free(buf); read_ftrace_printk() 204 parse_ftrace_printk(pevent, buf, size); read_ftrace_printk() 206 free(buf); read_ftrace_printk() 214 char buf[BUFSIZ]; read_header_files() local 217 if (do_read(buf, 12) < 0) read_header_files() 220 if (memcmp(buf, "header_page", 12) != 0) { read_header_files() 247 if (do_read(buf, 13) < 0) read_header_files() 250 if (memcmp(buf, "header_event", 13) != 0) { read_header_files() 263 char *buf; read_ftrace_file() local 265 buf = malloc(size); read_ftrace_file() 266 if (buf == NULL) read_ftrace_file() 269 if (do_read(buf, size) < 0) { read_ftrace_file() 270 free(buf); read_ftrace_file() 274 parse_ftrace_file(pevent, buf, size); read_ftrace_file() 275 free(buf); read_ftrace_file() 282 char *buf; read_event_file() local 284 buf = malloc(size); read_event_file() 285 if (buf == NULL) read_event_file() 288 if (do_read(buf, size) < 0) { read_event_file() 289 free(buf); read_event_file() 293 parse_event_file(pevent, buf, size, sys); read_event_file() 294 free(buf); read_event_file() 346 char buf[BUFSIZ]; trace_report() local 363 if (do_read(buf, 3) < 0) trace_report() 365 if (memcmp(buf, test, 3) != 0) { trace_report() 370 if (do_read(buf, 7) < 0) trace_report() 372 if (memcmp(buf, "tracing", 7) != 0) { trace_report() 384 if (do_read(buf, 1) < 0) trace_report() 386 file_bigendian = buf[0]; trace_report() 400 if (do_read(buf, 1) < 0) trace_report() 402 file_long_size = buf[0]; trace_report()
|
H A D | bpf-loader.h | 35 int err, char *buf, size_t size); 45 char *buf, size_t size); 49 char *buf, size_t size); 83 __bpf_strerror(char *buf, size_t size) __bpf_strerror() argument 87 strncpy(buf, __bpf_strerror() 90 buf[size - 1] = '\0'; __bpf_strerror() 98 char *buf, size_t size) bpf__strerror_prepare_load() 100 return __bpf_strerror(buf, size); bpf__strerror_prepare_load() 106 char *buf, size_t size) bpf__strerror_probe() 108 return __bpf_strerror(buf, size); bpf__strerror_probe() 113 char *buf, size_t size) bpf__strerror_load() 115 return __bpf_strerror(buf, size); bpf__strerror_load() 95 bpf__strerror_prepare_load(const char *filename __maybe_unused, bool source __maybe_unused, int err __maybe_unused, char *buf, size_t size) bpf__strerror_prepare_load() argument 104 bpf__strerror_probe(struct bpf_object *obj __maybe_unused, int err __maybe_unused, char *buf, size_t size) bpf__strerror_probe() argument 111 bpf__strerror_load(struct bpf_object *obj __maybe_unused, int err __maybe_unused, char *buf, size_t size) bpf__strerror_load() argument
|
H A D | abspath.c | 24 static char buf[PATH_MAX + 1]; make_nonrelative_path() local 27 if (strlcpy(buf, path, PATH_MAX) >= PATH_MAX) make_nonrelative_path() 33 if (snprintf(buf, PATH_MAX, "%s/%s", cwd, path) >= PATH_MAX) make_nonrelative_path() 36 return buf; make_nonrelative_path()
|
H A D | strbuf.c | 14 * Used as the default ->buf value, so that people can always assume 15 * buf is non NULL and ->buf is NUL terminated even for a freshly 23 sb->buf = strbuf_slopbuf; strbuf_init() 31 zfree(&sb->buf); strbuf_release() 38 char *res = sb->alloc ? sb->buf : NULL; strbuf_detach() 50 sb->buf = NULL; strbuf_grow() 51 ALLOC_GROW(sb->buf, sb->len + extra + 1, sb->alloc); strbuf_grow() 66 memmove(sb->buf + pos + dlen, strbuf_splice() 67 sb->buf + pos + len, strbuf_splice() 69 memcpy(sb->buf + pos, data, dlen); strbuf_splice() 81 memcpy(sb->buf + sb->len, data, len); strbuf_add() 94 len = vsnprintf(sb->buf + sb->len, sb->alloc - sb->len, fmt, ap); strbuf_addv() 99 len = vsnprintf(sb->buf + sb->len, sb->alloc - sb->len, fmt, ap_saved); strbuf_addv() 126 cnt = read(fd, sb->buf + sb->len, sb->alloc - sb->len - 1); strbuf_read() 140 sb->buf[sb->len] = '\0'; strbuf_read()
|
/linux-4.4.14/drivers/media/usb/go7007/ |
H A D | go7007-fw.c | 298 static int mjpeg_frame_header(struct go7007 *go, unsigned char *buf, int q) mjpeg_frame_header() argument 302 buf[p++] = 0xff; mjpeg_frame_header() 303 buf[p++] = 0xd8; mjpeg_frame_header() 304 buf[p++] = 0xff; mjpeg_frame_header() 305 buf[p++] = 0xdb; mjpeg_frame_header() 306 buf[p++] = 0; mjpeg_frame_header() 307 buf[p++] = 2 + 65; mjpeg_frame_header() 308 buf[p++] = 0; mjpeg_frame_header() 309 buf[p++] = default_intra_quant_table[0]; mjpeg_frame_header() 311 /* buf[p++] = (default_intra_quant_table[i] * q) >> 3; */ mjpeg_frame_header() 312 buf[p++] = (default_intra_quant_table[zz[i]] * q) >> 3; mjpeg_frame_header() 313 buf[p++] = 0xff; mjpeg_frame_header() 314 buf[p++] = 0xc0; mjpeg_frame_header() 315 buf[p++] = 0; mjpeg_frame_header() 316 buf[p++] = 17; mjpeg_frame_header() 317 buf[p++] = 8; mjpeg_frame_header() 318 buf[p++] = go->height >> 8; mjpeg_frame_header() 319 buf[p++] = go->height & 0xff; mjpeg_frame_header() 320 buf[p++] = go->width >> 8; mjpeg_frame_header() 321 buf[p++] = go->width & 0xff; mjpeg_frame_header() 322 buf[p++] = 3; mjpeg_frame_header() 323 buf[p++] = 1; mjpeg_frame_header() 324 buf[p++] = 0x22; mjpeg_frame_header() 325 buf[p++] = 0; mjpeg_frame_header() 326 buf[p++] = 2; mjpeg_frame_header() 327 buf[p++] = 0x11; mjpeg_frame_header() 328 buf[p++] = 0; mjpeg_frame_header() 329 buf[p++] = 3; mjpeg_frame_header() 330 buf[p++] = 0x11; mjpeg_frame_header() 331 buf[p++] = 0; mjpeg_frame_header() 332 buf[p++] = 0xff; mjpeg_frame_header() 333 buf[p++] = 0xc4; mjpeg_frame_header() 334 buf[p++] = 418 >> 8; mjpeg_frame_header() 335 buf[p++] = 418 & 0xff; mjpeg_frame_header() 336 buf[p++] = 0x00; mjpeg_frame_header() 337 memcpy(buf + p, bits_dc_luminance + 1, 16); mjpeg_frame_header() 339 memcpy(buf + p, val_dc_luminance, sizeof(val_dc_luminance)); mjpeg_frame_header() 341 buf[p++] = 0x01; mjpeg_frame_header() 342 memcpy(buf + p, bits_dc_chrominance + 1, 16); mjpeg_frame_header() 344 memcpy(buf + p, val_dc_chrominance, sizeof(val_dc_chrominance)); mjpeg_frame_header() 346 buf[p++] = 0x10; mjpeg_frame_header() 347 memcpy(buf + p, bits_ac_luminance + 1, 16); mjpeg_frame_header() 349 memcpy(buf + p, val_ac_luminance, sizeof(val_ac_luminance)); mjpeg_frame_header() 351 buf[p++] = 0x11; mjpeg_frame_header() 352 memcpy(buf + p, bits_ac_chrominance + 1, 16); mjpeg_frame_header() 354 memcpy(buf + p, val_ac_chrominance, sizeof(val_ac_chrominance)); mjpeg_frame_header() 356 buf[p++] = 0xff; mjpeg_frame_header() 357 buf[p++] = 0xda; mjpeg_frame_header() 358 buf[p++] = 0; mjpeg_frame_header() 359 buf[p++] = 12; mjpeg_frame_header() 360 buf[p++] = 3; mjpeg_frame_header() 361 buf[p++] = 1; mjpeg_frame_header() 362 buf[p++] = 0x00; mjpeg_frame_header() 363 buf[p++] = 2; mjpeg_frame_header() 364 buf[p++] = 0x11; mjpeg_frame_header() 365 buf[p++] = 3; mjpeg_frame_header() 366 buf[p++] = 0x11; mjpeg_frame_header() 367 buf[p++] = 0; mjpeg_frame_header() 368 buf[p++] = 63; mjpeg_frame_header() 369 buf[p++] = 0; mjpeg_frame_header() 375 u8 *buf; gen_mjpeghdr_to_package() local 380 buf = kzalloc(4096, GFP_KERNEL); gen_mjpeghdr_to_package() 381 if (buf == NULL) gen_mjpeghdr_to_package() 385 mjpeg_frame_header(go, buf + size, i); gen_mjpeghdr_to_package() 388 chunk = mjpeg_frame_header(go, buf + size, 1); gen_mjpeghdr_to_package() 389 memmove(buf + size, buf + size + 80, chunk - 80); gen_mjpeghdr_to_package() 416 memcpy(&code[off + 2], buf + i, chunk * 2); gen_mjpeghdr_to_package() 420 kfree(buf); gen_mjpeghdr_to_package() 424 static int mpeg1_frame_header(struct go7007 *go, unsigned char *buf, mpeg1_frame_header() argument 429 CODE_GEN(c, buf + 6); mpeg1_frame_header() 525 buf[2] = 0x00; mpeg1_frame_header() 526 buf[3] = 0x00; mpeg1_frame_header() 527 buf[4] = 0x01; mpeg1_frame_header() 528 buf[5] = 0x00; mpeg1_frame_header() 532 static int mpeg1_sequence_header(struct go7007 *go, unsigned char *buf, int ext) mpeg1_sequence_header() argument 535 CODE_GEN(c, buf + 6); mpeg1_sequence_header() 630 buf[0] = i & 0xff; mpeg1_sequence_header() 631 buf[1] = i >> 8; mpeg1_sequence_header() 632 buf[2] = 0x00; mpeg1_sequence_header() 633 buf[3] = 0x00; mpeg1_sequence_header() 634 buf[4] = 0x01; mpeg1_sequence_header() 635 buf[5] = 0xb3; mpeg1_sequence_header() 642 u8 *buf; gen_mpeg1hdr_to_package() local 647 buf = kzalloc(5120, GFP_KERNEL); gen_mpeg1hdr_to_package() 648 if (buf == NULL) gen_mpeg1hdr_to_package() 651 framelen[0] = mpeg1_frame_header(go, buf, 0, 1, PFRAME); gen_mpeg1hdr_to_package() 653 framelen[0] += mpeg1_frame_header(go, buf + framelen[0] / 8, gen_mpeg1hdr_to_package() 655 buf[0] = framelen[0] & 0xff; gen_mpeg1hdr_to_package() 656 buf[1] = framelen[0] >> 8; gen_mpeg1hdr_to_package() 658 framelen[1] = mpeg1_frame_header(go, buf + i, 0, 1, BFRAME_PRE); gen_mpeg1hdr_to_package() 660 framelen[1] += mpeg1_frame_header(go, buf + i + framelen[1] / 8, gen_mpeg1hdr_to_package() 662 buf[i] = framelen[1] & 0xff; gen_mpeg1hdr_to_package() 663 buf[i + 1] = framelen[1] >> 8; gen_mpeg1hdr_to_package() 665 framelen[2] = mpeg1_frame_header(go, buf + i, 0, 1, BFRAME_POST); gen_mpeg1hdr_to_package() 667 framelen[2] += mpeg1_frame_header(go, buf + i + framelen[2] / 8, gen_mpeg1hdr_to_package() 669 buf[i] = framelen[2] & 0xff; gen_mpeg1hdr_to_package() 670 buf[i + 1] = framelen[2] >> 8; gen_mpeg1hdr_to_package() 672 framelen[3] = mpeg1_frame_header(go, buf + i, 0, 1, BFRAME_BIDIR); gen_mpeg1hdr_to_package() 674 framelen[3] += mpeg1_frame_header(go, buf + i + framelen[3] / 8, gen_mpeg1hdr_to_package() 676 buf[i] = framelen[3] & 0xff; gen_mpeg1hdr_to_package() 677 buf[i + 1] = framelen[3] >> 8; gen_mpeg1hdr_to_package() 679 mpeg1_sequence_header(go, buf + i, 0); gen_mpeg1hdr_to_package() 708 memcpy(&code[off + 2], buf + i, chunk * 2); gen_mpeg1hdr_to_package() 712 kfree(buf); gen_mpeg1hdr_to_package() 725 static int mpeg4_frame_header(struct go7007 *go, unsigned char *buf, mpeg4_frame_header() argument 729 CODE_GEN(c, buf + 6); mpeg4_frame_header() 770 buf[0] = i & 0xff; mpeg4_frame_header() 771 buf[1] = i >> 8; mpeg4_frame_header() 772 buf[2] = 0x00; mpeg4_frame_header() 773 buf[3] = 0x00; mpeg4_frame_header() 774 buf[4] = 0x01; mpeg4_frame_header() 775 buf[5] = 0xb6; mpeg4_frame_header() 779 static int mpeg4_sequence_header(struct go7007 *go, unsigned char *buf, int ext) mpeg4_sequence_header() argument 787 CODE_GEN(c, buf + 2 + sizeof(head)); mpeg4_sequence_header() 801 memcpy(buf + 2, head, sizeof(head)); mpeg4_sequence_header() 820 buf[0] = i & 0xff; mpeg4_sequence_header() 821 buf[1] = i >> 8; mpeg4_sequence_header() 828 u8 *buf; gen_mpeg4hdr_to_package() local 833 buf = kzalloc(5120, GFP_KERNEL); gen_mpeg4hdr_to_package() 834 if (buf == NULL) gen_mpeg4hdr_to_package() 837 framelen[0] = mpeg4_frame_header(go, buf, 0, PFRAME); gen_mpeg4hdr_to_package() 839 framelen[1] = mpeg4_frame_header(go, buf + i, 0, BFRAME_PRE); gen_mpeg4hdr_to_package() 841 framelen[2] = mpeg4_frame_header(go, buf + i, 0, BFRAME_POST); gen_mpeg4hdr_to_package() 843 framelen[3] = mpeg4_frame_header(go, buf + i, 0, BFRAME_BIDIR); gen_mpeg4hdr_to_package() 845 mpeg4_frame_header(go, buf + i, 0, BFRAME_EMPTY); gen_mpeg4hdr_to_package() 847 mpeg4_sequence_header(go, buf + i, 0); gen_mpeg4hdr_to_package() 876 memcpy(&code[off + 2], buf + i, chunk * 2); gen_mpeg4hdr_to_package() 881 memset(buf, 0, 5120); gen_mpeg4hdr_to_package() 882 framelen[4] = mpeg4_frame_header(go, buf, 1, PFRAME); gen_mpeg4hdr_to_package() 884 framelen[5] = mpeg4_frame_header(go, buf + i, 1, BFRAME_PRE); gen_mpeg4hdr_to_package() 886 framelen[6] = mpeg4_frame_header(go, buf + i, 1, BFRAME_POST); gen_mpeg4hdr_to_package() 888 framelen[7] = mpeg4_frame_header(go, buf + i, 1, BFRAME_BIDIR); gen_mpeg4hdr_to_package() 890 mpeg4_frame_header(go, buf + i, 1, BFRAME_EMPTY); gen_mpeg4hdr_to_package() 919 memcpy(&code[off + 2], buf + i, chunk * 2); gen_mpeg4hdr_to_package() 923 kfree(buf); gen_mpeg4hdr_to_package() 1208 unsigned char *buf, int ext)) seqhead_to_package() 1213 unsigned char buf[40] = { }; seqhead_to_package() local 1214 int len = sequence_header_func(go, buf, 1); seqhead_to_package() 1234 0xc800, buf[2] << 8 | buf[3], seqhead_to_package() 1235 0xc801, buf[4] << 8 | buf[5], seqhead_to_package() 1236 0xc802, buf[6] << 8 | buf[7], seqhead_to_package() 1237 0xc803, buf[8] << 8 | buf[9], seqhead_to_package() 1251 0xc808, buf[10] << 8 | buf[11], seqhead_to_package() 1252 0xc809, buf[12] << 8 | buf[13], seqhead_to_package() 1253 0xc80a, buf[14] << 8 | buf[15], seqhead_to_package() 1254 0xc80b, buf[16] << 8 | buf[17], seqhead_to_package() 1255 0xc80c, buf[18] << 8 | buf[19], seqhead_to_package() 1256 0xc80d, buf[20] << 8 | buf[21], seqhead_to_package() 1257 0xc80e, buf[22] << 8 | buf[23], seqhead_to_package() 1258 0xc80f, buf[24] << 8 | buf[25], seqhead_to_package() 1259 0xc810, buf[26] << 8 | buf[27], seqhead_to_package() 1260 0xc811, buf[28] << 8 | buf[29], seqhead_to_package() 1261 0xc812, buf[30] << 8 | buf[31], seqhead_to_package() 1262 0xc813, buf[32] << 8 | buf[33], seqhead_to_package() 1263 0xc814, buf[34] << 8 | buf[35], seqhead_to_package() 1264 0xc815, buf[36] << 8 | buf[37], seqhead_to_package() 1206 seqhead_to_package(struct go7007 *go, __le16 *code, int space, int (*sequence_header_func)(struct go7007 *go, unsigned char *buf, int ext)) seqhead_to_package() argument
|
/linux-4.4.14/drivers/pnp/ |
H A D | support.c | 106 char buf[128]; dbg_pnp_show_option() local 114 len += scnprintf(buf + len, sizeof(buf) - len, dbg_pnp_show_option() 119 len += scnprintf(buf + len, sizeof(buf) - len, dbg_pnp_show_option() 125 len += scnprintf(buf + len, sizeof(buf) - len, "io min %#llx " dbg_pnp_show_option() 134 len += scnprintf(buf + len, sizeof(buf) - len, "mem min %#llx " dbg_pnp_show_option() 143 len += scnprintf(buf + len, sizeof(buf) - len, "irq"); dbg_pnp_show_option() 145 len += scnprintf(buf + len, sizeof(buf) - len, dbg_pnp_show_option() 150 len += scnprintf(buf + len, dbg_pnp_show_option() 151 sizeof(buf) - len, dbg_pnp_show_option() 154 len += scnprintf(buf + len, sizeof(buf) - len, " flags %#x", dbg_pnp_show_option() 157 len += scnprintf(buf + len, sizeof(buf) - len, dbg_pnp_show_option() 162 len += scnprintf(buf + len, sizeof(buf) - len, "dma"); dbg_pnp_show_option() 164 len += scnprintf(buf + len, sizeof(buf) - len, dbg_pnp_show_option() 169 len += scnprintf(buf + len, dbg_pnp_show_option() 170 sizeof(buf) - len, dbg_pnp_show_option() 173 len += scnprintf(buf + len, sizeof(buf) - len, " (bitmask %#x) " dbg_pnp_show_option() 177 pnp_dbg(&dev->dev, "%s\n", buf); dbg_pnp_show_option()
|
H A D | interface.c | 207 char *buf) options_show() 220 buffer->buffer = buf; options_show() 240 ret = (buffer->curr - buf); options_show() 247 struct device_attribute *attr, char *buf) resources_show() 263 buffer->buffer = buf; resources_show() 296 ret = (buffer->curr - buf); resources_show() 301 static char *pnp_get_resource_value(char *buf, pnp_get_resource_value() argument 316 buf = skip_spaces(buf); pnp_get_resource_value() 318 *start = simple_strtoull(buf, &buf, 0); pnp_get_resource_value() 320 buf = skip_spaces(buf); pnp_get_resource_value() 321 if (*buf == '-') { pnp_get_resource_value() 322 buf = skip_spaces(buf + 1); pnp_get_resource_value() 323 *end = simple_strtoull(buf, &buf, 0); pnp_get_resource_value() 331 return buf; pnp_get_resource_value() 339 char *buf = (void *)ubuf; resources_store() local 348 buf = skip_spaces(buf); resources_store() 349 if (!strncasecmp(buf, "disable", 7)) { resources_store() 353 if (!strncasecmp(buf, "activate", 8)) { resources_store() 357 if (!strncasecmp(buf, "fill", 4)) { resources_store() 363 if (!strncasecmp(buf, "auto", 4)) { resources_store() 370 if (!strncasecmp(buf, "clear", 5)) { resources_store() 376 if (!strncasecmp(buf, "get", 3)) { resources_store() 383 if (!strncasecmp(buf, "set", 3)) { resources_store() 390 buf += 3; resources_store() 394 buf = skip_spaces(buf); resources_store() 395 if (!strncasecmp(buf, "io", 2)) { resources_store() 396 buf = pnp_get_resource_value(buf + 2, resources_store() 401 } else if (!strncasecmp(buf, "mem", 3)) { resources_store() 402 buf = pnp_get_resource_value(buf + 3, resources_store() 407 } else if (!strncasecmp(buf, "irq", 3)) { resources_store() 408 buf = pnp_get_resource_value(buf + 3, resources_store() 413 } else if (!strncasecmp(buf, "dma", 3)) { resources_store() 414 buf = pnp_get_resource_value(buf + 3, resources_store() 419 } else if (!strncasecmp(buf, "bus", 3)) { resources_store() 420 buf = pnp_get_resource_value(buf + 3, resources_store() 440 char *buf) id_show() 442 char *str = buf; id_show() 450 return (str - buf); id_show() 206 options_show(struct device *dmdev, struct device_attribute *attr, char *buf) options_show() argument 246 resources_show(struct device *dmdev, struct device_attribute *attr, char *buf) resources_show() argument 439 id_show(struct device *dmdev, struct device_attribute *attr, char *buf) id_show() argument
|
/linux-4.4.14/sound/aoa/soundbus/ |
H A D | sysfs.c | 9 char *buf) \ 12 return sprintf (buf, format_string, mdev->ofdev.dev.of_node->field); \ 16 char *buf) modalias_show() 23 strlcpy(buf, sdev->modalias, sizeof(sdev->modalias) + 1); modalias_show() 24 strcat(buf, "\n"); modalias_show() 25 length = strlen(buf); modalias_show() 27 length = sprintf(buf, "of:N%sT%s\n", modalias_show() 15 modalias_show(struct device *dev, struct device_attribute *attr, char *buf) modalias_show() argument
|
/linux-4.4.14/sound/synth/emux/ |
H A D | emux_proc.c | 29 struct snd_info_buffer *buf) snd_emux_proc_info_read() 37 snd_iprintf(buf, "Device: %s\n", emu->name); snd_emux_proc_info_read() 38 snd_iprintf(buf, "Ports: %d\n", emu->num_ports); snd_emux_proc_info_read() 39 snd_iprintf(buf, "Addresses:"); snd_emux_proc_info_read() 41 snd_iprintf(buf, " %d:%d", emu->client, emu->ports[i]); snd_emux_proc_info_read() 42 snd_iprintf(buf, "\n"); snd_emux_proc_info_read() 43 snd_iprintf(buf, "Use Counter: %d\n", emu->used); snd_emux_proc_info_read() 44 snd_iprintf(buf, "Max Voices: %d\n", emu->max_voices); snd_emux_proc_info_read() 45 snd_iprintf(buf, "Allocated Voices: %d\n", emu->num_voices); snd_emux_proc_info_read() 47 snd_iprintf(buf, "Memory Size: %d\n", emu->memhdr->size); snd_emux_proc_info_read() 48 snd_iprintf(buf, "Memory Available: %d\n", snd_util_mem_avail(emu->memhdr)); snd_emux_proc_info_read() 49 snd_iprintf(buf, "Allocated Blocks: %d\n", emu->memhdr->nblocks); snd_emux_proc_info_read() 51 snd_iprintf(buf, "Memory Size: 0\n"); snd_emux_proc_info_read() 55 snd_iprintf(buf, "SoundFonts: %d\n", emu->sflist->fonts_size); snd_emux_proc_info_read() 56 snd_iprintf(buf, "Instruments: %d\n", emu->sflist->zone_counter); snd_emux_proc_info_read() 57 snd_iprintf(buf, "Samples: %d\n", emu->sflist->sample_counter); snd_emux_proc_info_read() 58 snd_iprintf(buf, "Locked Instruments: %d\n", emu->sflist->zone_locked); snd_emux_proc_info_read() 59 snd_iprintf(buf, "Locked Samples: %d\n", emu->sflist->sample_locked); snd_emux_proc_info_read() 65 snd_iprintf(buf, "voice 0: on\n"); snd_emux_proc_info_read() 66 snd_iprintf(buf, "mod delay=%x, atkhld=%x, dcysus=%x, rel=%x\n", snd_emux_proc_info_read() 71 snd_iprintf(buf, "vol delay=%x, atkhld=%x, dcysus=%x, rel=%x\n", snd_emux_proc_info_read() 76 snd_iprintf(buf, "lfo1 delay=%x, lfo2 delay=%x, pefe=%x\n", snd_emux_proc_info_read() 80 snd_iprintf(buf, "fmmod=%x, tremfrq=%x, fm2frq2=%x\n", snd_emux_proc_info_read() 84 snd_iprintf(buf, "cutoff=%x, filterQ=%x, chorus=%x, reverb=%x\n", snd_emux_proc_info_read() 89 snd_iprintf(buf, "avol=%x, acutoff=%x, apitch=%x\n", snd_emux_proc_info_read() 91 snd_iprintf(buf, "apan=%x, aaux=%x, ptarget=%x, vtarget=%x, ftarget=%x\n", snd_emux_proc_info_read() 96 snd_iprintf(buf, "start=%x, end=%x, loopstart=%x, loopend=%x\n", snd_emux_proc_info_read() 98 snd_iprintf(buf, "sample_mode=%x, rate=%x\n", vp->reg.sample_mode, vp->reg.rate_offset); snd_emux_proc_info_read() 28 snd_emux_proc_info_read(struct snd_info_entry *entry, struct snd_info_buffer *buf) snd_emux_proc_info_read() argument
|
/linux-4.4.14/drivers/staging/lustre/lustre/include/ |
H A D | lustre_disk.h | 235 static inline void lsd_le_to_cpu(struct lr_server_data *buf, lsd_le_to_cpu() argument 240 memcpy(lsd->lsd_uuid, buf->lsd_uuid, sizeof(lsd->lsd_uuid)); lsd_le_to_cpu() 241 lsd->lsd_last_transno = le64_to_cpu(buf->lsd_last_transno); lsd_le_to_cpu() 242 lsd->lsd_compat14 = le64_to_cpu(buf->lsd_compat14); lsd_le_to_cpu() 243 lsd->lsd_mount_count = le64_to_cpu(buf->lsd_mount_count); lsd_le_to_cpu() 244 lsd->lsd_feature_compat = le32_to_cpu(buf->lsd_feature_compat); lsd_le_to_cpu() 245 lsd->lsd_feature_rocompat = le32_to_cpu(buf->lsd_feature_rocompat); lsd_le_to_cpu() 246 lsd->lsd_feature_incompat = le32_to_cpu(buf->lsd_feature_incompat); lsd_le_to_cpu() 247 lsd->lsd_server_size = le32_to_cpu(buf->lsd_server_size); lsd_le_to_cpu() 248 lsd->lsd_client_start = le32_to_cpu(buf->lsd_client_start); lsd_le_to_cpu() 249 lsd->lsd_client_size = le16_to_cpu(buf->lsd_client_size); lsd_le_to_cpu() 250 lsd->lsd_subdir_count = le16_to_cpu(buf->lsd_subdir_count); lsd_le_to_cpu() 251 lsd->lsd_catalog_oid = le64_to_cpu(buf->lsd_catalog_oid); lsd_le_to_cpu() 252 lsd->lsd_catalog_ogen = le32_to_cpu(buf->lsd_catalog_ogen); lsd_le_to_cpu() 253 memcpy(lsd->lsd_peeruuid, buf->lsd_peeruuid, sizeof(lsd->lsd_peeruuid)); lsd_le_to_cpu() 254 lsd->lsd_osd_index = le32_to_cpu(buf->lsd_osd_index); lsd_le_to_cpu() 255 lsd->lsd_padding1 = le32_to_cpu(buf->lsd_padding1); lsd_le_to_cpu() 256 lsd->lsd_start_epoch = le32_to_cpu(buf->lsd_start_epoch); lsd_le_to_cpu() 258 lsd->lsd_trans_table[i] = le64_to_cpu(buf->lsd_trans_table[i]); lsd_le_to_cpu() 259 lsd->lsd_trans_table_time = le32_to_cpu(buf->lsd_trans_table_time); lsd_le_to_cpu() 260 lsd->lsd_expire_intervals = le32_to_cpu(buf->lsd_expire_intervals); lsd_le_to_cpu() 264 struct lr_server_data *buf) lsd_cpu_to_le() 268 memcpy(buf->lsd_uuid, lsd->lsd_uuid, sizeof(buf->lsd_uuid)); lsd_cpu_to_le() 269 buf->lsd_last_transno = cpu_to_le64(lsd->lsd_last_transno); lsd_cpu_to_le() 270 buf->lsd_compat14 = cpu_to_le64(lsd->lsd_compat14); lsd_cpu_to_le() 271 buf->lsd_mount_count = cpu_to_le64(lsd->lsd_mount_count); lsd_cpu_to_le() 272 buf->lsd_feature_compat = cpu_to_le32(lsd->lsd_feature_compat); lsd_cpu_to_le() 273 buf->lsd_feature_rocompat = cpu_to_le32(lsd->lsd_feature_rocompat); lsd_cpu_to_le() 274 buf->lsd_feature_incompat = cpu_to_le32(lsd->lsd_feature_incompat); lsd_cpu_to_le() 275 buf->lsd_server_size = cpu_to_le32(lsd->lsd_server_size); lsd_cpu_to_le() 276 buf->lsd_client_start = cpu_to_le32(lsd->lsd_client_start); lsd_cpu_to_le() 277 buf->lsd_client_size = cpu_to_le16(lsd->lsd_client_size); lsd_cpu_to_le() 278 buf->lsd_subdir_count = cpu_to_le16(lsd->lsd_subdir_count); lsd_cpu_to_le() 279 buf->lsd_catalog_oid = cpu_to_le64(lsd->lsd_catalog_oid); lsd_cpu_to_le() 280 buf->lsd_catalog_ogen = cpu_to_le32(lsd->lsd_catalog_ogen); lsd_cpu_to_le() 281 memcpy(buf->lsd_peeruuid, lsd->lsd_peeruuid, sizeof(buf->lsd_peeruuid)); lsd_cpu_to_le() 282 buf->lsd_osd_index = cpu_to_le32(lsd->lsd_osd_index); lsd_cpu_to_le() 283 buf->lsd_padding1 = cpu_to_le32(lsd->lsd_padding1); lsd_cpu_to_le() 284 buf->lsd_start_epoch = cpu_to_le32(lsd->lsd_start_epoch); lsd_cpu_to_le() 286 buf->lsd_trans_table[i] = cpu_to_le64(lsd->lsd_trans_table[i]); lsd_cpu_to_le() 287 buf->lsd_trans_table_time = cpu_to_le32(lsd->lsd_trans_table_time); lsd_cpu_to_le() 288 buf->lsd_expire_intervals = cpu_to_le32(lsd->lsd_expire_intervals); lsd_cpu_to_le() 291 static inline void lcd_le_to_cpu(struct lsd_client_data *buf, lcd_le_to_cpu() argument 294 memcpy(lcd->lcd_uuid, buf->lcd_uuid, sizeof (lcd->lcd_uuid)); lcd_le_to_cpu() 295 lcd->lcd_last_transno = le64_to_cpu(buf->lcd_last_transno); lcd_le_to_cpu() 296 lcd->lcd_last_xid = le64_to_cpu(buf->lcd_last_xid); lcd_le_to_cpu() 297 lcd->lcd_last_result = le32_to_cpu(buf->lcd_last_result); lcd_le_to_cpu() 298 lcd->lcd_last_data = le32_to_cpu(buf->lcd_last_data); lcd_le_to_cpu() 299 lcd->lcd_last_close_transno = le64_to_cpu(buf->lcd_last_close_transno); lcd_le_to_cpu() 300 lcd->lcd_last_close_xid = le64_to_cpu(buf->lcd_last_close_xid); lcd_le_to_cpu() 301 lcd->lcd_last_close_result = le32_to_cpu(buf->lcd_last_close_result); lcd_le_to_cpu() 302 lcd->lcd_last_close_data = le32_to_cpu(buf->lcd_last_close_data); lcd_le_to_cpu() 303 lcd->lcd_pre_versions[0] = le64_to_cpu(buf->lcd_pre_versions[0]); lcd_le_to_cpu() 304 lcd->lcd_pre_versions[1] = le64_to_cpu(buf->lcd_pre_versions[1]); lcd_le_to_cpu() 305 lcd->lcd_pre_versions[2] = le64_to_cpu(buf->lcd_pre_versions[2]); lcd_le_to_cpu() 306 lcd->lcd_pre_versions[3] = le64_to_cpu(buf->lcd_pre_versions[3]); lcd_le_to_cpu() 307 lcd->lcd_last_epoch = le32_to_cpu(buf->lcd_last_epoch); lcd_le_to_cpu() 308 lcd->lcd_first_epoch = le32_to_cpu(buf->lcd_first_epoch); lcd_le_to_cpu() 312 struct lsd_client_data *buf) lcd_cpu_to_le() 314 memcpy(buf->lcd_uuid, lcd->lcd_uuid, sizeof (lcd->lcd_uuid)); lcd_cpu_to_le() 315 buf->lcd_last_transno = cpu_to_le64(lcd->lcd_last_transno); lcd_cpu_to_le() 316 buf->lcd_last_xid = cpu_to_le64(lcd->lcd_last_xid); lcd_cpu_to_le() 317 buf->lcd_last_result = cpu_to_le32(lcd->lcd_last_result); lcd_cpu_to_le() 318 buf->lcd_last_data = cpu_to_le32(lcd->lcd_last_data); lcd_cpu_to_le() 319 buf->lcd_last_close_transno = cpu_to_le64(lcd->lcd_last_close_transno); lcd_cpu_to_le() 320 buf->lcd_last_close_xid = cpu_to_le64(lcd->lcd_last_close_xid); lcd_cpu_to_le() 321 buf->lcd_last_close_result = cpu_to_le32(lcd->lcd_last_close_result); lcd_cpu_to_le() 322 buf->lcd_last_close_data = cpu_to_le32(lcd->lcd_last_close_data); lcd_cpu_to_le() 323 buf->lcd_pre_versions[0] = cpu_to_le64(lcd->lcd_pre_versions[0]); lcd_cpu_to_le() 324 buf->lcd_pre_versions[1] = cpu_to_le64(lcd->lcd_pre_versions[1]); lcd_cpu_to_le() 325 buf->lcd_pre_versions[2] = cpu_to_le64(lcd->lcd_pre_versions[2]); lcd_cpu_to_le() 326 buf->lcd_pre_versions[3] = cpu_to_le64(lcd->lcd_pre_versions[3]); lcd_cpu_to_le() 327 buf->lcd_last_epoch = cpu_to_le32(lcd->lcd_last_epoch); lcd_cpu_to_le() 328 buf->lcd_first_epoch = cpu_to_le32(lcd->lcd_first_epoch); lcd_cpu_to_le() 263 lsd_cpu_to_le(struct lr_server_data *lsd, struct lr_server_data *buf) lsd_cpu_to_le() argument 311 lcd_cpu_to_le(struct lsd_client_data *lcd, struct lsd_client_data *buf) lcd_cpu_to_le() argument
|
/linux-4.4.14/arch/arm/lib/ |
H A D | csumpartial.S | 21 buf .req r0 label 41 tst buf, #1 @ odd address? 43 ldrneb td0, [buf], #1 54 ldrh td0, [buf], #2 57 ldrb td0, [buf], #1 58 ldrb td3, [buf], #1 71 ldrneb td0, [buf], #1 @ include last byte 80 .Lnot_aligned: tst buf, #1 @ odd address 81 ldrneb td0, [buf], #1 @ make even 85 tst buf, #2 @ 32-bit aligned? 87 ldrneh td0, [buf], #2 @ make 32-bit aligned 90 ldrneb td0, [buf], #1 91 ldrneb ip, [buf], #1 103 stmfd sp!, {buf, lr} 107 tst buf, #1 111 tst buf, #3 @ Test destination alignment 118 2: ldmia buf!, {td0, td1, td2, td3} 123 ldmia buf!, {td0, td1, td2, td3} 136 4: ldr td0, [buf], #4
|
/linux-4.4.14/drivers/gpu/drm/radeon/ |
H A D | drm_buffer.c | 41 * buf: Pointer to a pointer where the object is stored. 44 int drm_buffer_alloc(struct drm_buffer **buf, int size) drm_buffer_alloc() argument 51 *buf = kzalloc(sizeof(struct drm_buffer) + nr_pages*sizeof(char *), drm_buffer_alloc() 54 if (*buf == NULL) { drm_buffer_alloc() 61 (*buf)->size = size; drm_buffer_alloc() 65 (*buf)->data[idx] = drm_buffer_alloc() 70 if ((*buf)->data[idx] == NULL) { drm_buffer_alloc() 84 kfree((*buf)->data[idx]); drm_buffer_alloc() 86 kfree(*buf); drm_buffer_alloc() 97 int drm_buffer_copy_from_user(struct drm_buffer *buf, drm_buffer_copy_from_user() argument 103 if (size > buf->size) { drm_buffer_copy_from_user() 106 size, buf->size); drm_buffer_copy_from_user() 112 if (copy_from_user(buf->data[idx], drm_buffer_copy_from_user() 117 user_data, buf, idx); drm_buffer_copy_from_user() 122 buf->iterator = 0; drm_buffer_copy_from_user() 129 void drm_buffer_free(struct drm_buffer *buf) drm_buffer_free() argument 132 if (buf != NULL) { drm_buffer_free() 134 int nr_pages = buf->size / PAGE_SIZE + 1; drm_buffer_free() 137 kfree(buf->data[idx]); drm_buffer_free() 139 kfree(buf); drm_buffer_free() 155 void *drm_buffer_read_object(struct drm_buffer *buf, drm_buffer_read_object() argument 158 int idx = drm_buffer_index(buf); drm_buffer_read_object() 159 int page = drm_buffer_page(buf); drm_buffer_read_object() 163 obj = &buf->data[page][idx]; drm_buffer_read_object() 167 memcpy(stack_obj, &buf->data[page][idx], beginsz); drm_buffer_read_object() 169 memcpy(stack_obj + beginsz, &buf->data[page + 1][0], drm_buffer_read_object() 175 drm_buffer_advance(buf, objsize); drm_buffer_read_object()
|
/linux-4.4.14/sound/firewire/ |
H A D | fcp.c | 33 u8 *buf; avc_general_set_sig_fmt() local 47 buf = kzalloc(8, GFP_KERNEL); avc_general_set_sig_fmt() 48 if (buf == NULL) avc_general_set_sig_fmt() 51 buf[0] = 0x00; /* AV/C CONTROL */ avc_general_set_sig_fmt() 52 buf[1] = 0xff; /* UNIT */ avc_general_set_sig_fmt() 54 buf[2] = 0x19; /* INPUT PLUG SIGNAL FORMAT */ avc_general_set_sig_fmt() 56 buf[2] = 0x18; /* OUTPUT PLUG SIGNAL FORMAT */ avc_general_set_sig_fmt() 57 buf[3] = 0xff & pid; /* plug id */ avc_general_set_sig_fmt() 58 buf[4] = 0x90; /* EOH_1, Form_1, FMT. AM824 */ avc_general_set_sig_fmt() 59 buf[5] = 0x07 & sfc; /* FDF-hi. AM824, frequency */ avc_general_set_sig_fmt() 60 buf[6] = 0xff; /* FDF-mid. AM824, SYT hi (not used)*/ avc_general_set_sig_fmt() 61 buf[7] = 0xff; /* FDF-low. AM824, SYT lo (not used) */ avc_general_set_sig_fmt() 63 /* do transaction and check buf[1-5] are the same against command */ avc_general_set_sig_fmt() 64 err = fcp_avc_transaction(unit, buf, 8, buf, 8, avc_general_set_sig_fmt() 68 else if (buf[0] == 0x08) /* NOT IMPLEMENTED */ avc_general_set_sig_fmt() 70 else if (buf[0] == 0x0a) /* REJECTED */ avc_general_set_sig_fmt() 77 kfree(buf); avc_general_set_sig_fmt() 87 u8 *buf; avc_general_get_sig_fmt() local 90 buf = kzalloc(8, GFP_KERNEL); avc_general_get_sig_fmt() 91 if (buf == NULL) avc_general_get_sig_fmt() 94 buf[0] = 0x01; /* AV/C STATUS */ avc_general_get_sig_fmt() 95 buf[1] = 0xff; /* Unit */ avc_general_get_sig_fmt() 97 buf[2] = 0x19; /* INPUT PLUG SIGNAL FORMAT */ avc_general_get_sig_fmt() 99 buf[2] = 0x18; /* OUTPUT PLUG SIGNAL FORMAT */ avc_general_get_sig_fmt() 100 buf[3] = 0xff & pid; /* plug id */ avc_general_get_sig_fmt() 101 buf[4] = 0x90; /* EOH_1, Form_1, FMT. AM824 */ avc_general_get_sig_fmt() 102 buf[5] = 0xff; /* FDF-hi. AM824, frequency */ avc_general_get_sig_fmt() 103 buf[6] = 0xff; /* FDF-mid. AM824, SYT hi (not used) */ avc_general_get_sig_fmt() 104 buf[7] = 0xff; /* FDF-low. AM824, SYT lo (not used) */ avc_general_get_sig_fmt() 106 /* do transaction and check buf[1-4] are the same against command */ avc_general_get_sig_fmt() 107 err = fcp_avc_transaction(unit, buf, 8, buf, 8, avc_general_get_sig_fmt() 111 else if (buf[0] == 0x08) /* NOT IMPLEMENTED */ avc_general_get_sig_fmt() 113 else if (buf[0] == 0x0a) /* REJECTED */ avc_general_get_sig_fmt() 115 else if (buf[0] == 0x0b) /* IN TRANSITION */ avc_general_get_sig_fmt() 121 sfc = 0x07 & buf[5]; avc_general_get_sig_fmt() 130 kfree(buf); avc_general_get_sig_fmt() 139 u8 *buf; avc_general_get_plug_info() local 146 buf = kzalloc(8, GFP_KERNEL); avc_general_get_plug_info() 147 if (buf == NULL) avc_general_get_plug_info() 150 buf[0] = 0x01; /* AV/C STATUS */ avc_general_get_plug_info() 152 buf[1] = ((subunit_type & 0x1f) << 3) | (subunit_id & 0x7); avc_general_get_plug_info() 153 buf[2] = 0x02; /* PLUG INFO */ avc_general_get_plug_info() 154 buf[3] = 0xff & subfunction; avc_general_get_plug_info() 156 err = fcp_avc_transaction(unit, buf, 8, buf, 8, BIT(1) | BIT(2)); avc_general_get_plug_info() 159 else if (buf[0] == 0x08) /* NOT IMPLEMENTED */ avc_general_get_plug_info() 161 else if (buf[0] == 0x0a) /* REJECTED */ avc_general_get_plug_info() 163 else if (buf[0] == 0x0b) /* IN TRANSITION */ avc_general_get_plug_info() 168 info[0] = buf[4]; avc_general_get_plug_info() 169 info[1] = buf[5]; avc_general_get_plug_info() 170 info[2] = buf[6]; avc_general_get_plug_info() 171 info[3] = buf[7]; avc_general_get_plug_info() 175 kfree(buf); avc_general_get_plug_info()
|
/linux-4.4.14/drivers/scsi/pcmcia/ |
H A D | nsp_io.h | 69 void *buf, nsp_multi_read_1() 72 insb(BaseAddr + Register, buf, count); nsp_multi_read_1() 76 void *buf, nsp_fifo8_read() 79 /*nsp_dbg(NSP_DEBUG_DATA_IO, "buf=0x%p, count=0x%lx", buf, count);*/ nsp_fifo8_read() 80 nsp_multi_read_1(base, FIFODATA, buf, count); nsp_fifo8_read() 88 void *buf, nsp_multi_read_2() 91 insw(BaseAddr + Register, buf, count); nsp_multi_read_2() 95 void *buf, nsp_fifo16_read() 98 //nsp_dbg(NSP_DEBUG_DATA_IO, "buf=0x%p, count=0x%lx*2", buf, count); nsp_fifo16_read() 99 nsp_multi_read_2(base, FIFODATA, buf, count); nsp_fifo16_read() 107 void *buf, nsp_multi_read_4() 110 insl(BaseAddr + Register, buf, count); nsp_multi_read_4() 114 void *buf, nsp_fifo32_read() 117 //nsp_dbg(NSP_DEBUG_DATA_IO, "buf=0x%p, count=0x%lx*4", buf, count); nsp_fifo32_read() 118 nsp_multi_read_4(base, FIFODATA, buf, count); nsp_fifo32_read() 126 void *buf, nsp_multi_write_1() 129 outsb(BaseAddr + Register, buf, count); nsp_multi_write_1() 133 void *buf, nsp_fifo8_write() 136 nsp_multi_write_1(base, FIFODATA, buf, count); nsp_fifo8_write() 144 void *buf, nsp_multi_write_2() 147 outsw(BaseAddr + Register, buf, count); nsp_multi_write_2() 151 void *buf, nsp_fifo16_write() 154 nsp_multi_write_2(base, FIFODATA, buf, count); nsp_fifo16_write() 162 void *buf, nsp_multi_write_4() 165 outsl(BaseAddr + Register, buf, count); nsp_multi_write_4() 169 void *buf, nsp_fifo32_write() 172 nsp_multi_write_4(base, FIFODATA, buf, count); nsp_fifo32_write() 221 void *buf, nsp_mmio_multi_read_4() 225 unsigned long *tmp = (unsigned long *)buf; nsp_mmio_multi_read_4() 238 void *buf, nsp_mmio_fifo32_read() 241 //nsp_dbg(NSP_DEBUG_DATA_IO, "buf=0x%p, count=0x%lx*4", buf, count); nsp_mmio_fifo32_read() 242 nsp_mmio_multi_read_4(base, FIFODATA, buf, count); nsp_mmio_fifo32_read() 247 void *buf, nsp_mmio_multi_write_4() 251 unsigned long *tmp = (unsigned long *)buf; nsp_mmio_multi_write_4() 264 void *buf, nsp_mmio_fifo32_write() 267 //nsp_dbg(NSP_DEBUG_DATA_IO, "buf=0x%p, count=0x%lx*4", buf, count); nsp_mmio_fifo32_write() 268 nsp_mmio_multi_write_4(base, FIFODATA, buf, count); nsp_mmio_fifo32_write() 67 nsp_multi_read_1(unsigned int BaseAddr, unsigned int Register, void *buf, unsigned long count) nsp_multi_read_1() argument 75 nsp_fifo8_read(unsigned int base, void *buf, unsigned long count) nsp_fifo8_read() argument 86 nsp_multi_read_2(unsigned int BaseAddr, unsigned int Register, void *buf, unsigned long count) nsp_multi_read_2() argument 94 nsp_fifo16_read(unsigned int base, void *buf, unsigned long count) nsp_fifo16_read() argument 105 nsp_multi_read_4(unsigned int BaseAddr, unsigned int Register, void *buf, unsigned long count) nsp_multi_read_4() argument 113 nsp_fifo32_read(unsigned int base, void *buf, unsigned long count) nsp_fifo32_read() argument 124 nsp_multi_write_1(unsigned int BaseAddr, unsigned int Register, void *buf, unsigned long count) nsp_multi_write_1() argument 132 nsp_fifo8_write(unsigned int base, void *buf, unsigned long count) nsp_fifo8_write() argument 142 nsp_multi_write_2(unsigned int BaseAddr, unsigned int Register, void *buf, unsigned long count) nsp_multi_write_2() argument 150 nsp_fifo16_write(unsigned int base, void *buf, unsigned long count) nsp_fifo16_write() argument 160 nsp_multi_write_4(unsigned int BaseAddr, unsigned int Register, void *buf, unsigned long count) nsp_multi_write_4() argument 168 nsp_fifo32_write(unsigned int base, void *buf, unsigned long count) nsp_fifo32_write() argument 219 nsp_mmio_multi_read_4(unsigned long base, unsigned int Register, void *buf, unsigned long count) nsp_mmio_multi_read_4() argument 237 nsp_mmio_fifo32_read(unsigned int base, void *buf, unsigned long count) nsp_mmio_fifo32_read() argument 245 nsp_mmio_multi_write_4(unsigned long base, unsigned int Register, void *buf, unsigned long count) nsp_mmio_multi_write_4() argument 263 nsp_mmio_fifo32_write(unsigned int base, void *buf, unsigned long count) nsp_mmio_fifo32_write() argument
|
/linux-4.4.14/drivers/net/wireless/iwlwifi/mvm/ |
H A D | debugfs-vif.c | 131 static ssize_t iwl_dbgfs_pm_params_write(struct ieee80211_vif *vif, char *buf, iwl_dbgfs_pm_params_write() argument 139 if (!strncmp("keep_alive=", buf, 11)) { iwl_dbgfs_pm_params_write() 140 if (sscanf(buf + 11, "%d", &val) != 1) iwl_dbgfs_pm_params_write() 143 } else if (!strncmp("skip_over_dtim=", buf, 15)) { iwl_dbgfs_pm_params_write() 144 if (sscanf(buf + 15, "%d", &val) != 1) iwl_dbgfs_pm_params_write() 147 } else if (!strncmp("skip_dtim_periods=", buf, 18)) { iwl_dbgfs_pm_params_write() 148 if (sscanf(buf + 18, "%d", &val) != 1) iwl_dbgfs_pm_params_write() 151 } else if (!strncmp("rx_data_timeout=", buf, 16)) { iwl_dbgfs_pm_params_write() 152 if (sscanf(buf + 16, "%d", &val) != 1) iwl_dbgfs_pm_params_write() 155 } else if (!strncmp("tx_data_timeout=", buf, 16)) { iwl_dbgfs_pm_params_write() 156 if (sscanf(buf + 16, "%d", &val) != 1) iwl_dbgfs_pm_params_write() 159 } else if (!strncmp("lprx=", buf, 5)) { iwl_dbgfs_pm_params_write() 160 if (sscanf(buf + 5, "%d", &val) != 1) iwl_dbgfs_pm_params_write() 163 } else if (!strncmp("lprx_rssi_threshold=", buf, 20)) { iwl_dbgfs_pm_params_write() 164 if (sscanf(buf + 20, "%d", &val) != 1) iwl_dbgfs_pm_params_write() 170 } else if (!strncmp("snooze_enable=", buf, 14)) { iwl_dbgfs_pm_params_write() 171 if (sscanf(buf + 14, "%d", &val) != 1) iwl_dbgfs_pm_params_write() 174 } else if (!strncmp("uapsd_misbehaving=", buf, 18)) { iwl_dbgfs_pm_params_write() 175 if (sscanf(buf + 18, "%d", &val) != 1) iwl_dbgfs_pm_params_write() 178 } else if (!strncmp("use_ps_poll=", buf, 12)) { iwl_dbgfs_pm_params_write() 179 if (sscanf(buf + 12, "%d", &val) != 1) iwl_dbgfs_pm_params_write() 199 char buf[64]; iwl_dbgfs_tx_pwr_lmt_read() local 200 int bufsz = sizeof(buf); iwl_dbgfs_tx_pwr_lmt_read() 203 pos = scnprintf(buf, bufsz, "bss limit = %d\n", iwl_dbgfs_tx_pwr_lmt_read() 206 return simple_read_from_buffer(user_buf, count, ppos, buf, pos); iwl_dbgfs_tx_pwr_lmt_read() 216 char buf[512]; iwl_dbgfs_pm_params_read() local 217 int bufsz = sizeof(buf); iwl_dbgfs_pm_params_read() 220 pos = iwl_mvm_power_mac_dbgfs_read(mvm, vif, buf, bufsz); iwl_dbgfs_pm_params_read() 222 return simple_read_from_buffer(user_buf, count, ppos, buf, pos); iwl_dbgfs_pm_params_read() 234 char buf[512]; iwl_dbgfs_mac_params_read() local 235 int bufsz = sizeof(buf); iwl_dbgfs_mac_params_read() 245 pos += scnprintf(buf+pos, bufsz-pos, "type: ibss\n"); iwl_dbgfs_mac_params_read() 248 pos += scnprintf(buf+pos, bufsz-pos, "type: bss\n"); iwl_dbgfs_mac_params_read() 251 pos += scnprintf(buf+pos, bufsz-pos, "type: ap\n"); iwl_dbgfs_mac_params_read() 254 pos += scnprintf(buf+pos, bufsz-pos, "type: p2p client\n"); iwl_dbgfs_mac_params_read() 257 pos += scnprintf(buf+pos, bufsz-pos, "type: p2p go\n"); iwl_dbgfs_mac_params_read() 260 pos += scnprintf(buf+pos, bufsz-pos, "type: p2p dev\n"); iwl_dbgfs_mac_params_read() 266 pos += scnprintf(buf+pos, bufsz-pos, "mac id/color: %d / %d\n", iwl_dbgfs_mac_params_read() 268 pos += scnprintf(buf+pos, bufsz-pos, "bssid: %pM\n", iwl_dbgfs_mac_params_read() 270 pos += scnprintf(buf+pos, bufsz-pos, "QoS:\n"); iwl_dbgfs_mac_params_read() 272 pos += scnprintf(buf+pos, bufsz-pos, iwl_dbgfs_mac_params_read() 289 pos += scnprintf(buf+pos, bufsz-pos, iwl_dbgfs_mac_params_read() 299 pos += scnprintf(buf+pos, bufsz-pos, iwl_dbgfs_mac_params_read() 307 return simple_read_from_buffer(user_buf, count, ppos, buf, pos); iwl_dbgfs_mac_params_read() 355 static ssize_t iwl_dbgfs_bf_params_write(struct ieee80211_vif *vif, char *buf, iwl_dbgfs_bf_params_write() argument 363 if (!strncmp("bf_energy_delta=", buf, 16)) { iwl_dbgfs_bf_params_write() 364 if (sscanf(buf+16, "%d", &value) != 1) iwl_dbgfs_bf_params_write() 370 } else if (!strncmp("bf_roaming_energy_delta=", buf, 24)) { iwl_dbgfs_bf_params_write() 371 if (sscanf(buf+24, "%d", &value) != 1) iwl_dbgfs_bf_params_write() 377 } else if (!strncmp("bf_roaming_state=", buf, 17)) { iwl_dbgfs_bf_params_write() 378 if (sscanf(buf+17, "%d", &value) != 1) iwl_dbgfs_bf_params_write() 384 } else if (!strncmp("bf_temp_threshold=", buf, 18)) { iwl_dbgfs_bf_params_write() 385 if (sscanf(buf+18, "%d", &value) != 1) iwl_dbgfs_bf_params_write() 391 } else if (!strncmp("bf_temp_fast_filter=", buf, 20)) { iwl_dbgfs_bf_params_write() 392 if (sscanf(buf+20, "%d", &value) != 1) iwl_dbgfs_bf_params_write() 398 } else if (!strncmp("bf_temp_slow_filter=", buf, 20)) { iwl_dbgfs_bf_params_write() 399 if (sscanf(buf+20, "%d", &value) != 1) iwl_dbgfs_bf_params_write() 405 } else if (!strncmp("bf_enable_beacon_filter=", buf, 24)) { iwl_dbgfs_bf_params_write() 406 if (sscanf(buf+24, "%d", &value) != 1) iwl_dbgfs_bf_params_write() 411 } else if (!strncmp("bf_debug_flag=", buf, 14)) { iwl_dbgfs_bf_params_write() 412 if (sscanf(buf+14, "%d", &value) != 1) iwl_dbgfs_bf_params_write() 417 } else if (!strncmp("bf_escape_timer=", buf, 16)) { iwl_dbgfs_bf_params_write() 418 if (sscanf(buf+16, "%d", &value) != 1) iwl_dbgfs_bf_params_write() 424 } else if (!strncmp("ba_escape_timer=", buf, 16)) { iwl_dbgfs_bf_params_write() 425 if (sscanf(buf+16, "%d", &value) != 1) iwl_dbgfs_bf_params_write() 431 } else if (!strncmp("ba_enable_beacon_abort=", buf, 23)) { iwl_dbgfs_bf_params_write() 432 if (sscanf(buf+23, "%d", &value) != 1) iwl_dbgfs_bf_params_write() 458 char buf[256]; iwl_dbgfs_bf_params_read() local 460 const size_t bufsz = sizeof(buf); iwl_dbgfs_bf_params_read() 475 pos += scnprintf(buf+pos, bufsz-pos, "bf_energy_delta = %d\n", iwl_dbgfs_bf_params_read() 477 pos += scnprintf(buf+pos, bufsz-pos, "bf_roaming_energy_delta = %d\n", iwl_dbgfs_bf_params_read() 479 pos += scnprintf(buf+pos, bufsz-pos, "bf_roaming_state = %d\n", iwl_dbgfs_bf_params_read() 481 pos += scnprintf(buf+pos, bufsz-pos, "bf_temp_threshold = %d\n", iwl_dbgfs_bf_params_read() 483 pos += scnprintf(buf+pos, bufsz-pos, "bf_temp_fast_filter = %d\n", iwl_dbgfs_bf_params_read() 485 pos += scnprintf(buf+pos, bufsz-pos, "bf_temp_slow_filter = %d\n", iwl_dbgfs_bf_params_read() 487 pos += scnprintf(buf+pos, bufsz-pos, "bf_enable_beacon_filter = %d\n", iwl_dbgfs_bf_params_read() 489 pos += scnprintf(buf+pos, bufsz-pos, "bf_debug_flag = %d\n", iwl_dbgfs_bf_params_read() 491 pos += scnprintf(buf+pos, bufsz-pos, "bf_escape_timer = %d\n", iwl_dbgfs_bf_params_read() 493 pos += scnprintf(buf+pos, bufsz-pos, "ba_escape_timer = %d\n", iwl_dbgfs_bf_params_read() 495 pos += scnprintf(buf+pos, bufsz-pos, "ba_enable_beacon_abort = %d\n", iwl_dbgfs_bf_params_read() 498 return simple_read_from_buffer(user_buf, count, ppos, buf, pos); iwl_dbgfs_bf_params_read() 501 static inline char *iwl_dbgfs_is_match(char *name, char *buf) iwl_dbgfs_is_match() argument 505 return !strncmp(name, buf, len) ? buf + len : NULL; iwl_dbgfs_is_match() 509 char *buf, iwl_dbgfs_tof_enable_write() 520 data = iwl_dbgfs_is_match("tof_disabled=", buf); iwl_dbgfs_tof_enable_write() 528 data = iwl_dbgfs_is_match("one_sided_disabled=", buf); iwl_dbgfs_tof_enable_write() 536 data = iwl_dbgfs_is_match("is_debug_mode=", buf); iwl_dbgfs_tof_enable_write() 544 data = iwl_dbgfs_is_match("is_buf=", buf); iwl_dbgfs_tof_enable_write() 552 data = iwl_dbgfs_is_match("send_tof_cfg=", buf); iwl_dbgfs_tof_enable_write() 574 char buf[256]; iwl_dbgfs_tof_enable_read() local 576 const size_t bufsz = sizeof(buf); iwl_dbgfs_tof_enable_read() 583 pos += scnprintf(buf + pos, bufsz - pos, "tof_disabled = %d\n", iwl_dbgfs_tof_enable_read() 585 pos += scnprintf(buf + pos, bufsz - pos, "one_sided_disabled = %d\n", iwl_dbgfs_tof_enable_read() 587 pos += scnprintf(buf + pos, bufsz - pos, "is_debug_mode = %d\n", iwl_dbgfs_tof_enable_read() 589 pos += scnprintf(buf + pos, bufsz - pos, "is_buf_required = %d\n", iwl_dbgfs_tof_enable_read() 594 return simple_read_from_buffer(user_buf, count, ppos, buf, pos); iwl_dbgfs_tof_enable_read() 598 char *buf, iwl_dbgfs_tof_responder_params_write() 609 data = iwl_dbgfs_is_match("burst_period=", buf); iwl_dbgfs_tof_responder_params_write() 618 data = iwl_dbgfs_is_match("min_delta_ftm=", buf); iwl_dbgfs_tof_responder_params_write() 626 data = iwl_dbgfs_is_match("burst_duration=", buf); iwl_dbgfs_tof_responder_params_write() 634 data = iwl_dbgfs_is_match("num_of_burst_exp=", buf); iwl_dbgfs_tof_responder_params_write() 642 data = iwl_dbgfs_is_match("abort_responder=", buf); iwl_dbgfs_tof_responder_params_write() 650 data = iwl_dbgfs_is_match("get_ch_est=", buf); iwl_dbgfs_tof_responder_params_write() 658 data = iwl_dbgfs_is_match("recv_sta_req_params=", buf); iwl_dbgfs_tof_responder_params_write() 666 data = iwl_dbgfs_is_match("channel_num=", buf); iwl_dbgfs_tof_responder_params_write() 674 data = iwl_dbgfs_is_match("bandwidth=", buf); iwl_dbgfs_tof_responder_params_write() 682 data = iwl_dbgfs_is_match("rate=", buf); iwl_dbgfs_tof_responder_params_write() 690 data = iwl_dbgfs_is_match("bssid=", buf); iwl_dbgfs_tof_responder_params_write() 700 data = iwl_dbgfs_is_match("tsf_timer_offset_msecs=", buf); iwl_dbgfs_tof_responder_params_write() 709 data = iwl_dbgfs_is_match("toa_offset=", buf); iwl_dbgfs_tof_responder_params_write() 718 data = iwl_dbgfs_is_match("center_freq=", buf); iwl_dbgfs_tof_responder_params_write() 745 data = iwl_dbgfs_is_match("ftm_per_burst=", buf); iwl_dbgfs_tof_responder_params_write() 753 data = iwl_dbgfs_is_match("ftm_resp_ts_avail=", buf); iwl_dbgfs_tof_responder_params_write() 761 data = iwl_dbgfs_is_match("asap_mode=", buf); iwl_dbgfs_tof_responder_params_write() 769 data = iwl_dbgfs_is_match("send_responder_cfg=", buf); iwl_dbgfs_tof_responder_params_write() 791 char buf[256]; iwl_dbgfs_tof_responder_params_read() local 793 const size_t bufsz = sizeof(buf); iwl_dbgfs_tof_responder_params_read() 800 pos += scnprintf(buf + pos, bufsz - pos, "burst_period = %d\n", iwl_dbgfs_tof_responder_params_read() 802 pos += scnprintf(buf + pos, bufsz - pos, "burst_duration = %d\n", iwl_dbgfs_tof_responder_params_read() 804 pos += scnprintf(buf + pos, bufsz - pos, "bandwidth = %d\n", iwl_dbgfs_tof_responder_params_read() 806 pos += scnprintf(buf + pos, bufsz - pos, "channel_num = %d\n", iwl_dbgfs_tof_responder_params_read() 808 pos += scnprintf(buf + pos, bufsz - pos, "ctrl_ch_position = 0x%x\n", iwl_dbgfs_tof_responder_params_read() 810 pos += scnprintf(buf + pos, bufsz - pos, "bssid = %pM\n", iwl_dbgfs_tof_responder_params_read() 812 pos += scnprintf(buf + pos, bufsz - pos, "min_delta_ftm = %d\n", iwl_dbgfs_tof_responder_params_read() 814 pos += scnprintf(buf + pos, bufsz - pos, "num_of_burst_exp = %d\n", iwl_dbgfs_tof_responder_params_read() 816 pos += scnprintf(buf + pos, bufsz - pos, "rate = %d\n", cmd->rate); iwl_dbgfs_tof_responder_params_read() 817 pos += scnprintf(buf + pos, bufsz - pos, "abort_responder = %d\n", iwl_dbgfs_tof_responder_params_read() 819 pos += scnprintf(buf + pos, bufsz - pos, "get_ch_est = %d\n", iwl_dbgfs_tof_responder_params_read() 821 pos += scnprintf(buf + pos, bufsz - pos, "recv_sta_req_params = %d\n", iwl_dbgfs_tof_responder_params_read() 823 pos += scnprintf(buf + pos, bufsz - pos, "ftm_per_burst = %d\n", iwl_dbgfs_tof_responder_params_read() 825 pos += scnprintf(buf + pos, bufsz - pos, "ftm_resp_ts_avail = %d\n", iwl_dbgfs_tof_responder_params_read() 827 pos += scnprintf(buf + pos, bufsz - pos, "asap_mode = %d\n", iwl_dbgfs_tof_responder_params_read() 829 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_tof_responder_params_read() 832 pos += scnprintf(buf + pos, bufsz - pos, "toa_offset = %d\n", iwl_dbgfs_tof_responder_params_read() 837 return simple_read_from_buffer(user_buf, count, ppos, buf, pos); iwl_dbgfs_tof_responder_params_read() 841 char *buf, size_t count, iwl_dbgfs_tof_range_request_write() 852 data = iwl_dbgfs_is_match("request_id=", buf); iwl_dbgfs_tof_range_request_write() 860 data = iwl_dbgfs_is_match("initiator=", buf); iwl_dbgfs_tof_range_request_write() 868 data = iwl_dbgfs_is_match("one_sided_los_disable=", buf); iwl_dbgfs_tof_range_request_write() 876 data = iwl_dbgfs_is_match("req_timeout=", buf); iwl_dbgfs_tof_range_request_write() 884 data = iwl_dbgfs_is_match("report_policy=", buf); iwl_dbgfs_tof_range_request_write() 892 data = iwl_dbgfs_is_match("macaddr_random=", buf); iwl_dbgfs_tof_range_request_write() 900 data = iwl_dbgfs_is_match("num_of_ap=", buf); iwl_dbgfs_tof_range_request_write() 908 data = iwl_dbgfs_is_match("macaddr_template=", buf); iwl_dbgfs_tof_range_request_write() 920 data = iwl_dbgfs_is_match("macaddr_mask=", buf); iwl_dbgfs_tof_range_request_write() 932 data = iwl_dbgfs_is_match("ap=", buf); iwl_dbgfs_tof_range_request_write() 968 data = iwl_dbgfs_is_match("send_range_request=", buf); iwl_dbgfs_tof_range_request_write() 989 char buf[512]; iwl_dbgfs_tof_range_request_read() local 991 const size_t bufsz = sizeof(buf); iwl_dbgfs_tof_range_request_read() 999 pos += scnprintf(buf + pos, bufsz - pos, "request_id= %d\n", iwl_dbgfs_tof_range_request_read() 1001 pos += scnprintf(buf + pos, bufsz - pos, "initiator= %d\n", iwl_dbgfs_tof_range_request_read() 1003 pos += scnprintf(buf + pos, bufsz - pos, "one_sided_los_disable = %d\n", iwl_dbgfs_tof_range_request_read() 1005 pos += scnprintf(buf + pos, bufsz - pos, "req_timeout= %d\n", iwl_dbgfs_tof_range_request_read() 1007 pos += scnprintf(buf + pos, bufsz - pos, "report_policy= %d\n", iwl_dbgfs_tof_range_request_read() 1009 pos += scnprintf(buf + pos, bufsz - pos, "macaddr_random= %d\n", iwl_dbgfs_tof_range_request_read() 1011 pos += scnprintf(buf + pos, bufsz - pos, "macaddr_template= %pM\n", iwl_dbgfs_tof_range_request_read() 1013 pos += scnprintf(buf + pos, bufsz - pos, "macaddr_mask= %pM\n", iwl_dbgfs_tof_range_request_read() 1015 pos += scnprintf(buf + pos, bufsz - pos, "num_of_ap= %d\n", iwl_dbgfs_tof_range_request_read() 1020 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_tof_range_request_read() 1039 return simple_read_from_buffer(user_buf, count, ppos, buf, pos); iwl_dbgfs_tof_range_request_read() 1043 char *buf, iwl_dbgfs_tof_range_req_ext_write() 1054 data = iwl_dbgfs_is_match("tsf_timer_offset_msec=", buf); iwl_dbgfs_tof_range_req_ext_write() 1063 data = iwl_dbgfs_is_match("min_delta_ftm=", buf); iwl_dbgfs_tof_range_req_ext_write() 1071 data = iwl_dbgfs_is_match("ftm_format_and_bw20M=", buf); iwl_dbgfs_tof_range_req_ext_write() 1080 data = iwl_dbgfs_is_match("ftm_format_and_bw40M=", buf); iwl_dbgfs_tof_range_req_ext_write() 1089 data = iwl_dbgfs_is_match("ftm_format_and_bw80M=", buf); iwl_dbgfs_tof_range_req_ext_write() 1098 data = iwl_dbgfs_is_match("send_range_req_ext=", buf); iwl_dbgfs_tof_range_req_ext_write() 1119 char buf[256]; iwl_dbgfs_tof_range_req_ext_read() local 1121 const size_t bufsz = sizeof(buf); iwl_dbgfs_tof_range_req_ext_read() 1128 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_tof_range_req_ext_read() 1131 pos += scnprintf(buf + pos, bufsz - pos, "min_delta_ftm = %hhd\n", iwl_dbgfs_tof_range_req_ext_read() 1133 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_tof_range_req_ext_read() 1136 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_tof_range_req_ext_read() 1139 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_tof_range_req_ext_read() 1144 return simple_read_from_buffer(user_buf, count, ppos, buf, pos); iwl_dbgfs_tof_range_req_ext_read() 1148 char *buf, iwl_dbgfs_tof_range_abort_write() 1159 data = iwl_dbgfs_is_match("abort_id=", buf); iwl_dbgfs_tof_range_abort_write() 1167 data = iwl_dbgfs_is_match("send_range_abort=", buf); iwl_dbgfs_tof_range_abort_write() 1189 char buf[32]; iwl_dbgfs_tof_range_abort_read() local 1191 const size_t bufsz = sizeof(buf); iwl_dbgfs_tof_range_abort_read() 1198 pos += scnprintf(buf + pos, bufsz - pos, "last_abort_id = %d\n", iwl_dbgfs_tof_range_abort_read() 1200 return simple_read_from_buffer(user_buf, count, ppos, buf, pos); iwl_dbgfs_tof_range_abort_read() 1210 char *buf; iwl_dbgfs_tof_range_response_read() local 1216 buf = kzalloc(bufsz, GFP_KERNEL); iwl_dbgfs_tof_range_response_read() 1217 if (!buf) iwl_dbgfs_tof_range_response_read() 1223 pos += scnprintf(buf + pos, bufsz - pos, "request_id = %d\n", iwl_dbgfs_tof_range_response_read() 1225 pos += scnprintf(buf + pos, bufsz - pos, "status = %d\n", iwl_dbgfs_tof_range_response_read() 1227 pos += scnprintf(buf + pos, bufsz - pos, "last_in_batch = %d\n", iwl_dbgfs_tof_range_response_read() 1229 pos += scnprintf(buf + pos, bufsz - pos, "num_of_aps = %d\n", iwl_dbgfs_tof_range_response_read() 1234 pos += scnprintf(buf + pos, bufsz - pos, iwl_dbgfs_tof_range_response_read() 1248 ret = simple_read_from_buffer(user_buf, count, ppos, buf, pos); iwl_dbgfs_tof_range_response_read() 1249 kfree(buf); iwl_dbgfs_tof_range_response_read() 1253 static ssize_t iwl_dbgfs_low_latency_write(struct ieee80211_vif *vif, char *buf, iwl_dbgfs_low_latency_write() argument 1261 ret = kstrtou8(buf, 0, &value); iwl_dbgfs_low_latency_write() 1280 char buf[2]; iwl_dbgfs_low_latency_read() local 1282 buf[0] = mvmvif->low_latency ? '1' : '0'; iwl_dbgfs_low_latency_read() 1283 buf[1] = '\n'; iwl_dbgfs_low_latency_read() 1284 return simple_read_from_buffer(user_buf, count, ppos, buf, sizeof(buf)); iwl_dbgfs_low_latency_read() 1293 char buf[20]; iwl_dbgfs_uapsd_misbehaving_read() local 1296 len = sprintf(buf, "%pM\n", mvmvif->uapsd_misbehaving_bssid); iwl_dbgfs_uapsd_misbehaving_read() 1297 return simple_read_from_buffer(user_buf, count, ppos, buf, len); iwl_dbgfs_uapsd_misbehaving_read() 1301 char *buf, size_t count, iwl_dbgfs_uapsd_misbehaving_write() 1309 ret = mac_pton(buf, mvmvif->uapsd_misbehaving_bssid); iwl_dbgfs_uapsd_misbehaving_write() 1315 static ssize_t iwl_dbgfs_rx_phyinfo_write(struct ieee80211_vif *vif, char *buf, iwl_dbgfs_rx_phyinfo_write() argument 1325 ret = kstrtou16(buf, 0, &value); iwl_dbgfs_rx_phyinfo_write() 1359 char buf[8]; iwl_dbgfs_rx_phyinfo_read() local 1361 snprintf(buf, sizeof(buf), "0x%04x\n", mvmvif->mvm->dbgfs_rx_phyinfo); iwl_dbgfs_rx_phyinfo_read() 1363 return simple_read_from_buffer(user_buf, count, ppos, buf, sizeof(buf)); iwl_dbgfs_rx_phyinfo_read() 1394 char buf[100]; iwl_mvm_vif_dbgfs_register() local 1458 snprintf(buf, 100, "../../../%s/%s/%s/%s", iwl_mvm_vif_dbgfs_register() 1465 mvm->debugfs_dir, buf); iwl_mvm_vif_dbgfs_register() 508 iwl_dbgfs_tof_enable_write(struct ieee80211_vif *vif, char *buf, size_t count, loff_t *ppos) iwl_dbgfs_tof_enable_write() argument 597 iwl_dbgfs_tof_responder_params_write(struct ieee80211_vif *vif, char *buf, size_t count, loff_t *ppos) iwl_dbgfs_tof_responder_params_write() argument 840 iwl_dbgfs_tof_range_request_write(struct ieee80211_vif *vif, char *buf, size_t count, loff_t *ppos) iwl_dbgfs_tof_range_request_write() argument 1042 iwl_dbgfs_tof_range_req_ext_write(struct ieee80211_vif *vif, char *buf, size_t count, loff_t *ppos) iwl_dbgfs_tof_range_req_ext_write() argument 1147 iwl_dbgfs_tof_range_abort_write(struct ieee80211_vif *vif, char *buf, size_t count, loff_t *ppos) iwl_dbgfs_tof_range_abort_write() argument 1300 iwl_dbgfs_uapsd_misbehaving_write(struct ieee80211_vif *vif, char *buf, size_t count, loff_t *ppos) iwl_dbgfs_uapsd_misbehaving_write() argument
|
/linux-4.4.14/drivers/media/pci/pt1/ |
H A D | va1j5jf8007s.c | 70 msgs[0].buf = write_buf; va1j5jf8007s_read_snr() 75 msgs[1].buf = read_buf; va1j5jf8007s_read_snr() 178 u8 buf[6]; va1j5jf8007s_set_frequency_1() local 187 buf[0] = 0xfe; va1j5jf8007s_set_frequency_1() 188 buf[1] = 0xc0; va1j5jf8007s_set_frequency_1() 189 buf[2] = 0x40 | word >> 8; va1j5jf8007s_set_frequency_1() 190 buf[3] = word; va1j5jf8007s_set_frequency_1() 191 buf[4] = 0xe0; va1j5jf8007s_set_frequency_1() 192 buf[5] = va1j5jf8007s_lookup_cb(frequency); va1j5jf8007s_set_frequency_1() 196 msg.len = sizeof(buf); va1j5jf8007s_set_frequency_1() 197 msg.buf = buf; va1j5jf8007s_set_frequency_1() 207 u8 buf[3]; va1j5jf8007s_set_frequency_2() local 210 buf[0] = 0xfe; va1j5jf8007s_set_frequency_2() 211 buf[1] = 0xc0; va1j5jf8007s_set_frequency_2() 212 buf[2] = 0xe4; va1j5jf8007s_set_frequency_2() 216 msg.len = sizeof(buf); va1j5jf8007s_set_frequency_2() 217 msg.buf = buf; va1j5jf8007s_set_frequency_2() 228 u8 buf[4]; va1j5jf8007s_set_frequency_3() local 233 buf[0] = 0xfe; va1j5jf8007s_set_frequency_3() 234 buf[1] = 0xc0; va1j5jf8007s_set_frequency_3() 235 buf[2] = 0xf4; va1j5jf8007s_set_frequency_3() 236 buf[3] = va1j5jf8007s_lookup_cb(frequency) | 0x4; va1j5jf8007s_set_frequency_3() 240 msg.len = sizeof(buf); va1j5jf8007s_set_frequency_3() 241 msg.buf = buf; va1j5jf8007s_set_frequency_3() 264 msgs[0].buf = write_buf; va1j5jf8007s_check_frequency() 269 msgs[1].buf = read_buf; va1j5jf8007s_check_frequency() 280 u8 buf[2]; va1j5jf8007s_set_modulation() local 283 buf[0] = 0x03; va1j5jf8007s_set_modulation() 284 buf[1] = 0x01; va1j5jf8007s_set_modulation() 288 msg.len = sizeof(buf); va1j5jf8007s_set_modulation() 289 msg.buf = buf; va1j5jf8007s_set_modulation() 311 msgs[0].buf = write_buf; va1j5jf8007s_check_modulation() 316 msgs[1].buf = read_buf; va1j5jf8007s_check_modulation() 329 u8 buf[3]; va1j5jf8007s_set_ts_id() local 336 buf[0] = 0x8f; va1j5jf8007s_set_ts_id() 337 buf[1] = ts_id >> 8; va1j5jf8007s_set_ts_id() 338 buf[2] = ts_id; va1j5jf8007s_set_ts_id() 342 msg.len = sizeof(buf); va1j5jf8007s_set_ts_id() 343 msg.buf = buf; va1j5jf8007s_set_ts_id() 372 msgs[0].buf = write_buf; va1j5jf8007s_check_ts_id() 377 msgs[1].buf = read_buf; va1j5jf8007s_check_ts_id() 512 u8 buf[4]; va1j5jf8007s_init_frequency() local 515 buf[0] = 0xfe; va1j5jf8007s_init_frequency() 516 buf[1] = 0xc0; va1j5jf8007s_init_frequency() 517 buf[2] = 0xf0; va1j5jf8007s_init_frequency() 518 buf[3] = 0x04; va1j5jf8007s_init_frequency() 522 msg.len = sizeof(buf); va1j5jf8007s_init_frequency() 523 msg.buf = buf; va1j5jf8007s_init_frequency() 533 u8 buf[2]; va1j5jf8007s_set_sleep() local 536 buf[0] = 0x17; va1j5jf8007s_set_sleep() 537 buf[1] = sleep ? 0x01 : 0x00; va1j5jf8007s_set_sleep() 541 msg.len = sizeof(buf); va1j5jf8007s_set_sleep() 542 msg.buf = buf; va1j5jf8007s_set_sleep() 616 msgs[0].buf = write_buf; va1j5jf8007s_prepare_1() 621 msgs[1].buf = read_buf; va1j5jf8007s_prepare_1() 651 u8 buf[2]; va1j5jf8007s_prepare_2() local 673 msg.buf = buf; va1j5jf8007s_prepare_2() 675 memcpy(buf, bufs[i], sizeof(buf)); va1j5jf8007s_prepare_2() 708 u8 buf[2]; va1j5jf8007s_attach() local 722 buf[0] = 0x01; va1j5jf8007s_attach() 723 buf[1] = 0x80; va1j5jf8007s_attach() 727 msg.len = sizeof(buf); va1j5jf8007s_attach() 728 msg.buf = buf; va1j5jf8007s_attach()
|
H A D | va1j5jf8007t.c | 68 msgs[0].buf = write_buf; va1j5jf8007t_read_snr() 73 msgs[1].buf = read_buf; va1j5jf8007t_read_snr() 164 u8 buf[6]; va1j5jf8007t_set_frequency() local 170 buf[0] = 0xfe; va1j5jf8007t_set_frequency() 171 buf[1] = 0xc2; va1j5jf8007t_set_frequency() 172 buf[2] = word >> 8; va1j5jf8007t_set_frequency() 173 buf[3] = word; va1j5jf8007t_set_frequency() 174 buf[4] = 0x80; va1j5jf8007t_set_frequency() 175 buf[5] = va1j5jf8007t_lookup_cb(frequency); va1j5jf8007t_set_frequency() 179 msg.len = sizeof(buf); va1j5jf8007t_set_frequency() 180 msg.buf = buf; va1j5jf8007t_set_frequency() 203 msgs[0].buf = write_buf; va1j5jf8007t_check_frequency() 208 msgs[1].buf = read_buf; va1j5jf8007t_check_frequency() 219 u8 buf[2]; va1j5jf8007t_set_modulation() local 222 buf[0] = 0x01; va1j5jf8007t_set_modulation() 223 buf[1] = 0x40; va1j5jf8007t_set_modulation() 227 msg.len = sizeof(buf); va1j5jf8007t_set_modulation() 228 msg.buf = buf; va1j5jf8007t_set_modulation() 250 msgs[0].buf = write_buf; va1j5jf8007t_check_modulation() 255 msgs[1].buf = read_buf; va1j5jf8007t_check_modulation() 358 u8 buf[7]; va1j5jf8007t_init_frequency() local 361 buf[0] = 0xfe; va1j5jf8007t_init_frequency() 362 buf[1] = 0xc2; va1j5jf8007t_init_frequency() 363 buf[2] = 0x01; va1j5jf8007t_init_frequency() 364 buf[3] = 0x8f; va1j5jf8007t_init_frequency() 365 buf[4] = 0xc1; va1j5jf8007t_init_frequency() 366 buf[5] = 0x80; va1j5jf8007t_init_frequency() 367 buf[6] = 0x80; va1j5jf8007t_init_frequency() 371 msg.len = sizeof(buf); va1j5jf8007t_init_frequency() 372 msg.buf = buf; va1j5jf8007t_init_frequency() 382 u8 buf[2]; va1j5jf8007t_set_sleep() local 385 buf[0] = 0x03; va1j5jf8007t_set_sleep() 386 buf[1] = sleep ? 0x90 : 0x80; va1j5jf8007t_set_sleep() 390 msg.len = sizeof(buf); va1j5jf8007t_set_sleep() 391 msg.buf = buf; va1j5jf8007t_set_sleep() 469 u8 buf[2]; va1j5jf8007t_prepare() local 490 msg.len = sizeof(buf); va1j5jf8007t_prepare() 491 msg.buf = buf; va1j5jf8007t_prepare() 494 memcpy(buf, bufs[i], sizeof(buf)); va1j5jf8007t_prepare() 508 u8 buf[2]; va1j5jf8007t_attach() local 522 buf[0] = 0x01; va1j5jf8007t_attach() 523 buf[1] = 0x80; va1j5jf8007t_attach() 527 msg.len = sizeof(buf); va1j5jf8007t_attach() 528 msg.buf = buf; va1j5jf8007t_attach()
|
/linux-4.4.14/drivers/misc/cxl/ |
H A D | sysfs.c | 23 char *buf) caia_version_show() 27 return scnprintf(buf, PAGE_SIZE, "%i.%i\n", adapter->caia_major, caia_version_show() 33 char *buf) psl_revision_show() 37 return scnprintf(buf, PAGE_SIZE, "%i\n", adapter->psl_rev); psl_revision_show() 42 char *buf) base_image_show() 46 return scnprintf(buf, PAGE_SIZE, "%i\n", adapter->base_image); base_image_show() 51 char *buf) image_loaded_show() 56 return scnprintf(buf, PAGE_SIZE, "user\n"); image_loaded_show() 57 return scnprintf(buf, PAGE_SIZE, "factory\n"); image_loaded_show() 62 const char *buf, size_t count) reset_adapter_store() 68 rc = sscanf(buf, "%i", &val); reset_adapter_store() 79 char *buf) load_image_on_perst_show() 84 return scnprintf(buf, PAGE_SIZE, "none\n"); load_image_on_perst_show() 87 return scnprintf(buf, PAGE_SIZE, "user\n"); load_image_on_perst_show() 88 return scnprintf(buf, PAGE_SIZE, "factory\n"); load_image_on_perst_show() 93 const char *buf, size_t count) load_image_on_perst_store() 98 if (!strncmp(buf, "none", 4)) load_image_on_perst_store() 100 else if (!strncmp(buf, "user", 4)) { load_image_on_perst_store() 103 } else if (!strncmp(buf, "factory", 7)) { load_image_on_perst_store() 117 char *buf) perst_reloads_same_image_show() 121 return scnprintf(buf, PAGE_SIZE, "%i\n", adapter->perst_same_image); perst_reloads_same_image_show() 126 const char *buf, size_t count) perst_reloads_same_image_store() 132 rc = sscanf(buf, "%i", &val); perst_reloads_same_image_store() 155 char *buf) mmio_size_show_master() 159 return scnprintf(buf, PAGE_SIZE, "%llu\n", afu->adapter->ps_size); mmio_size_show_master() 164 char *buf) pp_mmio_off_show() 168 return scnprintf(buf, PAGE_SIZE, "%llu\n", afu->pp_offset); pp_mmio_off_show() 173 char *buf) pp_mmio_len_show() 177 return scnprintf(buf, PAGE_SIZE, "%llu\n", afu->pp_size); pp_mmio_len_show() 191 char *buf) mmio_size_show() 196 return scnprintf(buf, PAGE_SIZE, "%llu\n", afu->pp_size); mmio_size_show() 197 return scnprintf(buf, PAGE_SIZE, "%llu\n", afu->adapter->ps_size); mmio_size_show() 202 const char *buf, size_t count) reset_store_afu() 225 char *buf) irqs_min_show() 229 return scnprintf(buf, PAGE_SIZE, "%i\n", afu->pp_irqs); irqs_min_show() 234 char *buf) irqs_max_show() 238 return scnprintf(buf, PAGE_SIZE, "%i\n", afu->irqs_max); irqs_max_show() 243 const char *buf, size_t count) irqs_max_store() 249 ret = sscanf(buf, "%i", &irqs_max); irqs_max_store() 264 struct device_attribute *attr, char *buf) modes_supported_show() 267 char *p = buf, *end = buf + PAGE_SIZE; modes_supported_show() 273 return (p - buf); modes_supported_show() 278 char *buf) prefault_mode_show() 284 return scnprintf(buf, PAGE_SIZE, "work_element_descriptor\n"); prefault_mode_show() 286 return scnprintf(buf, PAGE_SIZE, "all\n"); prefault_mode_show() 288 return scnprintf(buf, PAGE_SIZE, "none\n"); prefault_mode_show() 294 const char *buf, size_t count) prefault_mode_store() 299 if (!strncmp(buf, "work_element_descriptor", 23)) prefault_mode_store() 301 if (!strncmp(buf, "all", 3)) prefault_mode_store() 303 if (!strncmp(buf, "none", 4)) prefault_mode_store() 315 char *buf) mode_show() 320 return scnprintf(buf, PAGE_SIZE, "dedicated_process\n"); mode_show() 322 return scnprintf(buf, PAGE_SIZE, "afu_directed\n"); mode_show() 323 return scnprintf(buf, PAGE_SIZE, "none\n"); mode_show() 327 const char *buf, size_t count) mode_store() 338 if (!strncmp(buf, "dedicated_process", 17)) mode_store() 340 if (!strncmp(buf, "afu_directed", 12)) mode_store() 342 if (!strncmp(buf, "none", 4)) mode_store() 373 char *buf) api_version_show() 375 return scnprintf(buf, PAGE_SIZE, "%i\n", CXL_API_VERSION); api_version_show() 380 char *buf) api_version_compatible_show() 382 return scnprintf(buf, PAGE_SIZE, "%i\n", CXL_API_VERSION_COMPATIBLE); api_version_compatible_show() 386 struct bin_attribute *bin_attr, char *buf, afu_eb_read() 392 return cxl_afu_read_err_buffer(afu, buf, off, count); afu_eb_read() 442 struct kobj_attribute *attr, char *buf) vendor_show() 446 return scnprintf(buf, PAGE_SIZE, "0x%.4x\n", cr->vendor); vendor_show() 450 struct kobj_attribute *attr, char *buf) device_show() 454 return scnprintf(buf, PAGE_SIZE, "0x%.4x\n", cr->device); device_show() 458 struct kobj_attribute *attr, char *buf) class_show() 462 return scnprintf(buf, PAGE_SIZE, "0x%.6x\n", cr->class); class_show() 466 struct bin_attribute *bin_attr, char *buf, afu_read_config() 477 buf[i] = (val >> (j * 8)) & 0xff; afu_read_config() 21 caia_version_show(struct device *device, struct device_attribute *attr, char *buf) caia_version_show() argument 31 psl_revision_show(struct device *device, struct device_attribute *attr, char *buf) psl_revision_show() argument 40 base_image_show(struct device *device, struct device_attribute *attr, char *buf) base_image_show() argument 49 image_loaded_show(struct device *device, struct device_attribute *attr, char *buf) image_loaded_show() argument 60 reset_adapter_store(struct device *device, struct device_attribute *attr, const char *buf, size_t count) reset_adapter_store() argument 77 load_image_on_perst_show(struct device *device, struct device_attribute *attr, char *buf) load_image_on_perst_show() argument 91 load_image_on_perst_store(struct device *device, struct device_attribute *attr, const char *buf, size_t count) load_image_on_perst_store() argument 115 perst_reloads_same_image_show(struct device *device, struct device_attribute *attr, char *buf) perst_reloads_same_image_show() argument 124 perst_reloads_same_image_store(struct device *device, struct device_attribute *attr, const char *buf, size_t count) perst_reloads_same_image_store() argument 153 mmio_size_show_master(struct device *device, struct device_attribute *attr, char *buf) mmio_size_show_master() argument 162 pp_mmio_off_show(struct device *device, struct device_attribute *attr, char *buf) pp_mmio_off_show() argument 171 pp_mmio_len_show(struct device *device, struct device_attribute *attr, char *buf) pp_mmio_len_show() argument 189 mmio_size_show(struct device *device, struct device_attribute *attr, char *buf) mmio_size_show() argument 200 reset_store_afu(struct device *device, struct device_attribute *attr, const char *buf, size_t count) reset_store_afu() argument 223 irqs_min_show(struct device *device, struct device_attribute *attr, char *buf) irqs_min_show() argument 232 irqs_max_show(struct device *device, struct device_attribute *attr, char *buf) irqs_max_show() argument 241 irqs_max_store(struct device *device, struct device_attribute *attr, const char *buf, size_t count) irqs_max_store() argument 263 modes_supported_show(struct device *device, struct device_attribute *attr, char *buf) modes_supported_show() argument 276 prefault_mode_show(struct device *device, struct device_attribute *attr, char *buf) prefault_mode_show() argument 292 prefault_mode_store(struct device *device, struct device_attribute *attr, const char *buf, size_t count) prefault_mode_store() argument 313 mode_show(struct device *device, struct device_attribute *attr, char *buf) mode_show() argument 326 mode_store(struct device *device, struct device_attribute *attr, const char *buf, size_t count) mode_store() argument 371 api_version_show(struct device *device, struct device_attribute *attr, char *buf) api_version_show() argument 378 api_version_compatible_show(struct device *device, struct device_attribute *attr, char *buf) api_version_compatible_show() argument 385 afu_eb_read(struct file *filp, struct kobject *kobj, struct bin_attribute *bin_attr, char *buf, loff_t off, size_t count) afu_eb_read() argument 441 vendor_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) vendor_show() argument 449 device_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) device_show() argument 457 class_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) class_show() argument 465 afu_read_config(struct file *filp, struct kobject *kobj, struct bin_attribute *bin_attr, char *buf, loff_t off, size_t count) afu_read_config() argument
|
/linux-4.4.14/drivers/video/fbdev/omap2/dss/ |
H A D | overlay-sysfs.c | 34 static ssize_t overlay_name_show(struct omap_overlay *ovl, char *buf) overlay_name_show() argument 36 return snprintf(buf, PAGE_SIZE, "%s\n", ovl->name); overlay_name_show() 39 static ssize_t overlay_manager_show(struct omap_overlay *ovl, char *buf) overlay_manager_show() argument 41 return snprintf(buf, PAGE_SIZE, "%s\n", overlay_manager_show() 45 static ssize_t overlay_manager_store(struct omap_overlay *ovl, const char *buf, overlay_manager_store() argument 53 if (buf[size-1] == '\n') overlay_manager_store() 60 if (sysfs_streq(buf, mgr->name)) overlay_manager_store() 116 static ssize_t overlay_input_size_show(struct omap_overlay *ovl, char *buf) overlay_input_size_show() argument 122 return snprintf(buf, PAGE_SIZE, "%d,%d\n", overlay_input_size_show() 126 static ssize_t overlay_screen_width_show(struct omap_overlay *ovl, char *buf) overlay_screen_width_show() argument 132 return snprintf(buf, PAGE_SIZE, "%d\n", info.screen_width); overlay_screen_width_show() 135 static ssize_t overlay_position_show(struct omap_overlay *ovl, char *buf) overlay_position_show() argument 141 return snprintf(buf, PAGE_SIZE, "%d,%d\n", overlay_position_show() 146 const char *buf, size_t size) overlay_position_store() 154 info.pos_x = simple_strtoul(buf, &last, 10); overlay_position_store() 156 if (last - buf >= size) overlay_position_store() 174 static ssize_t overlay_output_size_show(struct omap_overlay *ovl, char *buf) overlay_output_size_show() argument 180 return snprintf(buf, PAGE_SIZE, "%d,%d\n", overlay_output_size_show() 185 const char *buf, size_t size) overlay_output_size_store() 193 info.out_width = simple_strtoul(buf, &last, 10); overlay_output_size_store() 195 if (last - buf >= size) overlay_output_size_store() 213 static ssize_t overlay_enabled_show(struct omap_overlay *ovl, char *buf) overlay_enabled_show() argument 215 return snprintf(buf, PAGE_SIZE, "%d\n", ovl->is_enabled(ovl)); overlay_enabled_show() 218 static ssize_t overlay_enabled_store(struct omap_overlay *ovl, const char *buf, overlay_enabled_store() argument 224 r = strtobool(buf, &enable); overlay_enabled_store() 239 static ssize_t overlay_global_alpha_show(struct omap_overlay *ovl, char *buf) overlay_global_alpha_show() argument 245 return snprintf(buf, PAGE_SIZE, "%d\n", overlay_global_alpha_show() 250 const char *buf, size_t size) overlay_global_alpha_store() 259 r = kstrtou8(buf, 0, &alpha); overlay_global_alpha_store() 281 char *buf) overlay_pre_mult_alpha_show() 287 return snprintf(buf, PAGE_SIZE, "%d\n", overlay_pre_mult_alpha_show() 292 const char *buf, size_t size) overlay_pre_mult_alpha_store() 301 r = kstrtou8(buf, 0, &alpha); overlay_pre_mult_alpha_store() 322 static ssize_t overlay_zorder_show(struct omap_overlay *ovl, char *buf) overlay_zorder_show() argument 328 return snprintf(buf, PAGE_SIZE, "%d\n", info.zorder); overlay_zorder_show() 332 const char *buf, size_t size) overlay_zorder_store() 341 r = kstrtou8(buf, 0, &zorder); overlay_zorder_store() 406 char *buf) overlay_attr_show() 417 return overlay_attr->show(overlay, buf); overlay_attr_show() 421 const char *buf, size_t size) overlay_attr_store() 432 return overlay_attr->store(overlay, buf, size); overlay_attr_store() 145 overlay_position_store(struct omap_overlay *ovl, const char *buf, size_t size) overlay_position_store() argument 184 overlay_output_size_store(struct omap_overlay *ovl, const char *buf, size_t size) overlay_output_size_store() argument 249 overlay_global_alpha_store(struct omap_overlay *ovl, const char *buf, size_t size) overlay_global_alpha_store() argument 280 overlay_pre_mult_alpha_show(struct omap_overlay *ovl, char *buf) overlay_pre_mult_alpha_show() argument 291 overlay_pre_mult_alpha_store(struct omap_overlay *ovl, const char *buf, size_t size) overlay_pre_mult_alpha_store() argument 331 overlay_zorder_store(struct omap_overlay *ovl, const char *buf, size_t size) overlay_zorder_store() argument 405 overlay_attr_show(struct kobject *kobj, struct attribute *attr, char *buf) overlay_attr_show() argument 420 overlay_attr_store(struct kobject *kobj, struct attribute *attr, const char *buf, size_t size) overlay_attr_store() argument
|
H A D | display-sysfs.c | 31 static ssize_t display_name_show(struct omap_dss_device *dssdev, char *buf) display_name_show() argument 33 return snprintf(buf, PAGE_SIZE, "%s\n", display_name_show() 38 static ssize_t display_enabled_show(struct omap_dss_device *dssdev, char *buf) display_enabled_show() argument 40 return snprintf(buf, PAGE_SIZE, "%d\n", display_enabled_show() 45 const char *buf, size_t size) display_enabled_store() 50 r = strtobool(buf, &enable); display_enabled_store() 71 static ssize_t display_tear_show(struct omap_dss_device *dssdev, char *buf) display_tear_show() argument 73 return snprintf(buf, PAGE_SIZE, "%d\n", display_tear_show() 79 const char *buf, size_t size) display_tear_store() 87 r = strtobool(buf, &te); display_tear_store() 98 static ssize_t display_timings_show(struct omap_dss_device *dssdev, char *buf) display_timings_show() argument 107 return snprintf(buf, PAGE_SIZE, "%u,%u/%u/%u/%u,%u/%u/%u/%u\n", display_timings_show() 114 const char *buf, size_t size) display_timings_store() 124 if (strncmp("pal", buf, 3) == 0) { display_timings_store() 127 } else if (strncmp("ntsc", buf, 4) == 0) { display_timings_store() 132 if (!found && sscanf(buf, "%u,%hu/%hu/%hu/%hu,%hu/%hu/%hu/%hu", display_timings_store() 151 static ssize_t display_rotate_show(struct omap_dss_device *dssdev, char *buf) display_rotate_show() argument 157 return snprintf(buf, PAGE_SIZE, "%u\n", rotate); display_rotate_show() 161 const char *buf, size_t size) display_rotate_store() 168 r = kstrtoint(buf, 0, &rot); display_rotate_store() 179 static ssize_t display_mirror_show(struct omap_dss_device *dssdev, char *buf) display_mirror_show() argument 185 return snprintf(buf, PAGE_SIZE, "%u\n", mirror); display_mirror_show() 189 const char *buf, size_t size) display_mirror_store() 197 r = strtobool(buf, &mirror); display_mirror_store() 208 static ssize_t display_wss_show(struct omap_dss_device *dssdev, char *buf) display_wss_show() argument 217 return snprintf(buf, PAGE_SIZE, "0x%05x\n", wss); display_wss_show() 221 const char *buf, size_t size) display_wss_store() 229 r = kstrtou32(buf, 0, &wss); display_wss_store() 281 char *buf) display_attr_show() 292 return display_attr->show(dssdev, buf); display_attr_show() 296 const char *buf, size_t size) display_attr_store() 307 return display_attr->store(dssdev, buf, size); display_attr_store() 44 display_enabled_store(struct omap_dss_device *dssdev, const char *buf, size_t size) display_enabled_store() argument 78 display_tear_store(struct omap_dss_device *dssdev, const char *buf, size_t size) display_tear_store() argument 113 display_timings_store(struct omap_dss_device *dssdev, const char *buf, size_t size) display_timings_store() argument 160 display_rotate_store(struct omap_dss_device *dssdev, const char *buf, size_t size) display_rotate_store() argument 188 display_mirror_store(struct omap_dss_device *dssdev, const char *buf, size_t size) display_mirror_store() argument 220 display_wss_store(struct omap_dss_device *dssdev, const char *buf, size_t size) display_wss_store() argument 280 display_attr_show(struct kobject *kobj, struct attribute *attr, char *buf) display_attr_show() argument 295 display_attr_store(struct kobject *kobj, struct attribute *attr, const char *buf, size_t size) display_attr_store() argument
|
/linux-4.4.14/drivers/misc/mei/ |
H A D | debugfs.c | 33 char *buf; mei_dbgfs_read_meclients() local 46 buf = kzalloc(bufsz, GFP_KERNEL); mei_dbgfs_read_meclients() 47 if (!buf) { mei_dbgfs_read_meclients() 52 pos += scnprintf(buf + pos, bufsz - pos, HDR); mei_dbgfs_read_meclients() 61 pos += scnprintf(buf + pos, bufsz - pos, mei_dbgfs_read_meclients() 77 ret = simple_read_from_buffer(ubuf, cnt, ppos, buf, pos); mei_dbgfs_read_meclients() 78 kfree(buf); mei_dbgfs_read_meclients() 94 char *buf; mei_dbgfs_read_active() local 102 buf = kzalloc(bufsz, GFP_KERNEL); mei_dbgfs_read_active() 103 if (!buf) mei_dbgfs_read_active() 106 pos += scnprintf(buf + pos, bufsz - pos, mei_dbgfs_read_active() 117 pos += scnprintf(buf + pos, bufsz - pos, mei_dbgfs_read_active() 125 ret = simple_read_from_buffer(ubuf, cnt, ppos, buf, pos); mei_dbgfs_read_active() 126 kfree(buf); mei_dbgfs_read_active() 141 char *buf = kzalloc(bufsz, GFP_KERNEL); mei_dbgfs_read_devstate() local 145 if (!buf) mei_dbgfs_read_devstate() 148 pos += scnprintf(buf + pos, bufsz - pos, "dev: %s\n", mei_dbgfs_read_devstate() 150 pos += scnprintf(buf + pos, bufsz - pos, "hbm: %s\n", mei_dbgfs_read_devstate() 154 pos += scnprintf(buf + pos, bufsz - pos, "hbm features:\n"); mei_dbgfs_read_devstate() 155 pos += scnprintf(buf + pos, bufsz - pos, "\tPG: %01d\n", mei_dbgfs_read_devstate() 157 pos += scnprintf(buf + pos, bufsz - pos, "\tDC: %01d\n", mei_dbgfs_read_devstate() 159 pos += scnprintf(buf + pos, bufsz - pos, "\tDOT: %01d\n", mei_dbgfs_read_devstate() 161 pos += scnprintf(buf + pos, bufsz - pos, "\tEV: %01d\n", mei_dbgfs_read_devstate() 165 pos += scnprintf(buf + pos, bufsz - pos, "pg: %s, %s\n", mei_dbgfs_read_devstate() 168 ret = simple_read_from_buffer(ubuf, cnt, ppos, buf, pos); mei_dbgfs_read_devstate() 169 kfree(buf); mei_dbgfs_read_devstate()
|
/linux-4.4.14/fs/ext4/ |
H A D | hash.c | 18 static void TEA_transform(__u32 buf[4], __u32 const in[]) TEA_transform() argument 21 __u32 b0 = buf[0], b1 = buf[1]; TEA_transform() 31 buf[0] += b0; TEA_transform() 32 buf[1] += b1; TEA_transform() 69 static void str2hashbuf_signed(const char *msg, int len, __u32 *buf, int num) str2hashbuf_signed() argument 86 *buf++ = val; str2hashbuf_signed() 92 *buf++ = val; str2hashbuf_signed() 94 *buf++ = pad; str2hashbuf_signed() 97 static void str2hashbuf_unsigned(const char *msg, int len, __u32 *buf, int num) str2hashbuf_unsigned() argument 114 *buf++ = val; str2hashbuf_unsigned() 120 *buf++ = val; str2hashbuf_unsigned() 122 *buf++ = pad; str2hashbuf_unsigned() 144 __u32 in[8], buf[4]; ext4fs_dirhash() local 149 buf[0] = 0x67452301; ext4fs_dirhash() 150 buf[1] = 0xefcdab89; ext4fs_dirhash() 151 buf[2] = 0x98badcfe; ext4fs_dirhash() 152 buf[3] = 0x10325476; ext4fs_dirhash() 158 memcpy(buf, hinfo->seed, sizeof(buf)); ext4fs_dirhash() 177 half_md4_transform(buf, in); ext4fs_dirhash() 181 minor_hash = buf[2]; ext4fs_dirhash() 182 hash = buf[1]; ext4fs_dirhash() 190 TEA_transform(buf, in); ext4fs_dirhash() 194 hash = buf[0]; ext4fs_dirhash() 195 minor_hash = buf[1]; ext4fs_dirhash()
|
/linux-4.4.14/drivers/ssb/ |
H A D | host_soc.c | 51 u8 *buf = buffer; sizeof() local 54 *buf = __raw_readb(addr); sizeof() 55 buf++; sizeof() 61 __le16 *buf = buffer; sizeof() local 65 *buf = (__force __le16)__raw_readw(addr); sizeof() 66 buf++; sizeof() 72 __le32 *buf = buffer; sizeof() local 76 *buf = (__force __le32)__raw_readl(addr); sizeof() 77 buf++; sizeof() 124 const u8 *buf = buffer; sizeof() local 127 __raw_writeb(*buf, addr); sizeof() 128 buf++; sizeof() 134 const __le16 *buf = buffer; sizeof() local 138 __raw_writew((__force u16)(*buf), addr); sizeof() 139 buf++; sizeof() 145 const __le32 *buf = buffer; sizeof() local 149 __raw_writel((__force u32)(*buf), addr); sizeof() 150 buf++; sizeof()
|
/linux-4.4.14/drivers/media/common/b2c2/ |
H A D | flexcop-eeprom.c | 10 static int eeprom_write(struct adapter *adapter, u16 addr, u8 *buf, u16 len) 12 return flex_i2c_write(adapter, 0x20000000, 0x50, addr, buf, len); 49 u8 buf[20]; 54 if (eeprom_lrc_read(adapter, 0x3e4, 20, buf, 4) == 0) 57 memcpy(key, buf, len); 90 u16 addr, u8 *buf, u16 len) 92 return fc->i2c_request(fc,FC_READ,FC_I2C_PORT_EEPROM,0x50,addr,buf,len); 97 static u8 calc_lrc(u8 *buf, int len) calc_lrc() argument 102 sum = sum ^ buf[i]; calc_lrc() 107 flexcop_access_op_t op, u16 addr, u8 *buf, u16 len, int retries) flexcop_eeprom_request() 113 addr & 0xff, buf, len); flexcop_eeprom_request() 121 u8 *buf, u16 len, int retries) flexcop_eeprom_lrc_read() 123 int ret = flexcop_eeprom_request(fc, FC_READ, addr, buf, len, retries); flexcop_eeprom_lrc_read() 125 if (calc_lrc(buf, len - 1) != buf[len - 1]) flexcop_eeprom_lrc_read() 134 u8 buf[8]; flexcop_eeprom_check_mac_addr() local 137 if ((ret = flexcop_eeprom_lrc_read(fc,0x3f8,buf,8,4)) == 0) { flexcop_eeprom_check_mac_addr() 143 memcpy(fc->dvb_adapter.proposed_mac,buf,6); flexcop_eeprom_check_mac_addr() 106 flexcop_eeprom_request(struct flexcop_device *fc, flexcop_access_op_t op, u16 addr, u8 *buf, u16 len, int retries) flexcop_eeprom_request() argument 120 flexcop_eeprom_lrc_read(struct flexcop_device *fc, u16 addr, u8 *buf, u16 len, int retries) flexcop_eeprom_lrc_read() argument
|
/linux-4.4.14/fs/ncpfs/ |
H A D | ncpsign_kernel.c | 23 #define BVAL(buf,pos) (((const __u8 *)(buf))[pos]) 24 #define PVAL(buf,pos) ((unsigned)BVAL(buf,pos)) 25 #define BSET(buf,pos,val) (((__u8 *)(buf))[pos] = (val)) 28 WVAL_LH(const __u8 * buf, int pos) WVAL_LH() argument 30 return PVAL(buf, pos) | PVAL(buf, pos + 1) << 8; WVAL_LH() 33 DVAL_LH(const __u8 * buf, int pos) DVAL_LH() argument 35 return WVAL_LH(buf, pos) | WVAL_LH(buf, pos + 2) << 16; DVAL_LH() 38 WSET_LH(__u8 * buf, int pos, __u16 val) WSET_LH() argument 40 BSET(buf, pos, val & 0xff); WSET_LH() 41 BSET(buf, pos + 1, val >> 8); WSET_LH() 44 DSET_LH(__u8 * buf, int pos, __u32 val) DSET_LH() argument 46 WSET_LH(buf, pos, val & 0xffff); DSET_LH() 47 WSET_LH(buf, pos + 2, val >> 16); DSET_LH()
|
/linux-4.4.14/drivers/net/wireless/ath/ath6kl/ |
H A D | trace.h | 10 static inline unsigned int ath6kl_get_wmi_id(void *buf, size_t buf_len) ath6kl_get_wmi_id() argument 12 struct wmi_cmd_hdr *hdr = buf; ath6kl_get_wmi_id() 39 TP_PROTO(void *buf, size_t buf_len), 41 TP_ARGS(buf, buf_len), 46 __dynamic_array(u8, buf, buf_len) 50 __entry->id = ath6kl_get_wmi_id(buf, buf_len); 52 memcpy(__get_dynamic_array(buf), buf, buf_len); 62 TP_PROTO(void *buf, size_t buf_len), 64 TP_ARGS(buf, buf_len), 69 __dynamic_array(u8, buf, buf_len) 73 __entry->id = ath6kl_get_wmi_id(buf, buf_len); 75 memcpy(__get_dynamic_array(buf), buf, buf_len); 86 void *buf, size_t buf_len), 88 TP_ARGS(addr, flags, buf, buf_len), 95 __dynamic_array(u8, buf, buf_len) 102 memcpy(__get_dynamic_array(buf), buf, buf_len); 156 list[i].buf, len); 174 TP_PROTO(void *buf, size_t buf_len), 176 TP_ARGS(buf, buf_len), 180 __dynamic_array(u8, buf, buf_len) 185 memcpy(__get_dynamic_array(buf), buf, buf_len); 194 TP_PROTO(int status, int endpoint, void *buf, 197 TP_ARGS(status, endpoint, buf, buf_len), 203 __dynamic_array(u8, buf, buf_len) 210 memcpy(__get_dynamic_array(buf), buf, buf_len); 222 TP_PROTO(int status, int endpoint, void *buf, 225 TP_ARGS(status, endpoint, buf, buf_len), 231 __dynamic_array(u8, buf, buf_len) 238 memcpy(__get_dynamic_array(buf), buf, buf_len); 300 const void *buf, size_t buf_len), 302 TP_ARGS(msg, prefix, buf, buf_len), 308 __dynamic_array(u8, buf, buf_len) 315 memcpy(__get_dynamic_array(buf), buf, buf_len);
|
H A D | debug.c | 151 const void *buf, size_t len) ath6kl_dbg_dump() 157 print_hex_dump_bytes(prefix, DUMP_PREFIX_OFFSET, buf, len); ath6kl_dbg_dump() 162 buf, len); ath6kl_dbg_dump() 304 char *buf; read_file_war_stats() local 308 buf = kzalloc(buf_len, GFP_KERNEL); read_file_war_stats() 309 if (!buf) read_file_war_stats() 312 len += scnprintf(buf + len, buf_len - len, "\n"); read_file_war_stats() 313 len += scnprintf(buf + len, buf_len - len, "%25s\n", read_file_war_stats() 315 len += scnprintf(buf + len, buf_len - len, "%25s\n\n", read_file_war_stats() 317 len += scnprintf(buf + len, buf_len - len, "%20s %10u\n", read_file_war_stats() 323 ret_cnt = simple_read_from_buffer(user_buf, count, ppos, buf, len); read_file_war_stats() 325 kfree(buf); read_file_war_stats() 336 void ath6kl_debug_fwlog_event(struct ath6kl *ar, const void *buf, size_t len) ath6kl_debug_fwlog_event() argument 354 memcpy(slot->payload, buf, len); ath6kl_debug_fwlog_event() 405 char *buf; ath6kl_fwlog_read() local 407 buf = vmalloc(count); ath6kl_fwlog_read() 408 if (!buf) ath6kl_fwlog_read() 424 memcpy(buf + len, skb->data, skb->len); ath6kl_fwlog_read() 434 ret_cnt = simple_read_from_buffer(user_buf, count, ppos, buf, len); ath6kl_fwlog_read() 436 vfree(buf); ath6kl_fwlog_read() 458 char *buf; ath6kl_fwlog_block_read() local 461 buf = vmalloc(count); ath6kl_fwlog_block_read() 462 if (!buf) ath6kl_fwlog_block_read() 476 vfree(buf); ath6kl_fwlog_block_read() 491 memcpy(buf + len, skb->data, skb->len); ath6kl_fwlog_block_read() 501 not_copied = copy_to_user(user_buf, buf, len); ath6kl_fwlog_block_read() 512 vfree(buf); ath6kl_fwlog_block_read() 529 char buf[16]; ath6kl_fwlog_mask_read() local 532 len = snprintf(buf, sizeof(buf), "0x%x\n", ar->debug.fwlog_mask); ath6kl_fwlog_mask_read() 534 return simple_read_from_buffer(user_buf, count, ppos, buf, len); ath6kl_fwlog_mask_read() 571 char *buf; read_file_tgt_stats() local 581 buf = kzalloc(buf_len, GFP_KERNEL); read_file_tgt_stats() 582 if (!buf) read_file_tgt_stats() 587 kfree(buf); read_file_tgt_stats() 593 len += scnprintf(buf + len, buf_len - len, "\n"); read_file_tgt_stats() 594 len += scnprintf(buf + len, buf_len - len, "%25s\n", read_file_tgt_stats() 596 len += scnprintf(buf + len, buf_len - len, "%25s\n\n", read_file_tgt_stats() 598 len += scnprintf(buf + len, buf_len - len, "%20s %10llu\n", read_file_tgt_stats() 600 len += scnprintf(buf + len, buf_len - len, "%20s %10llu\n", read_file_tgt_stats() 602 len += scnprintf(buf + len, buf_len - len, "%20s %10llu\n", read_file_tgt_stats() 604 len += scnprintf(buf + len, buf_len - len, "%20s %10llu\n", read_file_tgt_stats() 606 len += scnprintf(buf + len, buf_len - len, "%20s %10llu\n", read_file_tgt_stats() 609 len += scnprintf(buf + len, buf_len - len, read_file_tgt_stats() 612 len += scnprintf(buf + len, buf_len - len, "%20s %10llu\n", read_file_tgt_stats() 614 len += scnprintf(buf + len, buf_len - len, "%20s %10llu\n", read_file_tgt_stats() 616 len += scnprintf(buf + len, buf_len - len, "%20s %10llu\n", read_file_tgt_stats() 618 len += scnprintf(buf + len, buf_len - len, "%20s %10llu\n", read_file_tgt_stats() 620 len += scnprintf(buf + len, buf_len - len, "%20s %10llu\n", read_file_tgt_stats() 622 len += scnprintf(buf + len, buf_len - len, "%25s %10llu\n\n", read_file_tgt_stats() 626 len += scnprintf(buf + len, buf_len - len, "%25s\n", read_file_tgt_stats() 628 len += scnprintf(buf + len, buf_len - len, "%25s\n", read_file_tgt_stats() 631 len += scnprintf(buf + len, buf_len - len, "%20s %10llu\n", read_file_tgt_stats() 633 len += scnprintf(buf + len, buf_len - len, "%20s %10d\n", read_file_tgt_stats() 635 len += scnprintf(buf + len, buf_len - len, "%20s %10llu\n", read_file_tgt_stats() 637 len += scnprintf(buf + len, buf_len - len, "%20s %10llu\n", read_file_tgt_stats() 639 len += scnprintf(buf + len, buf_len - len, "%20s %10llu\n", read_file_tgt_stats() 641 len += scnprintf(buf + len, buf_len - len, "%20s %10llu\n", read_file_tgt_stats() 643 len += scnprintf(buf + len, buf_len - len, "%20s %10llu\n", read_file_tgt_stats() 645 len += scnprintf(buf + len, buf_len - len, "%20s %10llu\n", read_file_tgt_stats() 647 len += scnprintf(buf + len, buf_len - len, "%20s %10llu\n", read_file_tgt_stats() 649 len += scnprintf(buf + len, buf_len - len, "%20s %10llu\n", read_file_tgt_stats() 651 len += scnprintf(buf + len, buf_len - len, "%20s %10llu\n", read_file_tgt_stats() 653 len += scnprintf(buf + len, buf_len - len, "%20s %10llu\n", read_file_tgt_stats() 655 len += scnprintf(buf + len, buf_len - len, "%20s %10llu\n", read_file_tgt_stats() 657 len += scnprintf(buf + len, buf_len - len, "%20s %10llu\n", read_file_tgt_stats() 659 len += scnprintf(buf + len, buf_len - len, "%20s %10llu\n\n", read_file_tgt_stats() 662 len += scnprintf(buf + len, buf_len - len, "%25s\n", read_file_tgt_stats() 664 len += scnprintf(buf + len, buf_len - len, "%25s\n", read_file_tgt_stats() 666 len += scnprintf(buf + len, buf_len - len, "%20s %10llu\n", read_file_tgt_stats() 668 len += scnprintf(buf + len, buf_len - len, "%20s %10llu\n", read_file_tgt_stats() 670 len += scnprintf(buf + len, buf_len - len, "%20s %10llu\n", read_file_tgt_stats() 672 len += scnprintf(buf + len, buf_len - len, "%20s %10d\n", read_file_tgt_stats() 674 len += scnprintf(buf + len, buf_len - len, "%20s %10d\n", read_file_tgt_stats() 676 len += scnprintf(buf + len, buf_len - len, "%20s %10d\n", read_file_tgt_stats() 678 len += scnprintf(buf + len, buf_len - len, "%20s %10d\n", read_file_tgt_stats() 684 ret_cnt = simple_read_from_buffer(user_buf, count, ppos, buf, len); read_file_tgt_stats() 686 kfree(buf); read_file_tgt_stats() 698 (len += scnprintf(buf + len, buf_len - len, fmt_str, \ 710 char *buf; read_file_credit_dist_stats() local 716 buf = kzalloc(buf_len, GFP_KERNEL); read_file_credit_dist_stats() 717 if (!buf) read_file_credit_dist_stats() 720 len += scnprintf(buf + len, buf_len - len, "%25s%5d\n", read_file_credit_dist_stats() 723 len += scnprintf(buf + len, buf_len - len, "%25s%5d\n", read_file_credit_dist_stats() 727 len += scnprintf(buf + len, buf_len - len, read_file_credit_dist_stats() 743 len += scnprintf(buf + len, buf_len - len, "%12d\n", read_file_credit_dist_stats() 750 ret_cnt = simple_read_from_buffer(user_buf, count, ppos, buf, len); read_file_credit_dist_stats() 751 kfree(buf); read_file_credit_dist_stats() 762 static unsigned int print_endpoint_stat(struct htc_target *target, char *buf, print_endpoint_stat() argument 770 len += scnprintf(buf + len, buf_len - len, "%s:", name); print_endpoint_stat() 774 len += scnprintf(buf + len, buf_len - len, " %u", *counter); print_endpoint_stat() 776 len += scnprintf(buf + len, buf_len - len, "\n"); print_endpoint_stat() 787 char *buf; ath6kl_endpoint_stats_read() local 793 buf = kmalloc(buf_len, GFP_KERNEL); ath6kl_endpoint_stats_read() 794 if (!buf) ath6kl_endpoint_stats_read() 799 len = print_endpoint_stat(target, buf, buf_len, len, \ ath6kl_endpoint_stats_read() 831 ret_cnt = simple_read_from_buffer(user_buf, count, ppos, buf, len); ath6kl_endpoint_stats_read() 832 kfree(buf); ath6kl_endpoint_stats_read() 896 u8 buf[50]; ath6kl_regread_read() local 900 len += scnprintf(buf + len, sizeof(buf) - len, "0x%x\n", ath6kl_regread_read() 903 len += scnprintf(buf + len, sizeof(buf) - len, ath6kl_regread_read() 906 return simple_read_from_buffer(user_buf, count, ppos, buf, len); ath6kl_regread_read() 941 u8 *buf; ath6kl_regdump_open() local 958 buf = vmalloc(reg_len); ath6kl_regdump_open() 959 if (!buf) ath6kl_regdump_open() 971 len += scnprintf(buf + len, reg_len - len, ath6kl_regdump_open() 977 len += scnprintf(buf + len, reg_len - len, ath6kl_regdump_open() 987 len += scnprintf(buf + len, reg_len - len, ath6kl_regdump_open() 994 file->private_data = buf; ath6kl_regdump_open() 999 vfree(buf); ath6kl_regdump_open() 1006 u8 *buf = file->private_data; ath6kl_regdump_read() local 1007 return simple_read_from_buffer(user_buf, count, ppos, buf, strlen(buf)); ath6kl_regdump_read() 1046 char buf[32]; ath6kl_lrssi_roam_read() local 1049 len = snprintf(buf, sizeof(buf), "%u\n", ar->lrssi_roam_threshold); ath6kl_lrssi_roam_read() 1051 return simple_read_from_buffer(user_buf, count, ppos, buf, len); ath6kl_lrssi_roam_read() 1067 u8 buf[32]; ath6kl_regwrite_read() local 1070 len = scnprintf(buf, sizeof(buf), "Addr: 0x%x Val: 0x%x\n", ath6kl_regwrite_read() 1073 return simple_read_from_buffer(user_buf, count, ppos, buf, len); ath6kl_regwrite_read() 1081 char buf[32]; ath6kl_regwrite_write() local 1086 len = min(count, sizeof(buf) - 1); ath6kl_regwrite_write() 1087 if (copy_from_user(buf, user_buf, len)) ath6kl_regwrite_write() 1090 buf[len] = '\0'; ath6kl_regwrite_write() 1091 sptr = buf; ath6kl_regwrite_write() 1124 int ath6kl_debug_roam_tbl_event(struct ath6kl *ar, const void *buf, ath6kl_debug_roam_tbl_event() argument 1133 tbl = (const struct wmi_target_roam_tbl *) buf; ath6kl_debug_roam_tbl_event() 1147 memcpy(ar->debug.roam_tbl, buf, len); ath6kl_debug_roam_tbl_event() 1166 char *buf; ath6kl_roam_table_read() local 1195 buf = kzalloc(buf_len, GFP_KERNEL); ath6kl_roam_table_read() 1196 if (buf == NULL) ath6kl_roam_table_read() 1199 len += scnprintf(buf + len, buf_len - len, ath6kl_roam_table_read() 1206 len += scnprintf(buf + len, buf_len - len, ath6kl_roam_table_read() 1216 ret_cnt = simple_read_from_buffer(user_buf, count, ppos, buf, len); ath6kl_roam_table_read() 1218 kfree(buf); ath6kl_roam_table_read() 1235 char buf[20]; ath6kl_force_roam_write() local 1239 len = min(count, sizeof(buf) - 1); ath6kl_force_roam_write() 1240 if (copy_from_user(buf, user_buf, len)) ath6kl_force_roam_write() 1242 buf[len] = '\0'; ath6kl_force_roam_write() 1244 if (!mac_pton(buf, bssid)) ath6kl_force_roam_write() 1267 char buf[20]; ath6kl_roam_mode_write() local 1271 len = min(count, sizeof(buf) - 1); ath6kl_roam_mode_write() 1272 if (copy_from_user(buf, user_buf, len)) ath6kl_roam_mode_write() 1274 buf[len] = '\0'; ath6kl_roam_mode_write() 1275 if (len > 0 && buf[len - 1] == '\n') ath6kl_roam_mode_write() 1276 buf[len - 1] = '\0'; ath6kl_roam_mode_write() 1278 if (strcasecmp(buf, "default") == 0) ath6kl_roam_mode_write() 1280 else if (strcasecmp(buf, "bssbias") == 0) ath6kl_roam_mode_write() 1282 else if (strcasecmp(buf, "lock") == 0) ath6kl_roam_mode_write() 1310 char buf[16]; ath6kl_keepalive_read() local 1313 len = snprintf(buf, sizeof(buf), "%u\n", ar->debug.keepalive); ath6kl_keepalive_read() 1315 return simple_read_from_buffer(user_buf, count, ppos, buf, len); ath6kl_keepalive_read() 1355 char buf[16]; ath6kl_disconnect_timeout_read() local 1358 len = snprintf(buf, sizeof(buf), "%u\n", ar->debug.disc_timeout); ath6kl_disconnect_timeout_read() 1360 return simple_read_from_buffer(user_buf, count, ppos, buf, len); ath6kl_disconnect_timeout_read() 1396 char buf[200]; ath6kl_create_qos_write() local 1407 len = min(count, sizeof(buf) - 1); ath6kl_create_qos_write() 1408 if (copy_from_user(buf, user_buf, len)) ath6kl_create_qos_write() 1410 buf[len] = '\0'; ath6kl_create_qos_write() 1411 sptr = buf; ath6kl_create_qos_write() 1574 char buf[100]; ath6kl_delete_qos_write() local 1584 len = min(count, sizeof(buf) - 1); ath6kl_delete_qos_write() 1585 if (copy_from_user(buf, user_buf, len)) ath6kl_delete_qos_write() 1587 buf[len] = '\0'; ath6kl_delete_qos_write() 1588 sptr = buf; ath6kl_delete_qos_write() 1622 char buf[32]; ath6kl_bgscan_int_write() local 1629 len = min(count, sizeof(buf) - 1); ath6kl_bgscan_int_write() 1630 if (copy_from_user(buf, user_buf, len)) ath6kl_bgscan_int_write() 1633 buf[len] = '\0'; ath6kl_bgscan_int_write() 1634 if (kstrtou16(buf, 0, &bgscan_int)) ath6kl_bgscan_int_write() 1662 char buf[32]; ath6kl_listen_int_write() local 1669 len = min(count, sizeof(buf) - 1); ath6kl_listen_int_write() 1670 if (copy_from_user(buf, user_buf, len)) ath6kl_listen_int_write() 1673 buf[len] = '\0'; ath6kl_listen_int_write() 1674 if (kstrtou16(buf, 0, &listen_interval)) ath6kl_listen_int_write() 1693 char buf[32]; ath6kl_listen_int_read() local 1700 len = scnprintf(buf, sizeof(buf), "%u\n", vif->listen_intvl_t); ath6kl_listen_int_read() 1702 return simple_read_from_buffer(user_buf, count, ppos, buf, len); ath6kl_listen_int_read() 1718 u8 buf[100]; ath6kl_power_params_write() local 1724 len = min(count, sizeof(buf) - 1); ath6kl_power_params_write() 1725 if (copy_from_user(buf, user_buf, len)) ath6kl_power_params_write() 1727 buf[len] = '\0'; ath6kl_power_params_write() 1728 sptr = buf; ath6kl_power_params_write() 149 ath6kl_dbg_dump(enum ATH6K_DEBUG_MASK mask, const char *msg, const char *prefix, const void *buf, size_t len) ath6kl_dbg_dump() argument
|
/linux-4.4.14/drivers/dio/ |
H A D | dio-sysfs.c | 20 static ssize_t dio_show_id(struct device *dev, struct device_attribute *attr, char *buf) dio_show_id() argument 25 return sprintf(buf, "0x%02x\n", (d->id & 0xff)); dio_show_id() 29 static ssize_t dio_show_ipl(struct device *dev, struct device_attribute *attr, char *buf) dio_show_ipl() argument 34 return sprintf(buf, "0x%02x\n", d->ipl); dio_show_ipl() 38 static ssize_t dio_show_secid(struct device *dev, struct device_attribute *attr, char *buf) dio_show_secid() argument 43 return sprintf(buf, "0x%02x\n", ((d->id >> 8)& 0xff)); dio_show_secid() 47 static ssize_t dio_show_name(struct device *dev, struct device_attribute *attr, char *buf) dio_show_name() argument 52 return sprintf(buf, "%s\n", d->name); dio_show_name() 56 static ssize_t dio_show_resource(struct device *dev, struct device_attribute *attr, char *buf) dio_show_resource() argument 60 return sprintf(buf, "0x%08lx 0x%08lx 0x%08lx\n", dio_show_resource()
|
/linux-4.4.14/drivers/acpi/ |
H A D | custom_method.c | 25 static char *buf; cm_write() local 40 buf = kzalloc(max_size, GFP_KERNEL); cm_write() 41 if (!buf) cm_write() 45 if (buf == NULL) cm_write() 54 if (copy_from_user(buf + (*ppos), user_buf, count)) { cm_write() 55 kfree(buf); cm_write() 56 buf = NULL; cm_write() 64 status = acpi_install_method(buf); cm_write() 65 kfree(buf); cm_write() 66 buf = NULL; cm_write()
|
H A D | bgrt.c | 20 struct device_attribute *attr, char *buf) show_version() 22 return snprintf(buf, PAGE_SIZE, "%d\n", bgrt_tab->version); show_version() 27 struct device_attribute *attr, char *buf) show_status() 29 return snprintf(buf, PAGE_SIZE, "%d\n", bgrt_tab->status); show_status() 34 struct device_attribute *attr, char *buf) show_type() 36 return snprintf(buf, PAGE_SIZE, "%d\n", bgrt_tab->image_type); show_type() 41 struct device_attribute *attr, char *buf) show_xoffset() 43 return snprintf(buf, PAGE_SIZE, "%d\n", bgrt_tab->image_offset_x); show_xoffset() 48 struct device_attribute *attr, char *buf) show_yoffset() 50 return snprintf(buf, PAGE_SIZE, "%d\n", bgrt_tab->image_offset_y); show_yoffset() 55 struct bin_attribute *attr, char *buf, loff_t off, size_t count) image_read() 57 memcpy(buf, attr->private + off, count); image_read() 19 show_version(struct device *dev, struct device_attribute *attr, char *buf) show_version() argument 26 show_status(struct device *dev, struct device_attribute *attr, char *buf) show_status() argument 33 show_type(struct device *dev, struct device_attribute *attr, char *buf) show_type() argument 40 show_xoffset(struct device *dev, struct device_attribute *attr, char *buf) show_xoffset() argument 47 show_yoffset(struct device *dev, struct device_attribute *attr, char *buf) show_yoffset() argument 54 image_read(struct file *file, struct kobject *kobj, struct bin_attribute *attr, char *buf, loff_t off, size_t count) image_read() argument
|
/linux-4.4.14/lib/ |
H A D | halfmd4.c | 26 __u32 half_md4_transform(__u32 buf[4], __u32 const in[8]) half_md4_transform() argument 28 __u32 a = buf[0], b = buf[1], c = buf[2], d = buf[3]; half_md4_transform() 60 buf[0] += a; half_md4_transform() 61 buf[1] += b; half_md4_transform() 62 buf[2] += c; half_md4_transform() 63 buf[3] += d; half_md4_transform() 65 return buf[1]; /* "most hashed" word */ half_md4_transform()
|
H A D | test-hexdump.c | 119 char buf[56]; test_hexdump_overflow() local 121 size_t l = get_random_int() % sizeof(buf); test_hexdump_overflow() 125 memset(buf, ' ', sizeof(buf)); test_hexdump_overflow() 127 r = hex_dump_to_buffer(data_b, 1, 16, 1, buf, l, ascii); test_hexdump_overflow() 133 buf[e + 2] = '\0'; test_hexdump_overflow() 136 a = r == e && buf[0] == ' '; test_hexdump_overflow() 138 a = r == e && buf[0] == '\0'; test_hexdump_overflow() 140 a = r == e && !strcmp(buf, t); test_hexdump_overflow() 143 a = r == e && buf[l - 1] == '\0' && buf[l - 2] == ' '; test_hexdump_overflow() 145 a = r == e && buf[50] == '\0' && buf[49] == '.'; test_hexdump_overflow() 147 a = r == e && buf[e] == '\0'; test_hexdump_overflow() 151 pr_err("Len: %zu rc: %u strlen: %zu\n", l, r, strlen(buf)); test_hexdump_overflow() 152 pr_err("Result: '%s'\n", buf); test_hexdump_overflow()
|
H A D | vsprintf.c | 170 * one of them accounted for in buf. This is needed by ip4_string 174 char *put_dec_trunc8(char *buf, unsigned r) put_dec_trunc8() argument 184 *((u16 *)buf) = decpair[r - 100*q]; put_dec_trunc8() 185 buf += 2; put_dec_trunc8() 193 *((u16 *)buf) = decpair[q - 100*r]; put_dec_trunc8() 194 buf += 2; put_dec_trunc8() 202 *((u16 *)buf) = decpair[r - 100*q]; put_dec_trunc8() 203 buf += 2; put_dec_trunc8() 209 *((u16 *)buf) = decpair[r]; put_dec_trunc8() 210 buf += r < 10 ? 1 : 2; put_dec_trunc8() 211 return buf; put_dec_trunc8() 216 char *put_dec_full8(char *buf, unsigned r) put_dec_full8() argument 222 *((u16 *)buf) = decpair[r - 100*q]; put_dec_full8() 223 buf += 2; put_dec_full8() 227 *((u16 *)buf) = decpair[q - 100*r]; put_dec_full8() 228 buf += 2; put_dec_full8() 232 *((u16 *)buf) = decpair[r - 100*q]; put_dec_full8() 233 buf += 2; put_dec_full8() 236 *((u16 *)buf) = decpair[q]; put_dec_full8() 237 buf += 2; put_dec_full8() 238 return buf; put_dec_full8() 242 char *put_dec(char *buf, unsigned long long n) put_dec() argument 245 buf = put_dec_full8(buf, do_div(n, 100*1000*1000)); put_dec() 248 buf = put_dec_full8(buf, do_div(n, 100*1000*1000)); put_dec() 250 return put_dec_trunc8(buf, n); put_dec() 256 put_dec_full4(char *buf, unsigned r) put_dec_full4() argument 262 *((u16 *)buf) = decpair[r - 100*q]; put_dec_full4() 263 buf += 2; put_dec_full4() 265 *((u16 *)buf) = decpair[q]; put_dec_full4() 276 unsigned put_dec_helper4(char *buf, unsigned x) put_dec_helper4() argument 280 put_dec_full4(buf, x - q * 10000); put_dec_helper4() 290 char *put_dec(char *buf, unsigned long long n) put_dec() argument 295 return put_dec_trunc8(buf, n); put_dec() 305 q = put_dec_helper4(buf, q); put_dec() 308 q = put_dec_helper4(buf+4, q); put_dec() 311 q = put_dec_helper4(buf+8, q); put_dec() 314 buf += 12; put_dec() 316 buf = put_dec_trunc8(buf, q); put_dec() 317 else while (buf[-1] == '0') put_dec() 318 --buf; put_dec() 320 return buf; put_dec() 331 int num_to_str(char *buf, int size, unsigned long long num) num_to_str() argument 348 buf[idx] = tmp[len - idx - 1]; num_to_str() 392 char *number(char *buf, char *end, unsigned long long num, number() argument 454 if (buf < end) number() 455 *buf = ' '; number() 456 ++buf; number() 461 if (buf < end) number() 462 *buf = sign; number() 463 ++buf; number() 468 if (buf < end) number() 469 *buf = '0'; number() 470 ++buf; number() 473 if (buf < end) number() 474 *buf = ('X' | locase); number() 475 ++buf; number() 483 if (buf < end) number() 484 *buf = c; number() 485 ++buf; number() 490 if (buf < end) number() 491 *buf = '0'; number() 492 ++buf; number() 496 if (buf < end) number() 497 *buf = tmp[i]; number() 498 ++buf; number() 502 if (buf < end) number() 503 *buf = ' '; number() 504 ++buf; number() 507 return buf; number() 511 char *string(char *buf, char *end, const char *s, struct printf_spec spec) string() argument 522 if (buf < end) string() 523 *buf = ' '; string() 524 ++buf; string() 528 if (buf < end) string() 529 *buf = *s; string() 530 ++buf; ++s; string() 533 if (buf < end) string() 534 *buf = ' '; string() 535 ++buf; string() 538 return buf; string() 541 static void widen(char *buf, char *end, unsigned len, unsigned spaces) widen() argument 544 if (buf >= end) /* nowhere to put anything */ widen() 546 size = end - buf; widen() 548 memset(buf, ' ', size); widen() 554 memmove(buf + spaces, buf, len); widen() 556 memset(buf, ' ', spaces); widen() 560 char *dentry_name(char *buf, char *end, const struct dentry *d, struct printf_spec spec, dentry_name() argument 588 for (n = 0; n != spec.precision; n++, buf++) { dentry_name() 596 if (buf < end) dentry_name() 597 *buf = c; dentry_name() 604 widen(buf - n, end, n, spaces); dentry_name() 605 return buf + spaces; dentry_name() 608 if (buf < end) dentry_name() 609 *buf = ' '; dentry_name() 610 ++buf; dentry_name() 613 return buf; dentry_name() 617 char *symbol_string(char *buf, char *end, void *ptr, symbol_string() argument 637 return string(buf, end, sym, spec); symbol_string() 643 return number(buf, end, value, spec); symbol_string() 648 char *resource_string(char *buf, char *end, struct resource *res, resource_string() argument 752 return string(buf, end, sym, spec); resource_string() 756 char *hex_string(char *buf, char *end, u8 *addr, struct printf_spec spec, hex_string() argument 765 return buf; hex_string() 769 return string(buf, end, NULL, spec); hex_string() 790 if (buf < end) hex_string() 791 *buf = hex_asc_hi(addr[i]); hex_string() 792 ++buf; hex_string() 793 if (buf < end) hex_string() 794 *buf = hex_asc_lo(addr[i]); hex_string() 795 ++buf; hex_string() 798 if (buf < end) hex_string() 799 *buf = separator; hex_string() 800 ++buf; hex_string() 804 return buf; hex_string() 808 char *bitmap_string(char *buf, char *end, unsigned long *bitmap, bitmap_string() argument 834 if (buf < end) bitmap_string() 835 *buf = ','; bitmap_string() 836 buf++; bitmap_string() 841 buf = number(buf, end, val, spec); bitmap_string() 845 return buf; bitmap_string() 849 char *bitmap_list_string(char *buf, char *end, unsigned long *bitmap, bitmap_list_string() argument 868 if (buf < end) bitmap_list_string() 869 *buf = ','; bitmap_list_string() 870 buf++; bitmap_list_string() 874 buf = number(buf, end, rbot, spec); bitmap_list_string() 876 if (buf < end) bitmap_list_string() 877 *buf = '-'; bitmap_list_string() 878 buf++; bitmap_list_string() 880 buf = number(buf, end, rtop, spec); bitmap_list_string() 885 return buf; bitmap_list_string() 889 char *mac_address_string(char *buf, char *end, u8 *addr, mac_address_string() argument 923 return string(buf, end, mac_addr, spec); mac_address_string() 1076 char *ip6_addr_string(char *buf, char *end, const u8 *addr, ip6_addr_string() argument 1086 return string(buf, end, ip6_addr, spec); ip6_addr_string() 1090 char *ip4_addr_string(char *buf, char *end, const u8 *addr, ip4_addr_string() argument 1097 return string(buf, end, ip4_addr, spec); ip4_addr_string() 1101 char *ip6_addr_string_sa(char *buf, char *end, const struct sockaddr_in6 *sa, ip6_addr_string_sa() argument 1159 return string(buf, end, ip6_addr, spec); ip6_addr_string_sa() 1163 char *ip4_addr_string_sa(char *buf, char *end, const struct sockaddr_in *sa, ip4_addr_string_sa() argument 1194 return string(buf, end, ip4_addr, spec); ip4_addr_string_sa() 1198 char *escaped_string(char *buf, char *end, u8 *addr, struct printf_spec spec, escaped_string() argument 1207 return buf; /* nothing to print */ escaped_string() 1210 return string(buf, end, NULL, spec); /* NULL pointer */ escaped_string() 1252 buf += string_escape_mem(addr, len, buf, buf < end ? end - buf : 0, flags, NULL); escaped_string() 1254 return buf; escaped_string() 1258 char *uuid_string(char *buf, char *end, const u8 *addr, uuid_string() argument 1301 return string(buf, end, uuid, spec); uuid_string() 1305 char *netdev_feature_string(char *buf, char *end, const u8 *addr, netdev_feature_string() argument 1313 return number(buf, end, *(const netdev_features_t *)addr, spec); netdev_feature_string() 1317 char *address_val(char *buf, char *end, const void *addr, address_val() argument 1337 return number(buf, end, num, spec); address_val() 1341 char *clock(char *buf, char *end, struct clk *clk, struct printf_spec spec, clock() argument 1345 return string(buf, end, NULL, spec); clock() 1349 return number(buf, end, clk_get_rate(clk), spec); clock() 1354 return string(buf, end, __clk_get_name(clk), spec); clock() 1359 return number(buf, end, (unsigned long)clk, spec); clock() 1459 char *pointer(const char *fmt, char *buf, char *end, void *ptr, pointer() argument 1471 return string(buf, end, "(null)", spec); pointer() 1482 return symbol_string(buf, end, ptr, spec, fmt); pointer() 1485 return resource_string(buf, end, ptr, spec, fmt); pointer() 1487 return hex_string(buf, end, ptr, spec, fmt); pointer() 1491 return bitmap_list_string(buf, end, ptr, spec, fmt); pointer() 1493 return bitmap_string(buf, end, ptr, spec, fmt); pointer() 1499 return mac_address_string(buf, end, ptr, spec, fmt); pointer() 1511 return ip6_addr_string(buf, end, ptr, spec, fmt); pointer() 1513 return ip4_addr_string(buf, end, ptr, spec, fmt); pointer() 1523 return ip4_addr_string_sa(buf, end, &sa->v4, spec, fmt); pointer() 1525 return ip6_addr_string_sa(buf, end, &sa->v6, spec, fmt); pointer() 1527 return string(buf, end, "(invalid address)", spec); pointer() 1532 return escaped_string(buf, end, ptr, spec, fmt); pointer() 1534 return uuid_string(buf, end, ptr, spec, fmt); pointer() 1540 buf += vsnprintf(buf, end > buf ? end - buf : 0, pointer() 1543 return buf; pointer() 1554 return string(buf, end, "pK-error", spec); pointer() 1590 return netdev_feature_string(buf, end, ptr, spec); pointer() 1594 return address_val(buf, end, ptr, spec, fmt); pointer() 1596 return dentry_name(buf, end, ptr, spec, fmt); pointer() 1598 return clock(buf, end, ptr, spec, fmt); pointer() 1600 return dentry_name(buf, end, pointer() 1611 return number(buf, end, (unsigned long) ptr, spec); pointer() 1811 * @buf: The buffer to place the result into 1830 * number of characters written into @buf as return value 1837 int vsnprintf(char *buf, size_t size, const char *fmt, va_list args) vsnprintf() argument 1848 str = buf; vsnprintf() 1849 end = buf + size; vsnprintf() 1851 /* Make sure end is always >= buf */ vsnprintf() 1852 if (end < buf) { vsnprintf() 1854 size = end - buf; vsnprintf() 1986 return str-buf; vsnprintf() 1993 * @buf: The buffer to place the result into 1999 * the @buf not including the trailing '\0'. If @size is == 0 the function 2006 int vscnprintf(char *buf, size_t size, const char *fmt, va_list args) vscnprintf() argument 2010 i = vsnprintf(buf, size, fmt, args); vscnprintf() 2022 * @buf: The buffer to place the result into 2034 int snprintf(char *buf, size_t size, const char *fmt, ...) snprintf() argument 2040 i = vsnprintf(buf, size, fmt, args); snprintf() 2049 * @buf: The buffer to place the result into 2054 * The return value is the number of characters written into @buf not including 2058 int scnprintf(char *buf, size_t size, const char *fmt, ...) scnprintf() argument 2064 i = vscnprintf(buf, size, fmt, args); scnprintf() 2073 * @buf: The buffer to place the result into 2078 * into @buf. Use vsnprintf() or vscnprintf() in order to avoid 2085 int vsprintf(char *buf, const char *fmt, va_list args) vsprintf() argument 2087 return vsnprintf(buf, INT_MAX, fmt, args); vsprintf() 2093 * @buf: The buffer to place the result into 2098 * into @buf. Use snprintf() or scnprintf() in order to avoid 2103 int sprintf(char *buf, const char *fmt, ...) sprintf() argument 2109 i = vsnprintf(buf, INT_MAX, fmt, args); sprintf() 2248 * @buf: The buffer to place the result into 2263 * number of characters written into @buf as return value 2268 int bstr_printf(char *buf, size_t size, const char *fmt, const u32 *bin_buf) bstr_printf() argument 2277 str = buf; bstr_printf() 2278 end = buf + size; bstr_printf() 2295 /* Make sure end is always >= buf */ bstr_printf() 2296 if (end < buf) { bstr_printf() 2298 size = end - buf; bstr_printf() 2424 return str - buf; bstr_printf() 2455 * @buf: input buffer 2459 int vsscanf(const char *buf, const char *fmt, va_list args) vsscanf() argument 2461 const char *str = buf; vsscanf() 2537 *va_arg(args, int *) = str - buf; vsscanf() 2684 * @buf: input buffer 2688 int sscanf(const char *buf, const char *fmt, ...) sscanf() argument 2694 i = vsscanf(buf, fmt, args); sscanf()
|
/linux-4.4.14/drivers/usb/host/ |
H A D | uhci-debug.c | 26 static void lprintk(char *buf) lprintk() argument 31 while (buf) { lprintk() 32 p = strchr(buf, '\n'); lprintk() 35 printk(KERN_DEBUG "%s\n", buf); lprintk() 36 buf = p; lprintk() 37 if (buf) lprintk() 38 buf++; lprintk() 42 static int uhci_show_td(struct uhci_hcd *uhci, struct uhci_td *td, char *buf, uhci_show_td() argument 45 char *out = buf; uhci_show_td() 65 if (out - buf > len) uhci_show_td() 91 out += sprintf(out, "(buf=%08x)\n", hc32_to_cpu(uhci, td->buffer)); uhci_show_td() 94 if (out - buf > len) uhci_show_td() 96 return out - buf; uhci_show_td() 100 char *buf, int len, int space) uhci_show_urbp() 102 char *out = buf; uhci_show_urbp() 114 if (out - buf > len) uhci_show_urbp() 134 if (out - buf > len) uhci_show_urbp() 143 len - (out - buf), 0); uhci_show_urbp() 144 if (out - buf > len) uhci_show_urbp() 158 if (out - buf > len) uhci_show_urbp() 161 return out - buf; uhci_show_urbp() 165 struct uhci_qh *qh, char *buf, int len, int space) uhci_show_qh() 167 char *out = buf; uhci_show_qh() 192 if (out - buf > len) uhci_show_qh() 207 if (out - buf > len) uhci_show_qh() 214 len - (out - buf), 0); uhci_show_qh() 215 if (out - buf > len) uhci_show_qh() 231 len - (out - buf), space + 2); uhci_show_qh() 232 if (out - buf > len) uhci_show_qh() 243 if (out - buf > len) uhci_show_qh() 249 len - (out - buf), 0); uhci_show_qh() 250 if (out - buf > len) uhci_show_qh() 255 if (out - buf > len) uhci_show_qh() 258 return out - buf; uhci_show_qh() 261 static int uhci_show_sc(int port, unsigned short status, char *buf) uhci_show_sc() argument 263 return sprintf(buf, " stat%d = %04x %s%s%s%s%s%s%s%s%s%s\n", uhci_show_sc() 278 static int uhci_show_root_hub_state(struct uhci_hcd *uhci, char *buf) uhci_show_root_hub_state() argument 300 return sprintf(buf, "Root-hub state: %s FSBR: %d\n", uhci_show_root_hub_state() 304 static int uhci_show_status(struct uhci_hcd *uhci, char *buf, int len) uhci_show_status() argument 306 char *out = buf; uhci_show_status() 332 if (out - buf > len) uhci_show_status() 343 if (out - buf > len) uhci_show_status() 351 if (out - buf > len) uhci_show_status() 355 if (out - buf > len) uhci_show_status() 359 if (out - buf > len) uhci_show_status() 368 if (out - buf > len) uhci_show_status() 370 return out - buf; uhci_show_status() 373 static int uhci_sprint_schedule(struct uhci_hcd *uhci, char *buf, int len) uhci_sprint_schedule() argument 375 char *out = buf; uhci_sprint_schedule() 390 if (out - buf > len) uhci_sprint_schedule() 393 out += uhci_show_status(uhci, out, len - (out - buf)); uhci_sprint_schedule() 394 if (out - buf > len) uhci_sprint_schedule() 416 if (out - buf > len) uhci_sprint_schedule() 439 if (out - buf > len) uhci_sprint_schedule() 446 len - (out - buf), 4); uhci_sprint_schedule() 447 if (out - buf > len) uhci_sprint_schedule() 466 if (out - buf > len) uhci_sprint_schedule() 478 if (out - buf > len) uhci_sprint_schedule() 487 out += uhci_show_qh(uhci, qh, out, len - (out - buf), 4); uhci_sprint_schedule() 488 if (out - buf > len) uhci_sprint_schedule() 496 if (out - buf > len) uhci_sprint_schedule() 513 len - (out - buf), 4); uhci_sprint_schedule() 514 if (out - buf > len) uhci_sprint_schedule() 537 if (out - buf > len) uhci_sprint_schedule() 542 if (out - buf > len) uhci_sprint_schedule() 545 return out - buf; uhci_sprint_schedule() 610 static ssize_t uhci_debug_read(struct file *file, char __user *buf, uhci_debug_read() argument 614 return simple_read_from_buffer(buf, nbytes, ppos, up->data, up->size); uhci_debug_read() 640 static inline void lprintk(char *buf) lprintk() argument 644 struct uhci_qh *qh, char *buf, int len, int space) uhci_show_qh() 650 char *buf, int len) uhci_sprint_schedule() 99 uhci_show_urbp(struct uhci_hcd *uhci, struct urb_priv *urbp, char *buf, int len, int space) uhci_show_urbp() argument 164 uhci_show_qh(struct uhci_hcd *uhci, struct uhci_qh *qh, char *buf, int len, int space) uhci_show_qh() argument 643 uhci_show_qh(struct uhci_hcd *uhci, struct uhci_qh *qh, char *buf, int len, int space) uhci_show_qh() argument 649 uhci_sprint_schedule(struct uhci_hcd *uhci, char *buf, int len) uhci_sprint_schedule() argument
|
/linux-4.4.14/drivers/net/wireless/ath/carl9170/ |
H A D | debug.c | 47 #define ADD(buf, off, max, fmt, args...) \ 48 off += snprintf(&buf[off], max - off, fmt, ##args); 54 char *(*read)(struct ar9170 *ar, char *buf, size_t bufsize, 56 ssize_t (*write)(struct ar9170 *aru, const char *buf, size_t size); 67 char *buf = NULL, *res_buf = NULL; carl9170_debugfs_read() local 84 buf = vmalloc(dfops->read_bufsize); carl9170_debugfs_read() 85 if (!buf) carl9170_debugfs_read() 92 res_buf = buf; carl9170_debugfs_read() 96 res_buf = dfops->read(ar, buf, dfops->read_bufsize, &ret); carl9170_debugfs_read() 104 WARN_ON_ONCE(dfops->read_bufsize && (res_buf != buf)); carl9170_debugfs_read() 117 char *buf = NULL; carl9170_debugfs_write() local 135 buf = vmalloc(count); carl9170_debugfs_write() 136 if (!buf) carl9170_debugfs_write() 139 if (copy_from_user(buf, userbuf, count)) { carl9170_debugfs_write() 154 err = dfops->write(ar, buf, count); carl9170_debugfs_write() 162 vfree(buf); carl9170_debugfs_write() 206 char *buf, size_t buf_size,\ 209 ADD(buf, *len, buf_size, fmt "\n", ##value); \ 210 return buf; \ 214 static char *carl9170_debugfs_mem_usage_read(struct ar9170 *ar, char *buf, carl9170_debugfs_mem_usage_read() argument 219 ADD(buf, *len, bufsize, "jar: [%*pb]\n", carl9170_debugfs_mem_usage_read() 222 ADD(buf, *len, bufsize, "cookies: used:%3d / total:%3d, allocs:%d\n", carl9170_debugfs_mem_usage_read() 226 ADD(buf, *len, bufsize, "memory: free:%3d (%3d KiB) / total:%3d KiB)\n", carl9170_debugfs_mem_usage_read() 233 return buf; carl9170_debugfs_mem_usage_read() 237 static char *carl9170_debugfs_qos_stat_read(struct ar9170 *ar, char *buf, carl9170_debugfs_qos_stat_read() argument 240 ADD(buf, *len, bufsize, "%s QoS AC\n", modparam_noht ? "Hardware" : carl9170_debugfs_qos_stat_read() 243 ADD(buf, *len, bufsize, "[ VO VI " carl9170_debugfs_qos_stat_read() 247 ADD(buf, *len, bufsize, "[length/limit length/limit " carl9170_debugfs_qos_stat_read() 256 ADD(buf, *len, bufsize, "[ total total " carl9170_debugfs_qos_stat_read() 264 ADD(buf, *len, bufsize, "[ pend/waittx pend/waittx " carl9170_debugfs_qos_stat_read() 277 return buf; carl9170_debugfs_qos_stat_read() 282 struct sk_buff *skb, const char *prefix, char *buf, carl9170_debugfs_format_frame() 290 ADD(buf, *off, bufsize, "%s %p, c:%2x, DA:%pM, sq:%4d, mc:%.4x, " carl9170_debugfs_format_frame() 298 static char *carl9170_debugfs_ampdu_state_read(struct ar9170 *ar, char *buf, carl9170_debugfs_ampdu_state_read() argument 310 ADD(buf, *len, bufsize, "Entry: #%2d TID:%1d, BSN:%4d, " carl9170_debugfs_ampdu_state_read() 315 ADD(buf, *len, bufsize, "\tWindow: [%*pb,W]\n", carl9170_debugfs_ampdu_state_read() 323 ADD(buf, *len, bufsize, "\tBase Seq: %*s\n", offset, "T"); carl9170_debugfs_ampdu_state_read() 326 ADD(buf, *len, bufsize, "\tNext Seq: %*s\n", offset, "W"); carl9170_debugfs_ampdu_state_read() 330 ADD(buf, *len, bufsize, "\tLast Seq: %*s\n", offset, "N"); carl9170_debugfs_ampdu_state_read() 332 ADD(buf, *len, bufsize, "\tPre-Aggregation reorder buffer: " carl9170_debugfs_ampdu_state_read() 340 carl9170_debugfs_format_frame(ar, skb, prefix, buf, carl9170_debugfs_ampdu_state_read() 350 return buf; carl9170_debugfs_ampdu_state_read() 354 static void carl9170_debugfs_queue_dump(struct ar9170 *ar, char *buf, carl9170_debugfs_queue_dump() argument 364 carl9170_debugfs_format_frame(ar, skb, prefix, buf, skb_queue_walk() 373 char *buf, size_t bufsize, ssize_t *len) \ 375 carl9170_debugfs_queue_dump(ar, buf, len, bufsize, &ar->q[qi]); \ 376 return buf; \ 380 static char *carl9170_debugfs_sta_psm_read(struct ar9170 *ar, char *buf, carl9170_debugfs_sta_psm_read() argument 383 ADD(buf, *len, bufsize, "psm state: %s\n", (ar->ps.off_override ? carl9170_debugfs_sta_psm_read() 386 ADD(buf, *len, bufsize, "sleep duration: %d ms.\n", ar->ps.sleep_ms); carl9170_debugfs_sta_psm_read() 387 ADD(buf, *len, bufsize, "last power-state transition: %d ms ago.\n", carl9170_debugfs_sta_psm_read() 389 ADD(buf, *len, bufsize, "last CAM->PSM transition: %d ms ago.\n", carl9170_debugfs_sta_psm_read() 392 return buf; carl9170_debugfs_sta_psm_read() 396 static char *carl9170_debugfs_tx_stuck_read(struct ar9170 *ar, char *buf, carl9170_debugfs_tx_stuck_read() argument 402 ADD(buf, *len, bufsize, "TX queue [%d]: %10d max:%10d ms.\n", carl9170_debugfs_tx_stuck_read() 410 return buf; carl9170_debugfs_tx_stuck_read() 414 static char *carl9170_debugfs_phy_noise_read(struct ar9170 *ar, char *buf, carl9170_debugfs_phy_noise_read() argument 422 return buf; carl9170_debugfs_phy_noise_read() 425 ADD(buf, *len, bufsize, "Chain 0: %10d dBm, ext. chan.:%10d dBm\n", carl9170_debugfs_phy_noise_read() 427 ADD(buf, *len, bufsize, "Chain 2: %10d dBm, ext. chan.:%10d dBm\n", carl9170_debugfs_phy_noise_read() 430 return buf; carl9170_debugfs_phy_noise_read() 434 static char *carl9170_debugfs_vif_dump_read(struct ar9170 *ar, char *buf, carl9170_debugfs_vif_dump_read() argument 440 ADD(buf, *len, bufsize, "registered VIFs:%d \\ %d\n", carl9170_debugfs_vif_dump_read() 443 ADD(buf, *len, bufsize, "VIF bitmap: [%*pb]\n", carl9170_debugfs_vif_dump_read() 449 ADD(buf, *len, bufsize, "\t%d = [%s VIF, id:%d, type:%x " carl9170_debugfs_vif_dump_read() 457 return buf; carl9170_debugfs_vif_dump_read() 488 char *buf; \ 492 buf = vmalloc(max_len); \ 493 if (!buf) \ 499 return buf; \ 505 ADD(buf, *ret, max_len, "%22s = %" f "[+%" f "]\n", \ 510 return buf; \ 518 char *buf; \ 522 buf = vmalloc(max_len); \ 523 if (!buf) \ 529 return buf; \ 533 ADD(buf, *ret, max_len, "%22s = %" f "\n", \ 538 return buf; \ 543 const char *buf, size_t count) carl9170_debugfs_hw_ioread32_write() 554 res = sscanf(buf, "0x%X %d", ®, &n); carl9170_debugfs_hw_ioread32_write() 593 static char *carl9170_debugfs_hw_ioread32_read(struct ar9170 *ar, char *buf, carl9170_debugfs_hw_ioread32_read() argument 599 ADD(buf, *ret, bufsize, "%.8x = %.8x\n", carl9170_debugfs_hw_ioread32_read() 610 return buf; carl9170_debugfs_hw_ioread32_read() 614 static ssize_t carl9170_debugfs_bug_write(struct ar9170 *ar, const char *buf, carl9170_debugfs_bug_write() argument 622 switch (buf[0]) { carl9170_debugfs_bug_write() 661 static char *carl9170_debugfs_bug_read(struct ar9170 *ar, char *buf, carl9170_debugfs_bug_read() argument 664 ADD(buf, *ret, bufsize, "[P]hy reinit, [R]estart, [F]ull usb reset, " carl9170_debugfs_bug_read() 666 ADD(buf, *ret, bufsize, "firmware restarts:%d, last reason:%d\n", carl9170_debugfs_bug_read() 668 ADD(buf, *ret, bufsize, "phy reinit errors:%d (%d)\n", carl9170_debugfs_bug_read() 670 ADD(buf, *ret, bufsize, "reported firmware errors:%d\n", carl9170_debugfs_bug_read() 672 ADD(buf, *ret, bufsize, "reported firmware BUGs:%d\n", carl9170_debugfs_bug_read() 674 ADD(buf, *ret, bufsize, "pending restart requests:%d\n", carl9170_debugfs_bug_read() 676 return buf; carl9170_debugfs_bug_read() 689 static char *carl9170_debugfs_erp_read(struct ar9170 *ar, char *buf, carl9170_debugfs_erp_read() argument 692 ADD(buf, *ret, bufsize, "ERP Setting: (%d) -> %s\n", ar->erp_mode, carl9170_debugfs_erp_read() 694 return buf; carl9170_debugfs_erp_read() 697 static ssize_t carl9170_debugfs_erp_write(struct ar9170 *ar, const char *buf, carl9170_debugfs_erp_write() argument 705 res = sscanf(buf, "%d", &val); carl9170_debugfs_erp_write() 720 const char *buf, size_t count) carl9170_debugfs_hw_iowrite32_write() 731 res = sscanf(buf, "0x%X 0x%X", ®, &val); carl9170_debugfs_hw_iowrite32_write() 281 carl9170_debugfs_format_frame(struct ar9170 *ar, struct sk_buff *skb, const char *prefix, char *buf, ssize_t *off, ssize_t bufsize) carl9170_debugfs_format_frame() argument 542 carl9170_debugfs_hw_ioread32_write(struct ar9170 *ar, const char *buf, size_t count) carl9170_debugfs_hw_ioread32_write() argument 719 carl9170_debugfs_hw_iowrite32_write(struct ar9170 *ar, const char *buf, size_t count) carl9170_debugfs_hw_iowrite32_write() argument
|
/linux-4.4.14/arch/mn10300/boot/tools/ |
H A D | build.c | 42 uint8_t buf[1024]; variable 108 i = read(fd, buf, sizeof(buf)); main() 112 if (buf[510] != 0x55 || buf[511] != 0xaa) main() 114 buf[508] = minor_root; main() 115 buf[509] = major_root; main() 116 if (write(1, buf, 512) != 512) main() 122 for (i = 0; (c = read(fd, buf, sizeof(buf))) > 0; i += c) main() 123 if (write(1, buf, c) != c) main() 135 memset(buf, 0, sizeof(buf)); main() 138 if (c > sizeof(buf)) main() 139 c = sizeof(buf); main() 140 if (write(1, buf, c) != c) main() 162 l = (sz > sizeof(buf)) ? sizeof(buf) : sz; main() 163 n = read(fd, buf, l); main() 170 if (write(1, buf, l) != l) main() 179 buf[0] = setup_sectors; main() 180 if (write(1, buf, 1) != 1) main() 184 buf[0] = (sys_size & 0xff); main() 185 buf[1] = ((sys_size >> 8) & 0xff); main() 186 if (write(1, buf, 2) != 2) main()
|
/linux-4.4.14/include/media/ |
H A D | lirc_dev.h | 34 static inline void lirc_buffer_clear(struct lirc_buffer *buf) lirc_buffer_clear() argument 38 if (kfifo_initialized(&buf->fifo)) { lirc_buffer_clear() 39 spin_lock_irqsave(&buf->fifo_lock, flags); lirc_buffer_clear() 40 kfifo_reset(&buf->fifo); lirc_buffer_clear() 41 spin_unlock_irqrestore(&buf->fifo_lock, flags); lirc_buffer_clear() 47 static inline int lirc_buffer_init(struct lirc_buffer *buf, lirc_buffer_init() argument 53 init_waitqueue_head(&buf->wait_poll); lirc_buffer_init() 54 spin_lock_init(&buf->fifo_lock); lirc_buffer_init() 55 buf->chunk_size = chunk_size; lirc_buffer_init() 56 buf->size = size; lirc_buffer_init() 57 ret = kfifo_alloc(&buf->fifo, size * chunk_size, GFP_KERNEL); lirc_buffer_init() 62 static inline void lirc_buffer_free(struct lirc_buffer *buf) lirc_buffer_free() argument 64 if (kfifo_initialized(&buf->fifo)) { lirc_buffer_free() 65 kfifo_free(&buf->fifo); lirc_buffer_free() 71 static inline int lirc_buffer_len(struct lirc_buffer *buf) lirc_buffer_len() argument 76 spin_lock_irqsave(&buf->fifo_lock, flags); lirc_buffer_len() 77 len = kfifo_len(&buf->fifo); lirc_buffer_len() 78 spin_unlock_irqrestore(&buf->fifo_lock, flags); lirc_buffer_len() 83 static inline int lirc_buffer_full(struct lirc_buffer *buf) lirc_buffer_full() argument 85 return lirc_buffer_len(buf) == buf->size * buf->chunk_size; lirc_buffer_full() 88 static inline int lirc_buffer_empty(struct lirc_buffer *buf) lirc_buffer_empty() argument 90 return !lirc_buffer_len(buf); lirc_buffer_empty() 93 static inline int lirc_buffer_available(struct lirc_buffer *buf) lirc_buffer_available() argument 95 return buf->size - (lirc_buffer_len(buf) / buf->chunk_size); lirc_buffer_available() 98 static inline unsigned int lirc_buffer_read(struct lirc_buffer *buf, lirc_buffer_read() argument 103 if (lirc_buffer_len(buf) >= buf->chunk_size) lirc_buffer_read() 104 ret = kfifo_out_locked(&buf->fifo, dest, buf->chunk_size, lirc_buffer_read() 105 &buf->fifo_lock); lirc_buffer_read() 110 static inline unsigned int lirc_buffer_write(struct lirc_buffer *buf, lirc_buffer_write() argument 115 ret = kfifo_in_locked(&buf->fifo, orig, buf->chunk_size, lirc_buffer_write() 116 &buf->fifo_lock); lirc_buffer_write() 199 int (*add_to_buf)(void *data, struct lirc_buffer *buf);
|
/linux-4.4.14/net/ieee802154/ |
H A D | header_ops.c | 23 ieee802154_hdr_push_addr(u8 *buf, const struct ieee802154_addr *addr, ieee802154_hdr_push_addr() argument 32 memcpy(buf + pos, &addr->pan_id, 2); ieee802154_hdr_push_addr() 38 memcpy(buf + pos, &addr->short_addr, 2); ieee802154_hdr_push_addr() 43 memcpy(buf + pos, &addr->extended_addr, IEEE802154_ADDR_LEN); ieee802154_hdr_push_addr() 55 ieee802154_hdr_push_sechdr(u8 *buf, const struct ieee802154_sechdr *hdr) ieee802154_hdr_push_sechdr() argument 59 memcpy(buf, hdr, 1); ieee802154_hdr_push_sechdr() 60 memcpy(buf + 1, &hdr->frame_counter, 4); ieee802154_hdr_push_sechdr() 70 memcpy(buf + pos, &hdr->short_src, 4); ieee802154_hdr_push_sechdr() 75 memcpy(buf + pos, &hdr->extended_src, IEEE802154_ADDR_LEN); ieee802154_hdr_push_sechdr() 80 buf[pos++] = hdr->key_id; ieee802154_hdr_push_sechdr() 88 u8 buf[IEEE802154_MAX_HEADER_LEN]; ieee802154_hdr_push() local 93 buf[pos++] = hdr->seq; ieee802154_hdr_push() 97 rc = ieee802154_hdr_push_addr(buf + pos, &hdr->dest, false); ieee802154_hdr_push() 108 rc = ieee802154_hdr_push_addr(buf + pos, &hdr->source, fc->intra_pan); ieee802154_hdr_push() 116 rc = ieee802154_hdr_push_sechdr(buf + pos, &hdr->sec); ieee802154_hdr_push() 123 memcpy(buf, fc, 2); ieee802154_hdr_push() 125 memcpy(skb_push(skb, pos), buf, pos); ieee802154_hdr_push() local 132 ieee802154_hdr_get_addr(const u8 *buf, int mode, bool omit_pan, ieee802154_hdr_get_addr() argument 143 memcpy(&addr->pan_id, buf + pos, 2); ieee802154_hdr_get_addr() 148 memcpy(&addr->short_addr, buf + pos, 2); ieee802154_hdr_get_addr() 151 memcpy(&addr->extended_addr, buf + pos, IEEE802154_ADDR_LEN); ieee802154_hdr_get_addr() 169 ieee802154_hdr_get_sechdr(const u8 *buf, struct ieee802154_sechdr *hdr) ieee802154_hdr_get_sechdr() argument 173 memcpy(hdr, buf, 1); ieee802154_hdr_get_sechdr() 174 memcpy(&hdr->frame_counter, buf + 1, 4); ieee802154_hdr_get_sechdr() 184 memcpy(&hdr->short_src, buf + pos, 4); ieee802154_hdr_get_sechdr() 189 memcpy(&hdr->extended_src, buf + pos, IEEE802154_ADDR_LEN); ieee802154_hdr_get_sechdr() 194 hdr->key_id = buf[pos++]; ieee802154_hdr_get_sechdr() 226 ieee802154_hdr_get_addrs(const u8 *buf, struct ieee802154_hdr *hdr) ieee802154_hdr_get_addrs() argument 230 pos += ieee802154_hdr_get_addr(buf + pos, hdr->fc.dest_addr_mode, ieee802154_hdr_get_addrs() 232 pos += ieee802154_hdr_get_addr(buf + pos, hdr->fc.source_addr_mode, ieee802154_hdr_get_addrs() 274 const u8 *buf = skb_mac_header(skb); ieee802154_hdr_peek_addrs() local 277 if (buf + 3 > skb_tail_pointer(skb)) ieee802154_hdr_peek_addrs() 280 memcpy(hdr, buf, 3); ieee802154_hdr_peek_addrs() 283 if (rc < 0 || buf + rc > skb_tail_pointer(skb)) ieee802154_hdr_peek_addrs() 286 pos += ieee802154_hdr_get_addrs(buf + pos, hdr); ieee802154_hdr_peek_addrs() 294 const u8 *buf = skb_mac_header(skb); ieee802154_hdr_peek() local 302 u8 key_id_mode = IEEE802154_SCF_KEY_ID_MODE(*(buf + pos)); ieee802154_hdr_peek() 305 if (buf + want > skb_tail_pointer(skb)) ieee802154_hdr_peek() 308 pos += ieee802154_hdr_get_sechdr(buf + pos, &hdr->sec); ieee802154_hdr_peek()
|
/linux-4.4.14/drivers/hid/ |
H A D | hid-roccat-common.c | 27 char *buf; roccat_common2_receive() local 30 buf = kmalloc(size, GFP_KERNEL); roccat_common2_receive() 31 if (buf == NULL) roccat_common2_receive() 38 0, buf, size, USB_CTRL_SET_TIMEOUT); roccat_common2_receive() 40 memcpy(data, buf, size); roccat_common2_receive() 41 kfree(buf); roccat_common2_receive() 49 char *buf; roccat_common2_send() local 52 buf = kmemdup(data, size, GFP_KERNEL); roccat_common2_send() 53 if (buf == NULL) roccat_common2_send() 60 0, buf, size, USB_CTRL_SET_TIMEOUT); roccat_common2_send() 62 kfree(buf); roccat_common2_send() 111 uint command, void const *buf, uint size) roccat_common2_send_with_status() 115 retval = roccat_common2_send(usb_dev, command, buf, size); roccat_common2_send_with_status() 134 char *buf, loff_t off, size_t count, roccat_common2_sysfs_read() 150 retval = roccat_common2_receive(usb_dev, command, buf, real_size); roccat_common2_sysfs_read() 158 void const *buf, loff_t off, size_t count, roccat_common2_sysfs_write() 171 retval = roccat_common2_send_with_status(usb_dev, command, buf, real_size); roccat_common2_sysfs_write() 110 roccat_common2_send_with_status(struct usb_device *usb_dev, uint command, void const *buf, uint size) roccat_common2_send_with_status() argument 133 roccat_common2_sysfs_read(struct file *fp, struct kobject *kobj, char *buf, loff_t off, size_t count, size_t real_size, uint command) roccat_common2_sysfs_read() argument 157 roccat_common2_sysfs_write(struct file *fp, struct kobject *kobj, void const *buf, loff_t off, size_t count, size_t real_size, uint command) roccat_common2_sysfs_write() argument
|
H A D | hid-thingm.c | 74 static int thingm_send(struct thingm_device *tdev, u8 buf[REPORT_SIZE]) thingm_send() argument 79 buf[0], buf[1], buf[2], buf[3], buf[4], thingm_send() 80 buf[5], buf[6], buf[7], buf[8]); thingm_send() 82 ret = hid_hw_raw_request(tdev->hdev, buf[0], buf, REPORT_SIZE, thingm_send() 88 static int thingm_recv(struct thingm_device *tdev, u8 buf[REPORT_SIZE]) thingm_recv() argument 92 ret = hid_hw_raw_request(tdev->hdev, buf[0], buf, REPORT_SIZE, thingm_recv() 98 buf[0], buf[1], buf[2], buf[3], buf[4], thingm_recv() 99 buf[5], buf[6], buf[7], buf[8]); thingm_recv() 106 u8 buf[REPORT_SIZE] = { REPORT_ID, 'v', 0, 0, 0, 0, 0, 0, 0 }; thingm_version() local 109 err = thingm_send(tdev, buf); thingm_version() 113 err = thingm_recv(tdev, buf); thingm_version() 117 tdev->version.major = buf[3]; thingm_version() 118 tdev->version.minor = buf[4]; thingm_version() 125 u8 buf[REPORT_SIZE] = { REPORT_ID, 'c', 0, 0, 0, 0, 0, rgb->num, 0 }; thingm_write_color() local 127 buf[2] = rgb->red.ldev.brightness; thingm_write_color() 128 buf[3] = rgb->green.ldev.brightness; thingm_write_color() 129 buf[4] = rgb->blue.ldev.brightness; thingm_write_color() 131 return thingm_send(rgb->tdev, buf); thingm_write_color()
|
/linux-4.4.14/drivers/oprofile/ |
H A D | oprofile_files.c | 30 static ssize_t timeout_read(struct file *file, char __user *buf, timeout_read() argument 34 buf, count, offset); timeout_read() 38 static ssize_t timeout_write(struct file *file, char const __user *buf, timeout_write() argument 47 retval = oprofilefs_ulong_from_user(&val, buf, count); timeout_write() 68 static ssize_t depth_read(struct file *file, char __user *buf, size_t count, loff_t *offset) depth_read() argument 70 return oprofilefs_ulong_to_user(oprofile_backtrace_depth, buf, count, depth_read() 75 static ssize_t depth_write(struct file *file, char const __user *buf, size_t count, loff_t *offset) depth_write() argument 86 retval = oprofilefs_ulong_from_user(&val, buf, count); depth_write() 105 static ssize_t pointer_size_read(struct file *file, char __user *buf, size_t count, loff_t *offset) pointer_size_read() argument 107 return oprofilefs_ulong_to_user(sizeof(void *), buf, count, offset); pointer_size_read() 117 static ssize_t cpu_type_read(struct file *file, char __user *buf, size_t count, loff_t *offset) cpu_type_read() argument 119 return oprofilefs_str_to_user(oprofile_ops.cpu_type, buf, count, offset); cpu_type_read() 129 static ssize_t enable_read(struct file *file, char __user *buf, size_t count, loff_t *offset) enable_read() argument 131 return oprofilefs_ulong_to_user(oprofile_started, buf, count, offset); enable_read() 135 static ssize_t enable_write(struct file *file, char const __user *buf, size_t count, loff_t *offset) enable_write() argument 143 retval = oprofilefs_ulong_from_user(&val, buf, count); enable_write() 166 static ssize_t dump_write(struct file *file, char const __user *buf, size_t count, loff_t *offset) dump_write() argument
|
/linux-4.4.14/sound/core/seq/ |
H A D | seq_midi_event.c | 52 static void note_decode(struct snd_seq_event *ev, unsigned char *buf); 53 static void one_param_decode(struct snd_seq_event *ev, unsigned char *buf); 54 static void pitchbend_decode(struct snd_seq_event *ev, unsigned char *buf); 55 static void two_param_decode(struct snd_seq_event *ev, unsigned char *buf); 56 static void songpos_decode(struct snd_seq_event *ev, unsigned char *buf); 65 void (*decode)(struct snd_seq_event *ev, unsigned char *buf); 96 static int extra_decode_ctrl14(struct snd_midi_event *dev, unsigned char *buf, int len, 98 static int extra_decode_xrpn(struct snd_midi_event *dev, unsigned char *buf, int count, 103 int (*decode)(struct snd_midi_event *dev, unsigned char *buf, int len, 124 dev->buf = kmalloc(bufsize, GFP_KERNEL); snd_midi_event_new() 125 if (dev->buf == NULL) { snd_midi_event_new() 141 kfree(dev->buf); snd_midi_event_free() 202 old_buf = dev->buf; 203 dev->buf = new_buf; 216 long snd_midi_event_encode(struct snd_midi_event *dev, unsigned char *buf, long count, snd_midi_event_encode() argument 225 rc = snd_midi_event_encode_byte(dev, *buf++, ev); snd_midi_event_encode() 262 dev->buf[0] = c; snd_midi_event_encode_byte() 272 dev->buf[dev->read++] = c; snd_midi_event_encode_byte() 277 dev->buf[1] = c; snd_midi_event_encode_byte() 298 ev->data.ext.ptr = dev->buf; snd_midi_event_encode_byte() 314 ev->data.note.channel = dev->buf[0] & 0x0f; note_event() 315 ev->data.note.note = dev->buf[1]; note_event() 316 ev->data.note.velocity = dev->buf[2]; note_event() 322 ev->data.control.channel = dev->buf[0] & 0x0f; one_param_ctrl_event() 323 ev->data.control.value = dev->buf[1]; one_param_ctrl_event() 329 ev->data.control.channel = dev->buf[0] & 0x0f; pitchbend_ctrl_event() 330 ev->data.control.value = (int)dev->buf[2] * 128 + (int)dev->buf[1] - 8192; pitchbend_ctrl_event() 336 ev->data.control.channel = dev->buf[0] & 0x0f; two_param_ctrl_event() 337 ev->data.control.param = dev->buf[1]; two_param_ctrl_event() 338 ev->data.control.value = dev->buf[2]; two_param_ctrl_event() 344 ev->data.control.value = dev->buf[1]; one_param_event() 350 ev->data.control.value = (int)dev->buf[2] * 128 + (int)dev->buf[1]; songpos_event() 357 long snd_midi_event_decode(struct snd_midi_event *dev, unsigned char *buf, long count, snd_midi_event_decode() argument 371 return extra_event[type].decode(dev, buf, count, ev); snd_midi_event_decode() 385 return snd_seq_expand_var_event(ev, count, buf, 1, 0); snd_midi_event_decode() 407 memcpy(buf, xbuf, qlen); snd_midi_event_decode() 414 static void note_decode(struct snd_seq_event *ev, unsigned char *buf) note_decode() argument 416 buf[0] = ev->data.note.note & 0x7f; note_decode() 417 buf[1] = ev->data.note.velocity & 0x7f; note_decode() 421 static void one_param_decode(struct snd_seq_event *ev, unsigned char *buf) one_param_decode() argument 423 buf[0] = ev->data.control.value & 0x7f; one_param_decode() 427 static void pitchbend_decode(struct snd_seq_event *ev, unsigned char *buf) pitchbend_decode() argument 430 buf[0] = value & 0x7f; pitchbend_decode() 431 buf[1] = (value >> 7) & 0x7f; pitchbend_decode() 435 static void two_param_decode(struct snd_seq_event *ev, unsigned char *buf) two_param_decode() argument 437 buf[0] = ev->data.control.param & 0x7f; two_param_decode() 438 buf[1] = ev->data.control.value & 0x7f; two_param_decode() 442 static void songpos_decode(struct snd_seq_event *ev, unsigned char *buf) songpos_decode() argument 444 buf[0] = ev->data.control.value & 0x7f; songpos_decode() 445 buf[1] = (ev->data.control.value >> 7) & 0x7f; songpos_decode() 449 static int extra_decode_ctrl14(struct snd_midi_event *dev, unsigned char *buf, extra_decode_ctrl14() argument 464 buf[idx++] = dev->lastcmd = cmd; extra_decode_ctrl14() 466 buf[idx++] = ev->data.control.param; extra_decode_ctrl14() 467 buf[idx++] = (ev->data.control.value >> 7) & 0x7f; extra_decode_ctrl14() 469 buf[idx++] = cmd; extra_decode_ctrl14() 470 buf[idx++] = ev->data.control.param + 0x20; extra_decode_ctrl14() 471 buf[idx++] = ev->data.control.value & 0x7f; extra_decode_ctrl14() 478 buf[idx++] = dev->lastcmd = cmd; extra_decode_ctrl14() 480 buf[idx++] = ev->data.control.param & 0x7f; extra_decode_ctrl14() 481 buf[idx++] = ev->data.control.value & 0x7f; extra_decode_ctrl14() 487 static int extra_decode_xrpn(struct snd_midi_event *dev, unsigned char *buf, extra_decode_xrpn() argument 515 buf[idx++] = dev->lastcmd = cmd; extra_decode_xrpn() 520 buf[idx++] = dev->lastcmd = cmd; extra_decode_xrpn() 521 buf[idx++] = cbytes[i]; extra_decode_xrpn() 522 buf[idx++] = bytes[i]; extra_decode_xrpn()
|
/linux-4.4.14/arch/powerpc/platforms/pseries/ |
H A D | reconfig.c | 109 * @buf: input buffer, must be nul-terminated 111 * @name: return value; set to property name in buf 113 * @value: return value; set to the property value in buf 117 * is set to the next name in buf, or NULL on error. 119 static char * parse_next_property(char *buf, char *end, char **name, int *length, parse_next_property() argument 124 *name = buf; parse_next_property() 126 tmp = strchr(buf, ' '); parse_next_property() 199 static int do_add_node(char *buf, size_t bufsize) do_add_node() argument 207 end = buf + bufsize; do_add_node() 208 path = buf; do_add_node() 209 buf = strchr(buf, ' '); do_add_node() 210 if (!buf) do_add_node() 212 *buf = '\0'; do_add_node() 213 buf++; do_add_node() 220 /* rv = build_prop_list(tmp, bufsize - (tmp - buf), &proplist); */ do_add_node() 221 while (buf < end && do_add_node() 222 (buf = parse_next_property(buf, end, &name, &length, &value))) { do_add_node() 232 if (!buf) { do_add_node() 245 static int do_remove_node(char *buf) do_remove_node() argument 250 if ((node = of_find_node_by_path(buf))) do_remove_node() 257 static char *parse_node(char *buf, size_t bufsize, struct device_node **npp) parse_node() argument 263 handle_str = buf; parse_node() 265 buf = strchr(buf, ' '); parse_node() 266 if (!buf) parse_node() 268 *buf = '\0'; parse_node() 269 buf++; parse_node() 274 return buf; parse_node() 277 static int do_add_property(char *buf, size_t bufsize) do_add_property() argument 284 end = buf + bufsize; do_add_property() 285 buf = parse_node(buf, bufsize, &np); do_add_property() 290 if (parse_next_property(buf, end, &name, &length, &value) == NULL) do_add_property() 302 static int do_remove_property(char *buf, size_t bufsize) do_remove_property() argument 307 buf = parse_node(buf, bufsize, &np); do_remove_property() 312 tmp = strchr(buf,' '); do_remove_property() 316 if (strlen(buf) == 0) do_remove_property() 319 prop = of_find_property(np, buf, NULL); do_remove_property() 324 static int do_update_property(char *buf, size_t bufsize) do_update_property() argument 331 buf = parse_node(buf, bufsize, &np); do_update_property() 332 end = buf + bufsize; do_update_property() 337 next_prop = parse_next_property(buf, end, &name, &length, &value); do_update_property() 358 * @buf: command and arguments 366 static ssize_t ofdt_write(struct file *file, const char __user *buf, size_t count, ofdt_write() argument 377 if (copy_from_user(kbuf, buf, count)) { ofdt_write()
|
/linux-4.4.14/drivers/usb/core/ |
H A D | sysfs.c | 22 struct device_attribute *attr, char *buf) \ 32 rc = sprintf(buf, format_string, \ 46 struct device_attribute *attr, char *buf) bMaxPower_show() 56 rc = sprintf(buf, "%dmA\n", usb_get_max_power(udev, actconfig)); bMaxPower_show() 63 struct device_attribute *attr, char *buf) configuration_show() 73 rc = sprintf(buf, "%s\n", actconfig->string); configuration_show() 84 const char *buf, size_t count) bConfigurationValue_store() 89 if (sscanf(buf, "%d", &config) != 1 || config < -1 || config > 255) bConfigurationValue_store() 102 struct device_attribute *attr, char *buf) \ 109 retval = sprintf(buf, "%s\n", udev->name); \ 120 char *buf) speed_show() 147 return sprintf(buf, "%s\n", speed); speed_show() 152 char *buf) busnum_show() 157 return sprintf(buf, "%d\n", udev->bus->busnum); busnum_show() 162 char *buf) devnum_show() 167 return sprintf(buf, "%d\n", udev->devnum); devnum_show() 172 char *buf) devpath_show() 177 return sprintf(buf, "%s\n", udev->devpath); devpath_show() 182 char *buf) version_show() 189 return sprintf(buf, "%2x.%02x\n", bcdUSB >> 8, bcdUSB & 0xff); version_show() 194 char *buf) maxchild_show() 199 return sprintf(buf, "%d\n", udev->maxchild); maxchild_show() 204 char *buf) quirks_show() 209 return sprintf(buf, "0x%x\n", udev->quirks); quirks_show() 214 struct device_attribute *attr, char *buf) avoid_reset_quirk_show() 219 return sprintf(buf, "%d\n", !!(udev->quirks & USB_QUIRK_RESET)); avoid_reset_quirk_show() 224 const char *buf, size_t count) avoid_reset_quirk_store() 229 if (sscanf(buf, "%d", &val) != 1 || val < 0 || val > 1) avoid_reset_quirk_store() 242 char *buf) urbnum_show() 247 return sprintf(buf, "%d\n", atomic_read(&udev->urbnum)); urbnum_show() 252 char *buf) removable_show() 270 return sprintf(buf, "%s\n", state); removable_show() 275 struct device_attribute *attr, char *buf) ltm_capable_show() 278 return sprintf(buf, "%s\n", "yes"); ltm_capable_show() 279 return sprintf(buf, "%s\n", "no"); ltm_capable_show() 286 char *buf) persist_show() 290 return sprintf(buf, "%d\n", udev->persist_enabled); persist_show() 294 const char *buf, size_t count) persist_store() 303 if (sscanf(buf, "%d", &value) != 1) persist_store() 339 struct device_attribute *attr, char *buf) connected_duration_show() 343 return sprintf(buf, "%u\n", connected_duration_show() 356 struct device_attribute *attr, char *buf) active_duration_show() 365 return sprintf(buf, "%u\n", duration); active_duration_show() 370 struct device_attribute *attr, char *buf) autosuspend_show() 372 return sprintf(buf, "%d\n", dev->power.autosuspend_delay / 1000); autosuspend_show() 376 struct device_attribute *attr, const char *buf, autosuspend_store() 381 if (sscanf(buf, "%d", &value) != 1 || value >= INT_MAX/1000 || autosuspend_store() 405 char *buf) level_show() 413 return sprintf(buf, "%s\n", p); level_show() 417 const char *buf, size_t count) level_store() 425 cp = memchr(buf, '\n', count); level_store() 427 len = cp - buf; level_store() 432 strncmp(buf, on_string, len) == 0) level_store() 436 strncmp(buf, auto_string, len) == 0) level_store() 448 struct device_attribute *attr, char *buf) usb2_hardware_lpm_show() 458 return sprintf(buf, "%s\n", p); usb2_hardware_lpm_show() 463 const char *buf, size_t count) usb2_hardware_lpm_store() 471 ret = strtobool(buf, &value); usb2_hardware_lpm_store() 489 char *buf) usb2_lpm_l1_timeout_show() 492 return sprintf(buf, "%d\n", udev->l1_params.timeout); usb2_lpm_l1_timeout_show() 497 const char *buf, size_t count) usb2_lpm_l1_timeout_store() 502 if (kstrtou16(buf, 0, &timeout)) usb2_lpm_l1_timeout_store() 512 struct device_attribute *attr, char *buf) usb2_lpm_besl_show() 515 return sprintf(buf, "%d\n", udev->l1_params.besl); usb2_lpm_besl_show() 520 const char *buf, size_t count) usb2_lpm_besl_store() 525 if (kstrtou8(buf, 0, &besl) || besl > 15) usb2_lpm_besl_store() 535 struct device_attribute *attr, char *buf) usb3_hardware_lpm_u1_show() 549 return sprintf(buf, "%s\n", p); usb3_hardware_lpm_u1_show() 554 struct device_attribute *attr, char *buf) usb3_hardware_lpm_u2_show() 568 return sprintf(buf, "%s\n", p); usb3_hardware_lpm_u2_show() 645 char *buf) \ 650 return sprintf(buf, format_string, \ 662 char *buf) \ 667 return sprintf(buf, format_string, udev->descriptor.field); \ 680 struct device_attribute *attr, char *buf) authorized_show() 683 return snprintf(buf, PAGE_SIZE, "%u\n", usb_dev->authorized); authorized_show() 692 struct device_attribute *attr, const char *buf, authorized_store() 698 result = sscanf(buf, "%u\n", &val); authorized_store() 712 const char *buf, size_t count) remove_store() 812 char *buf, loff_t off, size_t count) read_descriptors() 838 memcpy(buf, src + off, n); read_descriptors() 840 buf += n; read_descriptors() 891 char *buf) \ 895 return sprintf(buf, format_string, \ 910 char *buf) \ 914 return sprintf(buf, format_string, \ 927 char *buf) interface_show() 936 return sprintf(buf, "%s\n", string); interface_show() 941 char *buf) modalias_show() 951 return sprintf(buf, "usb:v%04Xp%04Xd%04Xdc%02Xdsc%02Xdp%02X" modalias_show() 968 char *buf) supports_autosuspend_show() 977 return sprintf(buf, "%u\n", s); supports_autosuspend_show() 986 struct device_attribute *attr, char *buf) interface_authorized_show() 990 return sprintf(buf, "%u\n", intf->authorized); interface_authorized_show() 997 struct device_attribute *attr, const char *buf, size_t count) interface_authorized_store() 1002 if (strtobool(buf, &val) != 0) interface_authorized_store() 45 bMaxPower_show(struct device *dev, struct device_attribute *attr, char *buf) bMaxPower_show() argument 62 configuration_show(struct device *dev, struct device_attribute *attr, char *buf) configuration_show() argument 82 bConfigurationValue_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) bConfigurationValue_store() argument 119 speed_show(struct device *dev, struct device_attribute *attr, char *buf) speed_show() argument 151 busnum_show(struct device *dev, struct device_attribute *attr, char *buf) busnum_show() argument 161 devnum_show(struct device *dev, struct device_attribute *attr, char *buf) devnum_show() argument 171 devpath_show(struct device *dev, struct device_attribute *attr, char *buf) devpath_show() argument 181 version_show(struct device *dev, struct device_attribute *attr, char *buf) version_show() argument 193 maxchild_show(struct device *dev, struct device_attribute *attr, char *buf) maxchild_show() argument 203 quirks_show(struct device *dev, struct device_attribute *attr, char *buf) quirks_show() argument 213 avoid_reset_quirk_show(struct device *dev, struct device_attribute *attr, char *buf) avoid_reset_quirk_show() argument 222 avoid_reset_quirk_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) avoid_reset_quirk_store() argument 241 urbnum_show(struct device *dev, struct device_attribute *attr, char *buf) urbnum_show() argument 251 removable_show(struct device *dev, struct device_attribute *attr, char *buf) removable_show() argument 274 ltm_capable_show(struct device *dev, struct device_attribute *attr, char *buf) ltm_capable_show() argument 285 persist_show(struct device *dev, struct device_attribute *attr, char *buf) persist_show() argument 293 persist_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) persist_store() argument 338 connected_duration_show(struct device *dev, struct device_attribute *attr, char *buf) connected_duration_show() argument 355 active_duration_show(struct device *dev, struct device_attribute *attr, char *buf) active_duration_show() argument 369 autosuspend_show(struct device *dev, struct device_attribute *attr, char *buf) autosuspend_show() argument 375 autosuspend_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) autosuspend_store() argument 404 level_show(struct device *dev, struct device_attribute *attr, char *buf) level_show() argument 416 level_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) level_store() argument 447 usb2_hardware_lpm_show(struct device *dev, struct device_attribute *attr, char *buf) usb2_hardware_lpm_show() argument 461 usb2_hardware_lpm_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) usb2_hardware_lpm_store() argument 487 usb2_lpm_l1_timeout_show(struct device *dev, struct device_attribute *attr, char *buf) usb2_lpm_l1_timeout_show() argument 495 usb2_lpm_l1_timeout_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) usb2_lpm_l1_timeout_store() argument 511 usb2_lpm_besl_show(struct device *dev, struct device_attribute *attr, char *buf) usb2_lpm_besl_show() argument 518 usb2_lpm_besl_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) usb2_lpm_besl_store() argument 534 usb3_hardware_lpm_u1_show(struct device *dev, struct device_attribute *attr, char *buf) usb3_hardware_lpm_u1_show() argument 553 usb3_hardware_lpm_u2_show(struct device *dev, struct device_attribute *attr, char *buf) usb3_hardware_lpm_u2_show() argument 679 authorized_show(struct device *dev, struct device_attribute *attr, char *buf) authorized_show() argument 691 authorized_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t size) authorized_store() argument 711 remove_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) remove_store() argument 810 read_descriptors(struct file *filp, struct kobject *kobj, struct bin_attribute *attr, char *buf, loff_t off, size_t count) read_descriptors() argument 926 interface_show(struct device *dev, struct device_attribute *attr, char *buf) interface_show() argument 940 modalias_show(struct device *dev, struct device_attribute *attr, char *buf) modalias_show() argument 966 supports_autosuspend_show(struct device *dev, struct device_attribute *attr, char *buf) supports_autosuspend_show() argument 985 interface_authorized_show(struct device *dev, struct device_attribute *attr, char *buf) interface_authorized_show() argument 996 interface_authorized_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) interface_authorized_store() argument
|
/linux-4.4.14/drivers/staging/fbtft/ |
H A D | fbtft-io.c | 7 int fbtft_write_spi(struct fbtft_par *par, void *buf, size_t len) fbtft_write_spi() argument 10 .tx_buf = buf, fbtft_write_spi() 15 fbtft_par_dbg_hex(DEBUG_WRITE, par, par->info->device, u8, buf, len, fbtft_write_spi() 25 if (par->txbuf.dma && buf == par->txbuf.buf) { fbtft_write_spi() 37 * @buf: Buffer to write 43 int fbtft_write_spi_emulate_9(struct fbtft_par *par, void *buf, size_t len) fbtft_write_spi_emulate_9() argument 45 u16 *src = buf; fbtft_write_spi_emulate_9() 52 fbtft_par_dbg_hex(DEBUG_WRITE, par, par->info->device, u8, buf, len, fbtft_write_spi_emulate_9() 88 int fbtft_read_spi(struct fbtft_par *par, void *buf, size_t len) fbtft_read_spi() argument 94 .rx_buf = buf, fbtft_read_spi() 121 fbtft_par_dbg_hex(DEBUG_READ, par, par->info->device, u8, buf, len, fbtft_read_spi() 122 "%s(len=%d) buf <= ", __func__, len); fbtft_read_spi() 132 int fbtft_write_gpio8_wr(struct fbtft_par *par, void *buf, size_t len) fbtft_write_gpio8_wr() argument 140 fbtft_par_dbg_hex(DEBUG_WRITE, par, par->info->device, u8, buf, len, fbtft_write_gpio8_wr() 144 data = *(u8 *) buf; fbtft_write_gpio8_wr() 173 prev_data = *(u8 *) buf; fbtft_write_gpio8_wr() 175 buf++; fbtft_write_gpio8_wr() 182 int fbtft_write_gpio16_wr(struct fbtft_par *par, void *buf, size_t len) fbtft_write_gpio16_wr() argument 190 fbtft_par_dbg_hex(DEBUG_WRITE, par, par->info->device, u8, buf, len, fbtft_write_gpio16_wr() 194 data = *(u16 *) buf; fbtft_write_gpio16_wr() 223 prev_data = *(u16 *) buf; fbtft_write_gpio16_wr() 225 buf += 2; fbtft_write_gpio16_wr() 233 int fbtft_write_gpio16_wr_latched(struct fbtft_par *par, void *buf, size_t len) fbtft_write_gpio16_wr_latched() argument
|
/linux-4.4.14/drivers/pcmcia/ |
H A D | socket_sysfs.c | 37 char *buf) pccard_show_type() 44 return sprintf(buf, "32-bit\n"); pccard_show_type() 45 return sprintf(buf, "16-bit\n"); pccard_show_type() 50 char *buf) pccard_show_voltage() 57 return sprintf(buf, "%d.%dV\n", s->socket.Vcc / 10, pccard_show_voltage() 59 return sprintf(buf, "X.XV\n"); pccard_show_voltage() 64 char *buf) pccard_show_vpp() 69 return sprintf(buf, "%d.%dV\n", s->socket.Vpp / 10, s->socket.Vpp % 10); pccard_show_vpp() 74 char *buf) pccard_show_vcc() 79 return sprintf(buf, "%d.%dV\n", s->socket.Vcc / 10, s->socket.Vcc % 10); pccard_show_vcc() 85 const char *buf, size_t count) pccard_store_insert() 101 char *buf) pccard_show_card_pm_state() 104 return sprintf(buf, "%s\n", s->state & SOCKET_SUSPEND ? "off" : "on"); pccard_show_card_pm_state() 109 const char *buf, size_t count) pccard_store_card_pm_state() 117 if (!strncmp(buf, "off", 3)) pccard_store_card_pm_state() 120 if (!strncmp(buf, "on", 2)) pccard_store_card_pm_state() 132 const char *buf, size_t count) pccard_store_eject() 148 char *buf) pccard_show_irq_mask() 151 return sprintf(buf, "0x%04x\n", s->irq_mask); pccard_show_irq_mask() 156 const char *buf, size_t count) pccard_store_irq_mask() 165 ret = sscanf(buf, "0x%x\n", &mask); pccard_store_irq_mask() 180 struct device_attribute *attr, char *buf) pccard_show_resource() 183 return sprintf(buf, "%s\n", s->resource_setup_done ? "yes" : "no"); pccard_show_resource() 188 const char *buf, size_t count) pccard_store_resource() 36 pccard_show_type(struct device *dev, struct device_attribute *attr, char *buf) pccard_show_type() argument 49 pccard_show_voltage(struct device *dev, struct device_attribute *attr, char *buf) pccard_show_voltage() argument 63 pccard_show_vpp(struct device *dev, struct device_attribute *attr, char *buf) pccard_show_vpp() argument 73 pccard_show_vcc(struct device *dev, struct device_attribute *attr, char *buf) pccard_show_vcc() argument 84 pccard_store_insert(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) pccard_store_insert() argument 99 pccard_show_card_pm_state(struct device *dev, struct device_attribute *attr, char *buf) pccard_show_card_pm_state() argument 107 pccard_store_card_pm_state(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) pccard_store_card_pm_state() argument 130 pccard_store_eject(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) pccard_store_eject() argument 146 pccard_show_irq_mask(struct device *dev, struct device_attribute *attr, char *buf) pccard_show_irq_mask() argument 154 pccard_store_irq_mask(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) pccard_store_irq_mask() argument 179 pccard_show_resource(struct device *dev, struct device_attribute *attr, char *buf) pccard_show_resource() argument 186 pccard_store_resource(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) pccard_store_resource() argument
|
/linux-4.4.14/arch/avr32/boards/merisc/ |
H A D | merisc_sysfs.c | 21 static ssize_t merisc_model_show(struct class *class, char *buf) merisc_model_show() argument 25 sprintf(buf, "%s\n", merisc_model()); merisc_model_show() 26 ret = strlen(buf) + 1; merisc_model_show() 31 static ssize_t merisc_revision_show(struct class *class, char *buf) merisc_revision_show() argument 35 sprintf(buf, "%s\n", merisc_revision()); merisc_revision_show() 36 ret = strlen(buf) + 1; merisc_revision_show()
|
/linux-4.4.14/fs/hostfs/ |
H A D | hostfs_user.c | 21 static void stat64_to_hostfs(const struct stat64 *buf, struct hostfs_stat *p) stat64_to_hostfs() argument 23 p->ino = buf->st_ino; stat64_to_hostfs() 24 p->mode = buf->st_mode; stat64_to_hostfs() 25 p->nlink = buf->st_nlink; stat64_to_hostfs() 26 p->uid = buf->st_uid; stat64_to_hostfs() 27 p->gid = buf->st_gid; stat64_to_hostfs() 28 p->size = buf->st_size; stat64_to_hostfs() 29 p->atime.tv_sec = buf->st_atime; stat64_to_hostfs() 31 p->ctime.tv_sec = buf->st_ctime; stat64_to_hostfs() 33 p->mtime.tv_sec = buf->st_mtime; stat64_to_hostfs() 35 p->blksize = buf->st_blksize; stat64_to_hostfs() 36 p->blocks = buf->st_blocks; stat64_to_hostfs() 37 p->maj = os_major(buf->st_rdev); stat64_to_hostfs() 38 p->min = os_minor(buf->st_rdev); stat64_to_hostfs() 43 struct stat64 buf; stat_file() local 46 if (fstat64(fd, &buf) < 0) stat_file() 48 } else if (lstat64(path, &buf) < 0) { stat_file() 51 stat64_to_hostfs(&buf, p); stat_file() 124 int read_file(int fd, unsigned long long *offset, char *buf, int len) read_file() argument 128 n = pread64(fd, buf, len, *offset); read_file() 135 int write_file(int fd, unsigned long long *offset, const char *buf, int len) write_file() argument 139 n = pwrite64(fd, buf, len, *offset); write_file() 337 int hostfs_do_readlink(char *file, char *buf, int size) hostfs_do_readlink() argument 341 n = readlink(file, buf, size); hostfs_do_readlink() 345 buf[n] = '\0'; hostfs_do_readlink() 391 struct statfs64 buf; do_statfs() local 394 err = statfs64(root, &buf); do_statfs() 398 *bsize_out = buf.f_bsize; do_statfs() 399 *blocks_out = buf.f_blocks; do_statfs() 400 *bfree_out = buf.f_bfree; do_statfs() 401 *bavail_out = buf.f_bavail; do_statfs() 402 *files_out = buf.f_files; do_statfs() 403 *ffree_out = buf.f_ffree; do_statfs() 404 memcpy(fsid_out, &buf.f_fsid, do_statfs() 405 sizeof(buf.f_fsid) > fsid_size ? fsid_size : do_statfs() 406 sizeof(buf.f_fsid)); do_statfs() 407 *namelen_out = buf.f_namelen; do_statfs()
|
/linux-4.4.14/drivers/staging/iio/ |
H A D | ring_hw.h | 17 * @buf: generic ring buffer elements 21 struct iio_buffer buf; member in struct:iio_hw_buffer 25 #define iio_to_hw_buf(r) container_of(r, struct iio_hw_buffer, buf)
|
/linux-4.4.14/drivers/parisc/ |
H A D | eisa_enumerator.c | 80 static int configure_memory(const unsigned char *buf, configure_memory() argument 92 c = get_8(buf+len); configure_memory() 98 res->start = mem_parent->start + get_24(buf+len+2); configure_memory() 99 res->end = res->start + get_16(buf+len+5)*1024; configure_memory() 120 static int configure_irq(const unsigned char *buf) configure_irq() argument 129 c = get_8(buf+len); configure_irq() 151 static int configure_dma(const unsigned char *buf) configure_dma() argument 160 c = get_8(buf+len); configure_dma() 172 static int configure_port(const unsigned char *buf, struct resource *io_parent, configure_port() argument 184 c = get_8(buf+len); configure_port() 188 res->start = get_16(buf+len+1); configure_port() 189 res->end = get_16(buf+len+1)+(c&HPEE_PORT_SIZE_MASK)+1; configure_port() 214 static int configure_port_init(const unsigned char *buf) configure_port_init() argument 221 c = get_8(buf+len); configure_port_init() 228 outb((inb(get_16(buf+len+1) & configure_port_init() 229 get_8(buf+len+3)) | configure_port_init() 230 get_8(buf+len+4)), get_16(buf+len+1)); configure_port_init() 233 outb(get_8(buf+len+3), get_16(buf+len+1)); configure_port_init() 241 outw((inw(get_16(buf+len+1)) & configure_port_init() 242 get_16(buf+len+3)) | configure_port_init() 243 get_16(buf+len+5), configure_port_init() 244 get_16(buf+len+1)); configure_port_init() 246 outw(cpu_to_le16(get_16(buf+len+3)), get_16(buf+len+1)); configure_port_init() 253 outl((inl(get_16(buf+len+1) & configure_port_init() 254 get_32(buf+len+3)) | configure_port_init() 255 get_32(buf+len+7)), get_16(buf+len+1)); configure_port_init() 257 outl(cpu_to_le32(get_32(buf+len+3)), get_16(buf+len+1)); configure_port_init() 279 static int configure_choise(const unsigned char *buf, u_int8_t *info) configure_choise() argument 287 len = get_8(buf); configure_choise() 288 *info=get_8(buf+len+1); configure_choise() 293 static int configure_type_string(const unsigned char *buf) configure_type_string() argument 298 len = get_8(buf); configure_type_string() 306 static int configure_function(const unsigned char *buf, int *more) configure_function() argument 312 *more = get_16(buf); configure_function() 318 const unsigned char *buf, parse_slot_config() 344 pos+=configure_function(buf+pos, &function_len); parse_slot_config() 351 pos += configure_choise(buf+pos, &flags); parse_slot_config() 375 pos += configure_type_string(buf+pos); parse_slot_config() 380 pos += configure_memory(buf+pos, mem_parent, board); parse_slot_config() 384 pos += configure_irq(buf+pos); parse_slot_config() 388 pos += configure_dma(buf+pos); parse_slot_config() 393 pos += configure_port(buf+pos, io_parent, board); parse_slot_config() 397 pos += configure_port_init(buf+pos); parse_slot_config() 317 parse_slot_config(int slot, const unsigned char *buf, struct eeprom_eisa_slot_info *es, struct resource *io_parent, struct resource *mem_parent) parse_slot_config() argument
|
/linux-4.4.14/net/wireless/ |
H A D | debugfs.c | 21 char buf[buflen]; \ 24 res = scnprintf(buf, buflen, fmt "\n", ##value); \ 25 return simple_read_from_buffer(userbuf, count, ppos, buf, res); \ 44 char *buf, int buf_size, int offset) ht_print_chan() 50 return scnprintf(buf + offset, ht_print_chan() 55 return scnprintf(buf + offset, ht_print_chan() 70 char *buf; ht40allow_map_read() local 75 buf = kzalloc(buf_size, GFP_KERNEL); ht40allow_map_read() 76 if (!buf) ht40allow_map_read() 87 buf, buf_size, offset); ht40allow_map_read() 92 r = simple_read_from_buffer(user_buf, count, ppos, buf, offset); ht40allow_map_read() 94 kfree(buf); ht40allow_map_read() 43 ht_print_chan(struct ieee80211_channel *chan, char *buf, int buf_size, int offset) ht_print_chan() argument
|
/linux-4.4.14/tools/testing/selftests/efivarfs/ |
H A D | create-read.c | 14 char buf[4]; main() local 31 rc = read(fd, buf, sizeof(buf)); main()
|
/linux-4.4.14/drivers/scsi/qla4xxx/ |
H A D | ql4_attr.c | 14 struct bin_attribute *ba, char *buf, loff_t off, qla4_8xxx_sysfs_read_fw_dump() 26 return memory_read_from_buffer(buf, count, &off, ha->fw_dump, qla4_8xxx_sysfs_read_fw_dump() 32 struct bin_attribute *ba, char *buf, loff_t off, qla4_8xxx_sysfs_write_fw_dump() 47 buf[1] = 0; qla4_8xxx_sysfs_write_fw_dump() 48 ret = kstrtol(buf, 10, &reading); qla4_8xxx_sysfs_write_fw_dump() 155 struct device_attribute *attr, char *buf) qla4xxx_fw_version_show() 160 return snprintf(buf, PAGE_SIZE, "%d.%02d.%02d (%x)\n", qla4xxx_fw_version_show() 164 return snprintf(buf, PAGE_SIZE, "%d.%02d.%02d.%02d\n", qla4xxx_fw_version_show() 171 char *buf) qla4xxx_serial_num_show() 174 return snprintf(buf, PAGE_SIZE, "%s\n", ha->serial_number); qla4xxx_serial_num_show() 179 char *buf) qla4xxx_iscsi_version_show() 182 return snprintf(buf, PAGE_SIZE, "%d.%02d\n", ha->fw_info.iscsi_major, qla4xxx_iscsi_version_show() 188 char *buf) qla4xxx_optrom_version_show() 191 return snprintf(buf, PAGE_SIZE, "%d.%02d.%02d.%02d\n", qla4xxx_optrom_version_show() 198 char *buf) qla4xxx_board_id_show() 201 return snprintf(buf, PAGE_SIZE, "0x%08X\n", ha->board_id); qla4xxx_board_id_show() 206 char *buf) qla4xxx_fw_state_show() 211 return snprintf(buf, PAGE_SIZE, "0x%08X%8X\n", ha->firmware_state, qla4xxx_fw_state_show() 217 char *buf) qla4xxx_phy_port_cnt_show() 224 return snprintf(buf, PAGE_SIZE, "0x%04X\n", ha->phy_port_cnt); qla4xxx_phy_port_cnt_show() 229 char *buf) qla4xxx_phy_port_num_show() 236 return snprintf(buf, PAGE_SIZE, "0x%04X\n", ha->phy_port_num); qla4xxx_phy_port_num_show() 241 char *buf) qla4xxx_iscsi_func_cnt_show() 248 return snprintf(buf, PAGE_SIZE, "0x%04X\n", ha->iscsi_pci_func_cnt); qla4xxx_iscsi_func_cnt_show() 253 char *buf) qla4xxx_hba_model_show() 257 return snprintf(buf, PAGE_SIZE, "%s\n", ha->model_name); qla4xxx_hba_model_show() 262 char *buf) qla4xxx_fw_timestamp_show() 265 return snprintf(buf, PAGE_SIZE, "%s %s\n", ha->fw_info.fw_build_date, qla4xxx_fw_timestamp_show() 271 char *buf) qla4xxx_fw_build_user_show() 274 return snprintf(buf, PAGE_SIZE, "%s\n", ha->fw_info.fw_build_user); qla4xxx_fw_build_user_show() 279 char *buf) qla4xxx_fw_ext_timestamp_show() 282 return snprintf(buf, PAGE_SIZE, "%s\n", ha->fw_info.extended_timestamp); qla4xxx_fw_ext_timestamp_show() 287 char *buf) qla4xxx_fw_load_src_show() 304 return snprintf(buf, PAGE_SIZE, "%s\n", load_src); qla4xxx_fw_load_src_show() 309 char *buf) qla4xxx_fw_uptime_show() 313 return snprintf(buf, PAGE_SIZE, "%u.%u secs\n", ha->fw_uptime_secs, qla4xxx_fw_uptime_show() 13 qla4_8xxx_sysfs_read_fw_dump(struct file *filep, struct kobject *kobj, struct bin_attribute *ba, char *buf, loff_t off, size_t count) qla4_8xxx_sysfs_read_fw_dump() argument 31 qla4_8xxx_sysfs_write_fw_dump(struct file *filep, struct kobject *kobj, struct bin_attribute *ba, char *buf, loff_t off, size_t count) qla4_8xxx_sysfs_write_fw_dump() argument 154 qla4xxx_fw_version_show(struct device *dev, struct device_attribute *attr, char *buf) qla4xxx_fw_version_show() argument 170 qla4xxx_serial_num_show(struct device *dev, struct device_attribute *attr, char *buf) qla4xxx_serial_num_show() argument 178 qla4xxx_iscsi_version_show(struct device *dev, struct device_attribute *attr, char *buf) qla4xxx_iscsi_version_show() argument 187 qla4xxx_optrom_version_show(struct device *dev, struct device_attribute *attr, char *buf) qla4xxx_optrom_version_show() argument 197 qla4xxx_board_id_show(struct device *dev, struct device_attribute *attr, char *buf) qla4xxx_board_id_show() argument 205 qla4xxx_fw_state_show(struct device *dev, struct device_attribute *attr, char *buf) qla4xxx_fw_state_show() argument 216 qla4xxx_phy_port_cnt_show(struct device *dev, struct device_attribute *attr, char *buf) qla4xxx_phy_port_cnt_show() argument 228 qla4xxx_phy_port_num_show(struct device *dev, struct device_attribute *attr, char *buf) qla4xxx_phy_port_num_show() argument 240 qla4xxx_iscsi_func_cnt_show(struct device *dev, struct device_attribute *attr, char *buf) qla4xxx_iscsi_func_cnt_show() argument 252 qla4xxx_hba_model_show(struct device *dev, struct device_attribute *attr, char *buf) qla4xxx_hba_model_show() argument 261 qla4xxx_fw_timestamp_show(struct device *dev, struct device_attribute *attr, char *buf) qla4xxx_fw_timestamp_show() argument 270 qla4xxx_fw_build_user_show(struct device *dev, struct device_attribute *attr, char *buf) qla4xxx_fw_build_user_show() argument 278 qla4xxx_fw_ext_timestamp_show(struct device *dev, struct device_attribute *attr, char *buf) qla4xxx_fw_ext_timestamp_show() argument 286 qla4xxx_fw_load_src_show(struct device *dev, struct device_attribute *attr, char *buf) qla4xxx_fw_load_src_show() argument 308 qla4xxx_fw_uptime_show(struct device *dev, struct device_attribute *attr, char *buf) qla4xxx_fw_uptime_show() argument
|
/linux-4.4.14/drivers/net/ethernet/qualcomm/ |
H A D | qca_framing.c | 29 qcafrm_create_header(u8 *buf, u16 length) qcafrm_create_header() argument 33 if (!buf) qcafrm_create_header() 38 buf[0] = 0xAA; qcafrm_create_header() 39 buf[1] = 0xAA; qcafrm_create_header() 40 buf[2] = 0xAA; qcafrm_create_header() 41 buf[3] = 0xAA; qcafrm_create_header() 42 buf[4] = len & 0xff; qcafrm_create_header() 43 buf[5] = (len >> 8) & 0xff; qcafrm_create_header() 44 buf[6] = 0; qcafrm_create_header() 45 buf[7] = 0; qcafrm_create_header() 51 qcafrm_create_footer(u8 *buf) qcafrm_create_footer() argument 53 if (!buf) qcafrm_create_footer() 56 buf[0] = 0x55; qcafrm_create_footer() 57 buf[1] = 0x55; qcafrm_create_footer() 73 qcafrm_fsm_decode(struct qcafrm_handle *handle, u8 *buf, u16 buf_len, u8 recv_byte) qcafrm_fsm_decode() argument 131 buf[handle->offset] = recv_byte; qcafrm_fsm_decode()
|
/linux-4.4.14/drivers/net/ethernet/altera/ |
H A D | altera_tse_ethtool.c | 90 static void tse_gstrings(struct net_device *dev, u32 stringset, u8 *buf) tse_gstrings() argument 92 memcpy(buf, stat_gstrings, TSE_STATS_LEN * ETH_GSTRING_LEN); tse_gstrings() 96 u64 *buf) tse_fill_stats() 101 buf[0] = csrrd32(priv->mac_dev, tse_fill_stats() 103 buf[1] = csrrd32(priv->mac_dev, tse_fill_stats() 105 buf[2] = csrrd32(priv->mac_dev, tse_fill_stats() 107 buf[3] = csrrd32(priv->mac_dev, tse_fill_stats() 116 buf[4] = ext; tse_fill_stats() 124 buf[5] = ext; tse_fill_stats() 126 buf[6] = csrrd32(priv->mac_dev, tse_fill_stats() 128 buf[7] = csrrd32(priv->mac_dev, tse_fill_stats() 130 buf[8] = csrrd32(priv->mac_dev, tse_fill_stats() 132 buf[9] = csrrd32(priv->mac_dev, tse_fill_stats() 134 buf[10] = csrrd32(priv->mac_dev, tse_fill_stats() 136 buf[11] = csrrd32(priv->mac_dev, tse_fill_stats() 138 buf[12] = csrrd32(priv->mac_dev, tse_fill_stats() 140 buf[13] = csrrd32(priv->mac_dev, tse_fill_stats() 142 buf[14] = csrrd32(priv->mac_dev, tse_fill_stats() 144 buf[15] = csrrd32(priv->mac_dev, tse_fill_stats() 146 buf[16] = csrrd32(priv->mac_dev, tse_fill_stats() 148 buf[17] = csrrd32(priv->mac_dev, tse_fill_stats() 156 buf[18] = ext; tse_fill_stats() 158 buf[19] = csrrd32(priv->mac_dev, tse_fill_stats() 160 buf[20] = csrrd32(priv->mac_dev, tse_fill_stats() 162 buf[21] = csrrd32(priv->mac_dev, tse_fill_stats() 164 buf[22] = csrrd32(priv->mac_dev, tse_fill_stats() 166 buf[23] = csrrd32(priv->mac_dev, tse_fill_stats() 168 buf[24] = csrrd32(priv->mac_dev, tse_fill_stats() 170 buf[25] = csrrd32(priv->mac_dev, tse_fill_stats() 172 buf[26] = csrrd32(priv->mac_dev, tse_fill_stats() 174 buf[27] = csrrd32(priv->mac_dev, tse_fill_stats() 176 buf[28] = csrrd32(priv->mac_dev, tse_fill_stats() 178 buf[29] = csrrd32(priv->mac_dev, tse_fill_stats() 180 buf[30] = csrrd32(priv->mac_dev, tse_fill_stats() 216 u32 *buf = regbuf; tse_get_regs() local 233 buf[i] = csrrd32(priv->mac_dev, i * 4); tse_get_regs() 95 tse_fill_stats(struct net_device *dev, struct ethtool_stats *dummy, u64 *buf) tse_fill_stats() argument
|
/linux-4.4.14/drivers/bluetooth/ |
H A D | btmrvl_debugfs.c | 38 char buf[16]; btmrvl_hscfgcmd_write() local 41 memset(buf, 0, sizeof(buf)); btmrvl_hscfgcmd_write() 43 if (copy_from_user(&buf, ubuf, min_t(size_t, sizeof(buf) - 1, count))) btmrvl_hscfgcmd_write() 46 ret = kstrtol(buf, 10, &result); btmrvl_hscfgcmd_write() 64 char buf[16]; btmrvl_hscfgcmd_read() local 67 ret = snprintf(buf, sizeof(buf) - 1, "%d\n", btmrvl_hscfgcmd_read() 70 return simple_read_from_buffer(userbuf, count, ppos, buf, ret); btmrvl_hscfgcmd_read() 84 char buf[16]; btmrvl_pscmd_write() local 87 memset(buf, 0, sizeof(buf)); btmrvl_pscmd_write() 89 if (copy_from_user(&buf, ubuf, min_t(size_t, sizeof(buf) - 1, count))) btmrvl_pscmd_write() 92 ret = kstrtol(buf, 10, &result); btmrvl_pscmd_write() 111 char buf[16]; btmrvl_pscmd_read() local 114 ret = snprintf(buf, sizeof(buf) - 1, "%d\n", priv->btmrvl_dev.pscmd); btmrvl_pscmd_read() 116 return simple_read_from_buffer(userbuf, count, ppos, buf, ret); btmrvl_pscmd_read() 130 char buf[16]; btmrvl_hscmd_write() local 133 memset(buf, 0, sizeof(buf)); btmrvl_hscmd_write() 135 if (copy_from_user(&buf, ubuf, min_t(size_t, sizeof(buf) - 1, count))) btmrvl_hscmd_write() 138 ret = kstrtol(buf, 10, &result); btmrvl_hscmd_write() 155 char buf[16]; btmrvl_hscmd_read() local 158 ret = snprintf(buf, sizeof(buf) - 1, "%d\n", priv->btmrvl_dev.hscmd); btmrvl_hscmd_read() 160 return simple_read_from_buffer(userbuf, count, ppos, buf, ret); btmrvl_hscmd_read() 174 char buf[16]; btmrvl_fwdump_write() local 177 memset(buf, 0, sizeof(buf)); btmrvl_fwdump_write() 179 if (copy_from_user(&buf, ubuf, min_t(size_t, sizeof(buf) - 1, count))) btmrvl_fwdump_write() 182 if (strtobool(buf, &result)) btmrvl_fwdump_write()
|
/linux-4.4.14/arch/sparc/include/asm/ |
H A D | memctrl.h | 4 typedef int (*dimm_printer_t)(int synd_code, unsigned long paddr, char *buf, int buflen);
|
/linux-4.4.14/arch/m68k/include/asm/ |
H A D | parport.h | 16 #define insl(port,buf,len) isa_insb(port,buf,(len)<<2) 17 #define outsl(port,buf,len) isa_outsb(port,buf,(len)<<2)
|
H A D | raw_io.h | 114 static inline void raw_insb(volatile u8 __iomem *port, u8 *buf, unsigned int len) raw_insb() argument 119 *buf++ = in_8(port); raw_insb() 122 static inline void raw_outsb(volatile u8 __iomem *port, const u8 *buf, raw_outsb() argument 128 out_8(port, *buf++); raw_outsb() 131 static inline void raw_insw(volatile u16 __iomem *port, u16 *buf, unsigned int nr) raw_insw() argument 139 : "=a" (buf), "=d" (tmp) raw_insw() 140 : "a" (port), "0" (buf), raw_insw() 164 : "=a" (buf), "=d" (tmp) raw_insw() 165 : "a" (port), "0" (buf), raw_insw() 170 static inline void raw_outsw(volatile u16 __iomem *port, const u16 *buf, raw_outsw() argument 179 : "=a" (buf), "=d" (tmp) raw_outsw() 180 : "a" (port), "0" (buf), raw_outsw() 204 : "=a" (buf), "=d" (tmp) raw_outsw() 205 : "a" (port), "0" (buf), raw_outsw() 210 static inline void raw_insl(volatile u32 __iomem *port, u32 *buf, unsigned int nr) raw_insl() argument 218 : "=a" (buf), "=d" (tmp) raw_insl() 219 : "a" (port), "0" (buf), raw_insl() 243 : "=a" (buf), "=d" (tmp) raw_insl() 244 : "a" (port), "0" (buf), raw_insl() 249 static inline void raw_outsl(volatile u32 __iomem *port, const u32 *buf, raw_outsl() argument 258 : "=a" (buf), "=d" (tmp) raw_outsl() 259 : "a" (port), "0" (buf), raw_outsl() 283 : "=a" (buf), "=d" (tmp) raw_outsl() 284 : "a" (port), "0" (buf), raw_outsl() 290 static inline void raw_insw_swapw(volatile u16 __iomem *port, u16 *buf, raw_insw_swapw() argument 304 : "g" (port), "g" (buf), "g" (nr) raw_insw_swapw() 339 : "g" (port), "g" (buf), "g" (nr) raw_insw_swapw() 343 static inline void raw_outsw_swapw(volatile u16 __iomem *port, const u16 *buf, raw_outsw_swapw() argument 357 : "g" (port), "g" (buf), "g" (nr) raw_outsw_swapw() 392 : "g" (port), "g" (buf), "g" (nr) raw_outsw_swapw() 398 static inline void raw_rom_insb(volatile u8 __iomem *port, u8 *buf, unsigned int len) raw_rom_insb() argument 403 *buf++ = rom_in_8(port); raw_rom_insb() 406 static inline void raw_rom_outsb(volatile u8 __iomem *port, const u8 *buf, raw_rom_outsb() argument 412 rom_out_8(port, *buf++); raw_rom_outsb() 415 static inline void raw_rom_insw(volatile u16 __iomem *port, u16 *buf, raw_rom_insw() argument 421 *buf++ = rom_in_be16(port); raw_rom_insw() 424 static inline void raw_rom_outsw(volatile u16 __iomem *port, const u16 *buf, raw_rom_outsw() argument 430 rom_out_be16(port, *buf++); raw_rom_outsw() 433 static inline void raw_rom_insw_swapw(volatile u16 __iomem *port, u16 *buf, raw_rom_insw_swapw() argument 439 *buf++ = rom_in_le16(port); raw_rom_insw_swapw() 442 static inline void raw_rom_outsw_swapw(volatile u16 __iomem *port, const u16 *buf, raw_rom_outsw_swapw() argument 448 rom_out_le16(port, *buf++); raw_rom_outsw_swapw()
|
/linux-4.4.14/include/linux/mfd/ |
H A D | qcom_rpm.h | 11 int qcom_rpm_write(struct qcom_rpm *rpm, int state, int resource, u32 *buf, size_t count);
|
/linux-4.4.14/drivers/net/ethernet/mellanox/mlx5/core/ |
H A D | alloc.c | 67 struct mlx5_buf *buf, int node) mlx5_buf_alloc_node() 71 buf->size = size; mlx5_buf_alloc_node() 72 buf->npages = 1; mlx5_buf_alloc_node() 73 buf->page_shift = (u8)get_order(size) + PAGE_SHIFT; mlx5_buf_alloc_node() 74 buf->direct.buf = mlx5_dma_zalloc_coherent_node(dev, size, mlx5_buf_alloc_node() 76 if (!buf->direct.buf) mlx5_buf_alloc_node() 79 buf->direct.map = t; mlx5_buf_alloc_node() 81 while (t & ((1 << buf->page_shift) - 1)) { mlx5_buf_alloc_node() 82 --buf->page_shift; mlx5_buf_alloc_node() 83 buf->npages *= 2; mlx5_buf_alloc_node() 89 int mlx5_buf_alloc(struct mlx5_core_dev *dev, int size, struct mlx5_buf *buf) mlx5_buf_alloc() argument 91 return mlx5_buf_alloc_node(dev, size, buf, dev->priv.numa_node); mlx5_buf_alloc() 95 void mlx5_buf_free(struct mlx5_core_dev *dev, struct mlx5_buf *buf) mlx5_buf_free() argument 97 dma_free_coherent(&dev->pdev->dev, buf->size, buf->direct.buf, mlx5_buf_free() 98 buf->direct.map); mlx5_buf_free() 200 void mlx5_fill_page_array(struct mlx5_buf *buf, __be64 *pas) mlx5_fill_page_array() argument 205 for (i = 0; i < buf->npages; i++) { mlx5_fill_page_array() 206 addr = buf->direct.map + (i << buf->page_shift); mlx5_fill_page_array() 66 mlx5_buf_alloc_node(struct mlx5_core_dev *dev, int size, struct mlx5_buf *buf, int node) mlx5_buf_alloc_node() argument
|
/linux-4.4.14/drivers/net/ethernet/cisco/enic/ |
H A D | vnic_wq.c | 33 struct vnic_wq_buf *buf; vnic_wq_alloc_bufs() local 44 buf = wq->bufs[i]; vnic_wq_alloc_bufs() 46 buf->index = i * VNIC_WQ_BUF_BLK_ENTRIES(count) + j; vnic_wq_alloc_bufs() 47 buf->desc = (u8 *)wq->ring.descs + vnic_wq_alloc_bufs() 48 wq->ring.desc_size * buf->index; vnic_wq_alloc_bufs() 49 if (buf->index + 1 == count) { vnic_wq_alloc_bufs() 50 buf->next = wq->bufs[0]; vnic_wq_alloc_bufs() 51 buf->next->prev = buf; vnic_wq_alloc_bufs() 54 buf->next = wq->bufs[i + 1]; vnic_wq_alloc_bufs() 55 buf->next->prev = buf; vnic_wq_alloc_bufs() 57 buf->next = buf + 1; vnic_wq_alloc_bufs() 58 buf->next->prev = buf; vnic_wq_alloc_bufs() 59 buf++; vnic_wq_alloc_bufs() 196 void (*buf_clean)(struct vnic_wq *wq, struct vnic_wq_buf *buf)) vnic_wq_clean() 198 struct vnic_wq_buf *buf; vnic_wq_clean() local 200 buf = wq->to_clean; vnic_wq_clean() 204 (*buf_clean)(wq, buf); vnic_wq_clean() 206 buf = wq->to_clean = buf->next; vnic_wq_clean() 195 vnic_wq_clean(struct vnic_wq *wq, void (*buf_clean)(struct vnic_wq *wq, struct vnic_wq_buf *buf)) vnic_wq_clean() argument
|
/linux-4.4.14/drivers/s390/net/ |
H A D | qeth_core_sys.c | 19 struct device_attribute *attr, char *buf) qeth_dev_state_show() 27 return sprintf(buf, "DOWN\n"); qeth_dev_state_show() 29 return sprintf(buf, "HARDSETUP\n"); qeth_dev_state_show() 31 return sprintf(buf, "SOFTSETUP\n"); qeth_dev_state_show() 34 return sprintf(buf, "UP (LAN ONLINE)\n"); qeth_dev_state_show() 36 return sprintf(buf, "UP (LAN OFFLINE)\n"); qeth_dev_state_show() 38 return sprintf(buf, "RECOVER\n"); qeth_dev_state_show() 40 return sprintf(buf, "UNKNOWN\n"); qeth_dev_state_show() 47 struct device_attribute *attr, char *buf) qeth_dev_chpid_show() 53 return sprintf(buf, "%02X\n", card->info.chpid); qeth_dev_chpid_show() 59 struct device_attribute *attr, char *buf) qeth_dev_if_name_show() 64 return sprintf(buf, "%s\n", QETH_CARD_IFNAME(card)); qeth_dev_if_name_show() 70 struct device_attribute *attr, char *buf) qeth_dev_card_type_show() 76 return sprintf(buf, "%s\n", qeth_get_cardname_short(card)); qeth_dev_card_type_show() 96 struct device_attribute *attr, char *buf) qeth_dev_inbuf_size_show() 102 return sprintf(buf, "%s\n", qeth_get_bufsize_str(card)); qeth_dev_inbuf_size_show() 108 struct device_attribute *attr, char *buf) qeth_dev_portno_show() 114 return sprintf(buf, "%i\n", card->info.portno); qeth_dev_portno_show() 118 struct device_attribute *attr, const char *buf, size_t count) qeth_dev_portno_store() 135 portno = simple_strtoul(buf, &tmp, 16); qeth_dev_portno_store() 154 struct device_attribute *attr, char *buf) qeth_dev_portname_show() 156 return sprintf(buf, "no portname required\n"); qeth_dev_portname_show() 160 struct device_attribute *attr, const char *buf, size_t count) qeth_dev_portname_store() 173 struct device_attribute *attr, char *buf) qeth_dev_prioqing_show() 182 return sprintf(buf, "%s\n", "by precedence"); qeth_dev_prioqing_show() 184 return sprintf(buf, "%s\n", "by type of service"); qeth_dev_prioqing_show() 186 return sprintf(buf, "%s\n", "by skb-priority"); qeth_dev_prioqing_show() 188 return sprintf(buf, "%s\n", "by VLAN headers"); qeth_dev_prioqing_show() 190 return sprintf(buf, "always queue %i\n", qeth_dev_prioqing_show() 196 struct device_attribute *attr, const char *buf, size_t count) qeth_dev_prioqing_store() 220 if (sysfs_streq(buf, "prio_queueing_prec")) { qeth_dev_prioqing_store() 223 } else if (sysfs_streq(buf, "prio_queueing_skb")) { qeth_dev_prioqing_store() 226 } else if (sysfs_streq(buf, "prio_queueing_tos")) { qeth_dev_prioqing_store() 229 } else if (sysfs_streq(buf, "prio_queueing_vlan")) { qeth_dev_prioqing_store() 236 } else if (sysfs_streq(buf, "no_prio_queueing:0")) { qeth_dev_prioqing_store() 239 } else if (sysfs_streq(buf, "no_prio_queueing:1")) { qeth_dev_prioqing_store() 242 } else if (sysfs_streq(buf, "no_prio_queueing:2")) { qeth_dev_prioqing_store() 245 } else if (sysfs_streq(buf, "no_prio_queueing:3")) { qeth_dev_prioqing_store() 248 } else if (sysfs_streq(buf, "no_prio_queueing")) { qeth_dev_prioqing_store() 262 struct device_attribute *attr, char *buf) qeth_dev_bufcnt_show() 269 return sprintf(buf, "%i\n", card->qdio.in_buf_pool.buf_count); qeth_dev_bufcnt_show() 273 struct device_attribute *attr, const char *buf, size_t count) qeth_dev_bufcnt_store() 291 cnt = simple_strtoul(buf, &tmp, 10); qeth_dev_bufcnt_store() 306 struct device_attribute *attr, const char *buf, size_t count) qeth_dev_recover_store() 318 i = simple_strtoul(buf, &tmp, 16); qeth_dev_recover_store() 328 struct device_attribute *attr, char *buf) qeth_dev_performance_stats_show() 335 return sprintf(buf, "%i\n", card->options.performance_stats ? 1:0); qeth_dev_performance_stats_show() 339 struct device_attribute *attr, const char *buf, size_t count) qeth_dev_performance_stats_store() 349 i = simple_strtoul(buf, &tmp, 16); qeth_dev_performance_stats_store() 370 struct device_attribute *attr, char *buf) qeth_dev_layer2_show() 377 return sprintf(buf, "%i\n", card->options.layer2); qeth_dev_layer2_show() 381 struct device_attribute *attr, const char *buf, size_t count) qeth_dev_layer2_store() 397 i = simple_strtoul(buf, &tmp, 16); qeth_dev_layer2_store() 438 struct device_attribute *attr, char *buf) qeth_dev_isolation_show() 447 return snprintf(buf, 6, "%s\n", ATTR_QETH_ISOLATION_NONE); qeth_dev_isolation_show() 449 return snprintf(buf, 9, "%s\n", ATTR_QETH_ISOLATION_FWD); qeth_dev_isolation_show() 451 return snprintf(buf, 6, "%s\n", ATTR_QETH_ISOLATION_DROP); qeth_dev_isolation_show() 453 return snprintf(buf, 5, "%s\n", "N/A"); qeth_dev_isolation_show() 458 struct device_attribute *attr, const char *buf, size_t count) qeth_dev_isolation_store() 479 if (sysfs_streq(buf, ATTR_QETH_ISOLATION_NONE)) { qeth_dev_isolation_store() 481 } else if (sysfs_streq(buf, ATTR_QETH_ISOLATION_FWD)) { qeth_dev_isolation_store() 483 } else if (sysfs_streq(buf, ATTR_QETH_ISOLATION_DROP)) { qeth_dev_isolation_store() 508 struct device_attribute *attr, char *buf) qeth_dev_switch_attrs_show() 518 return sprintf(buf, "n/a\n"); qeth_dev_switch_attrs_show() 525 rc = sprintf(buf, "unknown"); qeth_dev_switch_attrs_show() 528 rc = sprintf(buf, (sw_info.settings & QETH_SWITCH_FORW_802_1 ? qeth_dev_switch_attrs_show() 531 rc += sprintf(buf + rc, qeth_dev_switch_attrs_show() 534 rc += sprintf(buf + rc, "\n"); qeth_dev_switch_attrs_show() 543 struct device_attribute *attr, char *buf) qeth_hw_trap_show() 550 return snprintf(buf, 5, "arm\n"); qeth_hw_trap_show() 552 return snprintf(buf, 8, "disarm\n"); qeth_hw_trap_show() 556 struct device_attribute *attr, const char *buf, size_t count) qeth_hw_trap_store() 569 if (sysfs_streq(buf, "arm") && !card->info.hwtrap) { qeth_hw_trap_store() 580 } else if (sysfs_streq(buf, "disarm") && card->info.hwtrap) { qeth_hw_trap_store() 587 } else if (sysfs_streq(buf, "trap") && state && card->info.hwtrap) qeth_hw_trap_store() 599 static ssize_t qeth_dev_blkt_show(char *buf, struct qeth_card *card, int value) qeth_dev_blkt_show() argument 605 return sprintf(buf, "%i\n", value); qeth_dev_blkt_show() 609 const char *buf, size_t count, int *value, int max_value) qeth_dev_blkt_store() 623 i = simple_strtoul(buf, &tmp, 10); qeth_dev_blkt_store() 634 struct device_attribute *attr, char *buf) qeth_dev_blkt_total_show() 638 return qeth_dev_blkt_show(buf, card, card->info.blkt.time_total); qeth_dev_blkt_total_show() 642 struct device_attribute *attr, const char *buf, size_t count) qeth_dev_blkt_total_store() 646 return qeth_dev_blkt_store(card, buf, count, qeth_dev_blkt_total_store() 656 struct device_attribute *attr, char *buf) qeth_dev_blkt_inter_show() 660 return qeth_dev_blkt_show(buf, card, card->info.blkt.inter_packet); qeth_dev_blkt_inter_show() 664 struct device_attribute *attr, const char *buf, size_t count) qeth_dev_blkt_inter_store() 668 return qeth_dev_blkt_store(card, buf, count, qeth_dev_blkt_inter_store() 676 struct device_attribute *attr, char *buf) qeth_dev_blkt_inter_jumbo_show() 680 return qeth_dev_blkt_show(buf, card, qeth_dev_blkt_inter_jumbo_show() 685 struct device_attribute *attr, const char *buf, size_t count) qeth_dev_blkt_inter_jumbo_store() 689 return qeth_dev_blkt_store(card, buf, count, qeth_dev_blkt_inter_jumbo_store() 18 qeth_dev_state_show(struct device *dev, struct device_attribute *attr, char *buf) qeth_dev_state_show() argument 46 qeth_dev_chpid_show(struct device *dev, struct device_attribute *attr, char *buf) qeth_dev_chpid_show() argument 58 qeth_dev_if_name_show(struct device *dev, struct device_attribute *attr, char *buf) qeth_dev_if_name_show() argument 69 qeth_dev_card_type_show(struct device *dev, struct device_attribute *attr, char *buf) qeth_dev_card_type_show() argument 95 qeth_dev_inbuf_size_show(struct device *dev, struct device_attribute *attr, char *buf) qeth_dev_inbuf_size_show() argument 107 qeth_dev_portno_show(struct device *dev, struct device_attribute *attr, char *buf) qeth_dev_portno_show() argument 117 qeth_dev_portno_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) qeth_dev_portno_store() argument 153 qeth_dev_portname_show(struct device *dev, struct device_attribute *attr, char *buf) qeth_dev_portname_show() argument 159 qeth_dev_portname_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) qeth_dev_portname_store() argument 172 qeth_dev_prioqing_show(struct device *dev, struct device_attribute *attr, char *buf) qeth_dev_prioqing_show() argument 195 qeth_dev_prioqing_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) qeth_dev_prioqing_store() argument 261 qeth_dev_bufcnt_show(struct device *dev, struct device_attribute *attr, char *buf) qeth_dev_bufcnt_show() argument 272 qeth_dev_bufcnt_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) qeth_dev_bufcnt_store() argument 305 qeth_dev_recover_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) qeth_dev_recover_store() argument 327 qeth_dev_performance_stats_show(struct device *dev, struct device_attribute *attr, char *buf) qeth_dev_performance_stats_show() argument 338 qeth_dev_performance_stats_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) qeth_dev_performance_stats_store() argument 369 qeth_dev_layer2_show(struct device *dev, struct device_attribute *attr, char *buf) qeth_dev_layer2_show() argument 380 qeth_dev_layer2_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) qeth_dev_layer2_store() argument 437 qeth_dev_isolation_show(struct device *dev, struct device_attribute *attr, char *buf) qeth_dev_isolation_show() argument 457 qeth_dev_isolation_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) qeth_dev_isolation_store() argument 507 qeth_dev_switch_attrs_show(struct device *dev, struct device_attribute *attr, char *buf) qeth_dev_switch_attrs_show() argument 542 qeth_hw_trap_show(struct device *dev, struct device_attribute *attr, char *buf) qeth_hw_trap_show() argument 555 qeth_hw_trap_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) qeth_hw_trap_store() argument 608 qeth_dev_blkt_store(struct qeth_card *card, const char *buf, size_t count, int *value, int max_value) qeth_dev_blkt_store() argument 633 qeth_dev_blkt_total_show(struct device *dev, struct device_attribute *attr, char *buf) qeth_dev_blkt_total_show() argument 641 qeth_dev_blkt_total_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) qeth_dev_blkt_total_store() argument 655 qeth_dev_blkt_inter_show(struct device *dev, struct device_attribute *attr, char *buf) qeth_dev_blkt_inter_show() argument 663 qeth_dev_blkt_inter_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) qeth_dev_blkt_inter_store() argument 675 qeth_dev_blkt_inter_jumbo_show(struct device *dev, struct device_attribute *attr, char *buf) qeth_dev_blkt_inter_jumbo_show() argument 684 qeth_dev_blkt_inter_jumbo_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) qeth_dev_blkt_inter_jumbo_store() argument
|
H A D | qeth_l2_sys.c | 15 struct device_attribute *attr, char *buf, qeth_bridge_port_role_state_show() 57 rc = sprintf(buf, "%s\n", word); qeth_bridge_port_role_state_show() 64 struct device_attribute *attr, char *buf) qeth_bridge_port_role_show() 66 return qeth_bridge_port_role_state_show(dev, attr, buf, 0); qeth_bridge_port_role_show() 70 struct device_attribute *attr, const char *buf, size_t count) qeth_bridge_port_role_store() 78 if (sysfs_streq(buf, "primary")) qeth_bridge_port_role_store() 80 else if (sysfs_streq(buf, "secondary")) qeth_bridge_port_role_store() 82 else if (sysfs_streq(buf, "none")) qeth_bridge_port_role_store() 107 struct device_attribute *attr, char *buf) qeth_bridge_port_state_show() 109 return qeth_bridge_port_role_state_show(dev, attr, buf, 1); qeth_bridge_port_state_show() 116 struct device_attribute *attr, char *buf) qeth_bridgeport_hostnotification_show() 126 return sprintf(buf, "%d\n", enabled); qeth_bridgeport_hostnotification_show() 130 struct device_attribute *attr, const char *buf, size_t count) qeth_bridgeport_hostnotification_store() 139 if (sysfs_streq(buf, "0")) qeth_bridgeport_hostnotification_store() 141 else if (sysfs_streq(buf, "1")) qeth_bridgeport_hostnotification_store() 165 struct device_attribute *attr, char *buf) qeth_bridgeport_reflect_show() 181 return sprintf(buf, "%s\n", state); qeth_bridgeport_reflect_show() 185 struct device_attribute *attr, const char *buf, size_t count) qeth_bridgeport_reflect_store() 194 if (sysfs_streq(buf, "none")) { qeth_bridgeport_reflect_store() 197 } else if (sysfs_streq(buf, "primary")) { qeth_bridgeport_reflect_store() 200 } else if (sysfs_streq(buf, "secondary")) { qeth_bridgeport_reflect_store() 14 qeth_bridge_port_role_state_show(struct device *dev, struct device_attribute *attr, char *buf, int show_state) qeth_bridge_port_role_state_show() argument 63 qeth_bridge_port_role_show(struct device *dev, struct device_attribute *attr, char *buf) qeth_bridge_port_role_show() argument 69 qeth_bridge_port_role_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) qeth_bridge_port_role_store() argument 106 qeth_bridge_port_state_show(struct device *dev, struct device_attribute *attr, char *buf) qeth_bridge_port_state_show() argument 115 qeth_bridgeport_hostnotification_show(struct device *dev, struct device_attribute *attr, char *buf) qeth_bridgeport_hostnotification_show() argument 129 qeth_bridgeport_hostnotification_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) qeth_bridgeport_hostnotification_store() argument 164 qeth_bridgeport_reflect_show(struct device *dev, struct device_attribute *attr, char *buf) qeth_bridgeport_reflect_show() argument 184 qeth_bridgeport_reflect_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) qeth_bridgeport_reflect_store() argument
|
/linux-4.4.14/kernel/power/ |
H A D | main.c | 52 char *buf) pm_async_show() 54 return sprintf(buf, "%d\n", pm_async_enabled); pm_async_show() 58 const char *buf, size_t n) pm_async_store() 62 if (kstrtoul(buf, 10, &val)) pm_async_store() 87 char *buf) pm_test_show() 89 char *s = buf; pm_test_show() 100 if (s != buf) pm_test_show() 104 return (s - buf); pm_test_show() 108 const char *buf, size_t n) pm_test_store() 116 p = memchr(buf, '\n', n); pm_test_store() 117 len = p ? p - buf : n; pm_test_store() 123 if (*s && len == strlen(*s) && !strncmp(buf, *s, len)) { pm_test_store() 248 struct kobj_attribute *attr, char *buf) pm_print_times_show() 250 return sprintf(buf, "%d\n", pm_print_times_enabled); pm_print_times_show() 255 const char *buf, size_t n) pm_print_times_store() 259 if (kstrtoul(buf, 10, &val)) pm_print_times_store() 278 char *buf) pm_wakeup_irq_show() 280 return pm_wakeup_irq ? sprintf(buf, "%u\n", pm_wakeup_irq) : -ENODATA; pm_wakeup_irq_show() 285 const char *buf, size_t n) pm_wakeup_irq_store() 308 char *buf) state_show() 310 char *s = buf; state_show() 321 if (s != buf) state_show() 324 return (s - buf); state_show() 327 static suspend_state_t decode_state(const char *buf, size_t n) decode_state() argument 335 p = memchr(buf, '\n', n); decode_state() 336 len = p ? p - buf : n; decode_state() 339 if (len == 4 && !strncmp(buf, "disk", len)) decode_state() 346 if (label && len == strlen(label) && !strncmp(buf, label, len)) decode_state() 355 const char *buf, size_t n) state_store() 369 state = decode_state(buf, n); state_store() 415 char *buf) wakeup_count_show() 420 sprintf(buf, "%u\n", val) : -EINTR; wakeup_count_show() 425 const char *buf, size_t n) wakeup_count_store() 440 if (sscanf(buf, "%u", &val) == 1) { wakeup_count_store() 457 char *buf) autosleep_show() 462 return sprintf(buf, "off\n"); autosleep_show() 466 return sprintf(buf, "%s\n", pm_states[state] ? autosleep_show() 470 return sprintf(buf, "disk\n"); autosleep_show() 472 return sprintf(buf, "error"); autosleep_show() 478 const char *buf, size_t n) autosleep_store() 480 suspend_state_t state = decode_state(buf, n); autosleep_store() 484 && strcmp(buf, "off") && strcmp(buf, "off\n")) autosleep_store() 497 char *buf) wake_lock_show() 499 return pm_show_wakelocks(buf, true); wake_lock_show() 504 const char *buf, size_t n) wake_lock_store() 506 int error = pm_wake_lock(buf); wake_lock_store() 514 char *buf) wake_unlock_show() 516 return pm_show_wakelocks(buf, false); wake_unlock_show() 521 const char *buf, size_t n) wake_unlock_store() 523 int error = pm_wake_unlock(buf); wake_unlock_store() 536 char *buf) pm_trace_show() 538 return sprintf(buf, "%d\n", pm_trace_enabled); pm_trace_show() 543 const char *buf, size_t n) pm_trace_store() 547 if (sscanf(buf, "%d", &val) == 1) { pm_trace_store() 562 char *buf) pm_trace_dev_match_show() 564 return show_trace_dev_match(buf, PAGE_SIZE); pm_trace_dev_match_show() 569 const char *buf, size_t n) pm_trace_dev_match_store() 580 struct kobj_attribute *attr, char *buf) pm_freeze_timeout_show() 582 return sprintf(buf, "%u\n", freeze_timeout_msecs); pm_freeze_timeout_show() 587 const char *buf, size_t n) pm_freeze_timeout_store() 591 if (kstrtoul(buf, 10, &val)) pm_freeze_timeout_store() 51 pm_async_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) pm_async_show() argument 57 pm_async_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t n) pm_async_store() argument 86 pm_test_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) pm_test_show() argument 107 pm_test_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t n) pm_test_store() argument 247 pm_print_times_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) pm_print_times_show() argument 253 pm_print_times_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t n) pm_print_times_store() argument 276 pm_wakeup_irq_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) pm_wakeup_irq_show() argument 283 pm_wakeup_irq_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t n) pm_wakeup_irq_store() argument 307 state_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) state_show() argument 354 state_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t n) state_store() argument 413 wakeup_count_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) wakeup_count_show() argument 423 wakeup_count_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t n) wakeup_count_store() argument 455 autosleep_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) autosleep_show() argument 476 autosleep_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t n) autosleep_store() argument 495 wake_lock_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) wake_lock_show() argument 502 wake_lock_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t n) wake_lock_store() argument 512 wake_unlock_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) wake_unlock_show() argument 519 wake_unlock_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t n) wake_unlock_store() argument 535 pm_trace_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) pm_trace_show() argument 542 pm_trace_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t n) pm_trace_store() argument 560 pm_trace_dev_match_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) pm_trace_dev_match_show() argument 568 pm_trace_dev_match_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t n) pm_trace_dev_match_store() argument 579 pm_freeze_timeout_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) pm_freeze_timeout_show() argument 585 pm_freeze_timeout_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t n) pm_freeze_timeout_store() argument
|
/linux-4.4.14/drivers/base/power/ |
H A D | sysfs.c | 102 char *buf) control_show() 104 return sprintf(buf, "%s\n", control_show() 109 const char * buf, size_t n) control_store() 114 cp = memchr(buf, '\n', n); control_store() 116 len = cp - buf; control_store() 118 if (len == sizeof ctrl_auto - 1 && strncmp(buf, ctrl_auto, len) == 0) control_store() 120 else if (len == sizeof ctrl_on - 1 && strncmp(buf, ctrl_on, len) == 0) control_store() 131 struct device_attribute *attr, char *buf) rtpm_active_time_show() 136 ret = sprintf(buf, "%i\n", jiffies_to_msecs(dev->power.active_jiffies)); rtpm_active_time_show() 144 struct device_attribute *attr, char *buf) rtpm_suspended_time_show() 149 ret = sprintf(buf, "%i\n", rtpm_suspended_time_show() 158 struct device_attribute *attr, char *buf) rtpm_status_show() 184 return sprintf(buf, p); rtpm_status_show() 190 struct device_attribute *attr, char *buf) autosuspend_delay_ms_show() 194 return sprintf(buf, "%d\n", dev->power.autosuspend_delay); autosuspend_delay_ms_show() 198 struct device_attribute *attr, const char *buf, size_t n) autosuspend_delay_ms_store() 205 if (kstrtol(buf, 10, &delay) != 0 || delay != (int) delay) autosuspend_delay_ms_store() 219 char *buf) pm_qos_resume_latency_show() 221 return sprintf(buf, "%d\n", dev_pm_qos_requested_resume_latency(dev)); pm_qos_resume_latency_show() 226 const char *buf, size_t n) pm_qos_resume_latency_store() 231 if (kstrtos32(buf, 0, &value)) pm_qos_resume_latency_store() 247 char *buf) pm_qos_latency_tolerance_show() 252 return sprintf(buf, "auto\n"); pm_qos_latency_tolerance_show() 254 return sprintf(buf, "any\n"); pm_qos_latency_tolerance_show() 256 return sprintf(buf, "%d\n", value); pm_qos_latency_tolerance_show() 261 const char *buf, size_t n) pm_qos_latency_tolerance_store() 266 if (kstrtos32(buf, 0, &value)) { pm_qos_latency_tolerance_store() 267 if (!strcmp(buf, "auto") || !strcmp(buf, "auto\n")) pm_qos_latency_tolerance_store() 269 else if (!strcmp(buf, "any") || !strcmp(buf, "any\n")) pm_qos_latency_tolerance_store() 281 char *buf) pm_qos_no_power_off_show() 283 return sprintf(buf, "%d\n", !!(dev_pm_qos_requested_flags(dev) pm_qos_no_power_off_show() 289 const char *buf, size_t n) pm_qos_no_power_off_store() 293 if (kstrtoint(buf, 0, &ret)) pm_qos_no_power_off_store() 308 char *buf) pm_qos_remote_wakeup_show() 310 return sprintf(buf, "%d\n", !!(dev_pm_qos_requested_flags(dev) pm_qos_remote_wakeup_show() 316 const char *buf, size_t n) pm_qos_remote_wakeup_store() 320 if (kstrtoint(buf, 0, &ret)) pm_qos_remote_wakeup_store() 338 wake_show(struct device * dev, struct device_attribute *attr, char * buf) wake_show() argument 340 return sprintf(buf, "%s\n", device_can_wakeup(dev) wake_show() 347 const char * buf, size_t n) wake_store() 355 cp = memchr(buf, '\n', n); wake_store() 357 len = cp - buf; wake_store() 359 && strncmp(buf, _enabled, sizeof _enabled - 1) == 0) wake_store() 362 && strncmp(buf, _disabled, sizeof _disabled - 1) == 0) wake_store() 372 struct device_attribute *attr, char *buf) wakeup_count_show() 383 return enabled ? sprintf(buf, "%lu\n", count) : sprintf(buf, "\n"); wakeup_count_show() 389 struct device_attribute *attr, char *buf) wakeup_active_count_show() 400 return enabled ? sprintf(buf, "%lu\n", count) : sprintf(buf, "\n"); wakeup_active_count_show() 407 char *buf) wakeup_abort_count_show() 418 return enabled ? sprintf(buf, "%lu\n", count) : sprintf(buf, "\n"); wakeup_abort_count_show() 425 char *buf) wakeup_expire_count_show() 436 return enabled ? sprintf(buf, "%lu\n", count) : sprintf(buf, "\n"); wakeup_expire_count_show() 442 struct device_attribute *attr, char *buf) wakeup_active_show() 453 return enabled ? sprintf(buf, "%u\n", active) : sprintf(buf, "\n"); wakeup_active_show() 459 struct device_attribute *attr, char *buf) wakeup_total_time_show() 470 return enabled ? sprintf(buf, "%lld\n", msec) : sprintf(buf, "\n"); wakeup_total_time_show() 476 struct device_attribute *attr, char *buf) wakeup_max_time_show() 487 return enabled ? sprintf(buf, "%lld\n", msec) : sprintf(buf, "\n"); wakeup_max_time_show() 493 struct device_attribute *attr, char *buf) wakeup_last_time_show() 504 return enabled ? sprintf(buf, "%lld\n", msec) : sprintf(buf, "\n"); wakeup_last_time_show() 512 char *buf) wakeup_prevent_sleep_time_show() 523 return enabled ? sprintf(buf, "%lld\n", msec) : sprintf(buf, "\n"); wakeup_prevent_sleep_time_show() 533 struct device_attribute *attr, char *buf) rtpm_usagecount_show() 535 return sprintf(buf, "%d\n", atomic_read(&dev->power.usage_count)); rtpm_usagecount_show() 539 struct device_attribute *attr, char *buf) rtpm_children_show() 541 return sprintf(buf, "%d\n", dev->power.ignore_children ? rtpm_children_show() 546 struct device_attribute *attr, char *buf) rtpm_enabled_show() 549 return sprintf(buf, "disabled & forbidden\n"); rtpm_enabled_show() 551 return sprintf(buf, "disabled\n"); rtpm_enabled_show() 553 return sprintf(buf, "forbidden\n"); rtpm_enabled_show() 554 return sprintf(buf, "enabled\n"); rtpm_enabled_show() 563 char *buf) async_show() 565 return sprintf(buf, "%s\n", async_show() 571 const char *buf, size_t n) async_store() 576 cp = memchr(buf, '\n', n); async_store() 578 len = cp - buf; async_store() 579 if (len == sizeof _enabled - 1 && strncmp(buf, _enabled, len) == 0) async_store() 582 strncmp(buf, _disabled, len) == 0) async_store() 101 control_show(struct device *dev, struct device_attribute *attr, char *buf) control_show() argument 108 control_store(struct device * dev, struct device_attribute *attr, const char * buf, size_t n) control_store() argument 130 rtpm_active_time_show(struct device *dev, struct device_attribute *attr, char *buf) rtpm_active_time_show() argument 143 rtpm_suspended_time_show(struct device *dev, struct device_attribute *attr, char *buf) rtpm_suspended_time_show() argument 157 rtpm_status_show(struct device *dev, struct device_attribute *attr, char *buf) rtpm_status_show() argument 189 autosuspend_delay_ms_show(struct device *dev, struct device_attribute *attr, char *buf) autosuspend_delay_ms_show() argument 197 autosuspend_delay_ms_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t n) autosuspend_delay_ms_store() argument 217 pm_qos_resume_latency_show(struct device *dev, struct device_attribute *attr, char *buf) pm_qos_resume_latency_show() argument 224 pm_qos_resume_latency_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t n) pm_qos_resume_latency_store() argument 245 pm_qos_latency_tolerance_show(struct device *dev, struct device_attribute *attr, char *buf) pm_qos_latency_tolerance_show() argument 259 pm_qos_latency_tolerance_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t n) pm_qos_latency_tolerance_store() argument 279 pm_qos_no_power_off_show(struct device *dev, struct device_attribute *attr, char *buf) pm_qos_no_power_off_show() argument 287 pm_qos_no_power_off_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t n) pm_qos_no_power_off_store() argument 306 pm_qos_remote_wakeup_show(struct device *dev, struct device_attribute *attr, char *buf) pm_qos_remote_wakeup_show() argument 314 pm_qos_remote_wakeup_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t n) pm_qos_remote_wakeup_store() argument 346 wake_store(struct device * dev, struct device_attribute *attr, const char * buf, size_t n) wake_store() argument 371 wakeup_count_show(struct device *dev, struct device_attribute *attr, char *buf) wakeup_count_show() argument 388 wakeup_active_count_show(struct device *dev, struct device_attribute *attr, char *buf) wakeup_active_count_show() argument 405 wakeup_abort_count_show(struct device *dev, struct device_attribute *attr, char *buf) wakeup_abort_count_show() argument 423 wakeup_expire_count_show(struct device *dev, struct device_attribute *attr, char *buf) wakeup_expire_count_show() argument 441 wakeup_active_show(struct device *dev, struct device_attribute *attr, char *buf) wakeup_active_show() argument 458 wakeup_total_time_show(struct device *dev, struct device_attribute *attr, char *buf) wakeup_total_time_show() argument 475 wakeup_max_time_show(struct device *dev, struct device_attribute *attr, char *buf) wakeup_max_time_show() argument 492 wakeup_last_time_show(struct device *dev, struct device_attribute *attr, char *buf) wakeup_last_time_show() argument 510 wakeup_prevent_sleep_time_show(struct device *dev, struct device_attribute *attr, char *buf) wakeup_prevent_sleep_time_show() argument 532 rtpm_usagecount_show(struct device *dev, struct device_attribute *attr, char *buf) rtpm_usagecount_show() argument 538 rtpm_children_show(struct device *dev, struct device_attribute *attr, char *buf) rtpm_children_show() argument 545 rtpm_enabled_show(struct device *dev, struct device_attribute *attr, char *buf) rtpm_enabled_show() argument 562 async_show(struct device *dev, struct device_attribute *attr, char *buf) async_show() argument 570 async_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t n) async_store() argument
|
/linux-4.4.14/drivers/usb/gadget/function/ |
H A D | uvc_queue.c | 65 struct uvc_buffer *buf = container_of(vbuf, struct uvc_buffer, buf); uvc_buffer_prepare() local 76 buf->state = UVC_BUF_STATE_QUEUED; uvc_buffer_prepare() 77 buf->mem = vb2_plane_vaddr(vb, 0); uvc_buffer_prepare() 78 buf->length = vb2_plane_size(vb, 0); uvc_buffer_prepare() 80 buf->bytesused = 0; uvc_buffer_prepare() 82 buf->bytesused = vb2_get_plane_payload(vb, 0); uvc_buffer_prepare() 91 struct uvc_buffer *buf = container_of(vbuf, struct uvc_buffer, buf); uvc_buffer_queue() local 97 list_add_tail(&buf->queue, &queue->irqqueue); uvc_buffer_queue() 102 buf->state = UVC_BUF_STATE_ERROR; uvc_buffer_queue() 163 int uvcg_query_buffer(struct uvc_video_queue *queue, struct v4l2_buffer *buf) uvcg_query_buffer() argument 165 return vb2_querybuf(&queue->queue, buf); uvcg_query_buffer() 168 int uvcg_queue_buffer(struct uvc_video_queue *queue, struct v4l2_buffer *buf) uvcg_queue_buffer() argument 173 ret = vb2_qbuf(&queue->queue, buf); uvcg_queue_buffer() 188 int uvcg_dequeue_buffer(struct uvc_video_queue *queue, struct v4l2_buffer *buf, uvcg_dequeue_buffer() argument 191 return vb2_dqbuf(&queue->queue, buf, nonblocking); uvcg_dequeue_buffer() 238 struct uvc_buffer *buf; uvcg_queue_cancel() local 243 buf = list_first_entry(&queue->irqqueue, struct uvc_buffer, uvcg_queue_cancel() 245 list_del(&buf->queue); uvcg_queue_cancel() 246 buf->state = UVC_BUF_STATE_ERROR; uvcg_queue_cancel() 247 vb2_buffer_done(&buf->buf.vb2_buf, VB2_BUF_STATE_ERROR); uvcg_queue_cancel() 312 struct uvc_buffer *buf) uvcg_queue_next_buffer() 317 buf->length != buf->bytesused) { uvcg_queue_next_buffer() 318 buf->state = UVC_BUF_STATE_QUEUED; uvcg_queue_next_buffer() 319 vb2_set_plane_payload(&buf->buf.vb2_buf, 0, 0); uvcg_queue_next_buffer() 320 return buf; uvcg_queue_next_buffer() 323 list_del(&buf->queue); uvcg_queue_next_buffer() 330 buf->buf.field = V4L2_FIELD_NONE; uvcg_queue_next_buffer() 331 buf->buf.sequence = queue->sequence++; uvcg_queue_next_buffer() 332 v4l2_get_timestamp(&buf->buf.timestamp); uvcg_queue_next_buffer() 334 vb2_set_plane_payload(&buf->buf.vb2_buf, 0, buf->bytesused); uvcg_queue_next_buffer() 335 vb2_buffer_done(&buf->buf.vb2_buf, VB2_BUF_STATE_DONE); uvcg_queue_next_buffer() 342 struct uvc_buffer *buf = NULL; uvcg_queue_head() local 345 buf = list_first_entry(&queue->irqqueue, struct uvc_buffer, uvcg_queue_head() 350 return buf; uvcg_queue_head() 311 uvcg_queue_next_buffer(struct uvc_video_queue *queue, struct uvc_buffer *buf) uvcg_queue_next_buffer() argument
|
/linux-4.4.14/drivers/net/wireless/b43legacy/ |
H A D | sysfs.c | 38 static int get_integer(const char *buf, size_t count) get_integer() argument 46 memcpy(tmp, buf, count); get_integer() 52 static int get_boolean(const char *buf, size_t count) get_boolean() argument 55 if (buf[0] == '1') get_boolean() 57 if (buf[0] == '0') get_boolean() 59 if (count >= 4 && memcmp(buf, "true", 4) == 0) get_boolean() 61 if (count >= 5 && memcmp(buf, "false", 5) == 0) get_boolean() 63 if (count >= 3 && memcmp(buf, "yes", 3) == 0) get_boolean() 65 if (count >= 2 && memcmp(buf, "no", 2) == 0) get_boolean() 67 if (count >= 2 && memcmp(buf, "on", 2) == 0) get_boolean() 69 if (count >= 3 && memcmp(buf, "off", 3) == 0) get_boolean() 77 char *buf) b43legacy_attr_interfmode_show() 89 count = snprintf(buf, PAGE_SIZE, "0 (No Interference" b43legacy_attr_interfmode_show() 93 count = snprintf(buf, PAGE_SIZE, "1 (Non-WLAN Interference" b43legacy_attr_interfmode_show() 97 count = snprintf(buf, PAGE_SIZE, "2 (WLAN Interference" b43legacy_attr_interfmode_show() 111 const char *buf, size_t count) b43legacy_attr_interfmode_store() 121 mode = get_integer(buf, count); b43legacy_attr_interfmode_store() 159 char *buf) b43legacy_attr_preamble_show() 170 count = snprintf(buf, PAGE_SIZE, "1 (Short Preamble" b43legacy_attr_preamble_show() 173 count = snprintf(buf, PAGE_SIZE, "0 (Short Preamble" b43legacy_attr_preamble_show() 183 const char *buf, size_t count) b43legacy_attr_preamble_store() 192 value = get_boolean(buf, count); b43legacy_attr_preamble_store() 75 b43legacy_attr_interfmode_show(struct device *dev, struct device_attribute *attr, char *buf) b43legacy_attr_interfmode_show() argument 109 b43legacy_attr_interfmode_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) b43legacy_attr_interfmode_store() argument 157 b43legacy_attr_preamble_show(struct device *dev, struct device_attribute *attr, char *buf) b43legacy_attr_preamble_show() argument 181 b43legacy_attr_preamble_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) b43legacy_attr_preamble_store() argument
|
/linux-4.4.14/fs/xfs/ |
H A D | xfs_sysfs.c | 28 ssize_t (*show)(struct kobject *kobject, char *buf); 29 ssize_t (*store)(struct kobject *kobject, const char *buf, 62 char *buf) xfs_sysfs_object_show() 66 return xfs_attr->show ? xfs_attr->show(kobject, buf) : 0; xfs_sysfs_object_show() 73 const char *buf, xfs_sysfs_object_store() 78 return xfs_attr->store ? xfs_attr->store(kobject, buf, count) : 0; xfs_sysfs_object_store() 92 const char *buf, log_recovery_delay_store() 98 ret = kstrtoint(buf, 0, &val); log_recovery_delay_store() 113 char *buf) log_recovery_delay_show() 115 return snprintf(buf, PAGE_SIZE, "%d\n", xfs_globals.log_recovery_delay); log_recovery_delay_show() 145 char *buf) stats_show() 149 return xfs_stats_format(stats->xs_stats, buf); stats_show() 156 const char *buf, stats_clear_store() 163 ret = kstrtoint(buf, 0, &val); stats_clear_store() 200 char *buf) log_head_lsn_show() 211 return snprintf(buf, PAGE_SIZE, "%d:%d\n", cycle, block); log_head_lsn_show() 218 char *buf) log_tail_lsn_show() 225 return snprintf(buf, PAGE_SIZE, "%d:%d\n", cycle, block); log_tail_lsn_show() 232 char *buf) reserve_grant_head_show() 240 return snprintf(buf, PAGE_SIZE, "%d:%d\n", cycle, bytes); reserve_grant_head_show() 247 char *buf) write_grant_head_show() 254 return snprintf(buf, PAGE_SIZE, "%d:%d\n", cycle, bytes); write_grant_head_show() 59 xfs_sysfs_object_show( struct kobject *kobject, struct attribute *attr, char *buf) xfs_sysfs_object_show() argument 70 xfs_sysfs_object_store( struct kobject *kobject, struct attribute *attr, const char *buf, size_t count) xfs_sysfs_object_store() argument 90 log_recovery_delay_store( struct kobject *kobject, const char *buf, size_t count) log_recovery_delay_store() argument 111 log_recovery_delay_show( struct kobject *kobject, char *buf) log_recovery_delay_show() argument 143 stats_show( struct kobject *kobject, char *buf) stats_show() argument 154 stats_clear_store( struct kobject *kobject, const char *buf, size_t count) stats_clear_store() argument 198 log_head_lsn_show( struct kobject *kobject, char *buf) log_head_lsn_show() argument 216 log_tail_lsn_show( struct kobject *kobject, char *buf) log_tail_lsn_show() argument 230 reserve_grant_head_show( struct kobject *kobject, char *buf) reserve_grant_head_show() argument 245 write_grant_head_show( struct kobject *kobject, char *buf) write_grant_head_show() argument
|
/linux-4.4.14/drivers/target/ |
H A D | target_core_spc.c | 41 static void spc_fill_alua_data(struct se_lun *lun, unsigned char *buf) spc_fill_alua_data() argument 48 buf[5] = 0x80; spc_fill_alua_data() 59 buf[5] |= tg_pt_gp->tg_pt_gp_alua_access_type; spc_fill_alua_data() 64 spc_emulate_inquiry_std(struct se_cmd *cmd, unsigned char *buf) spc_emulate_inquiry_std() argument 72 buf[1] = 0x80; spc_emulate_inquiry_std() 74 buf[2] = 0x05; /* SPC-3 */ spc_emulate_inquiry_std() 86 buf[3] = 2; spc_emulate_inquiry_std() 91 spc_fill_alua_data(lun, buf); spc_emulate_inquiry_std() 97 buf[5] |= 0x8; spc_emulate_inquiry_std() 106 buf[5] |= 0x1; spc_emulate_inquiry_std() 109 buf[7] = 0x2; /* CmdQue=1 */ spc_emulate_inquiry_std() 111 memcpy(&buf[8], "LIO-ORG ", 8); spc_emulate_inquiry_std() 112 memset(&buf[16], 0x20, 16); spc_emulate_inquiry_std() 113 memcpy(&buf[16], dev->t10_wwn.model, spc_emulate_inquiry_std() 115 memcpy(&buf[32], dev->t10_wwn.revision, spc_emulate_inquiry_std() 117 buf[4] = 31; /* Set additional length to 31 */ spc_emulate_inquiry_std() 125 spc_emulate_evpd_80(struct se_cmd *cmd, unsigned char *buf) spc_emulate_evpd_80() argument 131 len = sprintf(&buf[4], "%s", dev->t10_wwn.unit_serial); spc_emulate_evpd_80() 133 buf[3] = len; spc_emulate_evpd_80() 139 unsigned char *buf) spc_parse_naa_6h_vendor_specific() 161 buf[cnt++] |= val; spc_parse_naa_6h_vendor_specific() 164 buf[cnt] = val << 4; spc_parse_naa_6h_vendor_specific() 174 spc_emulate_evpd_83(struct se_cmd *cmd, unsigned char *buf) spc_emulate_evpd_83() argument 200 buf[off++] = 0x1; spc_emulate_evpd_83() 203 buf[off] = 0x00; spc_emulate_evpd_83() 206 buf[off++] |= 0x3; spc_emulate_evpd_83() 210 buf[off++] = 0x10; spc_emulate_evpd_83() 215 buf[off++] = (0x6 << 4); spc_emulate_evpd_83() 220 buf[off++] = 0x01; spc_emulate_evpd_83() 221 buf[off++] = 0x40; spc_emulate_evpd_83() 222 buf[off] = (0x5 << 4); spc_emulate_evpd_83() 229 spc_parse_naa_6h_vendor_specific(dev, &buf[off]); spc_emulate_evpd_83() 248 id_len += sprintf(&buf[off+12], "%s:%s", prod, spc_emulate_evpd_83() 251 buf[off] = 0x2; /* ASCII */ spc_emulate_evpd_83() 252 buf[off+1] = 0x1; /* T10 Vendor ID */ spc_emulate_evpd_83() 253 buf[off+2] = 0x0; spc_emulate_evpd_83() 254 memcpy(&buf[off+4], "LIO-ORG", 8); spc_emulate_evpd_83() 258 buf[off+3] = id_len; spc_emulate_evpd_83() 278 buf[off] = tpg->proto_id << 4; spc_emulate_evpd_83() 279 buf[off++] |= 0x1; /* CODE SET == Binary */ spc_emulate_evpd_83() 280 buf[off] = 0x80; /* Set PIV=1 */ spc_emulate_evpd_83() 282 buf[off] |= 0x10; spc_emulate_evpd_83() 284 buf[off++] |= 0x4; spc_emulate_evpd_83() 286 buf[off++] = 4; /* DESIGNATOR LENGTH */ spc_emulate_evpd_83() 290 buf[off++] = ((lun->lun_rtpi >> 8) & 0xff); spc_emulate_evpd_83() 291 buf[off++] = (lun->lun_rtpi & 0xff); spc_emulate_evpd_83() 309 buf[off] = tpg->proto_id << 4; spc_emulate_evpd_83() 310 buf[off++] |= 0x1; /* CODE SET == Binary */ spc_emulate_evpd_83() 311 buf[off] = 0x80; /* Set PIV=1 */ spc_emulate_evpd_83() 313 buf[off] |= 0x10; spc_emulate_evpd_83() 315 buf[off++] |= 0x5; spc_emulate_evpd_83() 317 buf[off++] = 4; /* DESIGNATOR LENGTH */ spc_emulate_evpd_83() 319 buf[off++] = ((tg_pt_gp_id >> 8) & 0xff); spc_emulate_evpd_83() 320 buf[off++] = (tg_pt_gp_id & 0xff); spc_emulate_evpd_83() 340 buf[off++] |= 0x1; /* CODE SET == Binary */ spc_emulate_evpd_83() 342 buf[off++] |= 0x6; spc_emulate_evpd_83() 344 buf[off++] = 4; /* DESIGNATOR LENGTH */ spc_emulate_evpd_83() 346 buf[off++] = ((lu_gp_id >> 8) & 0xff); spc_emulate_evpd_83() 347 buf[off++] = (lu_gp_id & 0xff); spc_emulate_evpd_83() 357 buf[off] = tpg->proto_id << 4; spc_emulate_evpd_83() 358 buf[off++] |= 0x3; /* CODE SET == UTF-8 */ spc_emulate_evpd_83() 359 buf[off] = 0x80; /* Set PIV=1 */ spc_emulate_evpd_83() 361 buf[off] |= 0x10; spc_emulate_evpd_83() 363 buf[off++] |= 0x8; spc_emulate_evpd_83() 372 scsi_name_len = sprintf(&buf[off], "%s,t,0x%04x", spc_emulate_evpd_83() 389 buf[off-1] = scsi_name_len; spc_emulate_evpd_83() 397 buf[off] = tpg->proto_id << 4; spc_emulate_evpd_83() 398 buf[off++] |= 0x3; /* CODE SET == UTF-8 */ spc_emulate_evpd_83() 399 buf[off] = 0x80; /* Set PIV=1 */ spc_emulate_evpd_83() 401 buf[off] |= 0x20; spc_emulate_evpd_83() 403 buf[off++] |= 0x8; spc_emulate_evpd_83() 411 scsi_target_len = sprintf(&buf[off], "%s", spc_emulate_evpd_83() 428 buf[off-1] = scsi_target_len; spc_emulate_evpd_83() 434 buf[2] = ((len >> 8) & 0xff); spc_emulate_evpd_83() 435 buf[3] = (len & 0xff); /* Page Length for VPD 0x83 */ spc_emulate_evpd_83() 442 spc_emulate_evpd_86(struct se_cmd *cmd, unsigned char *buf) spc_emulate_evpd_86() argument 447 buf[3] = 0x3c; spc_emulate_evpd_86() 455 buf[4] = 0x5; spc_emulate_evpd_86() 458 buf[4] = 0x4; spc_emulate_evpd_86() 465 buf[4] |= (0x3 << 3); spc_emulate_evpd_86() 469 buf[5] = 0x07; spc_emulate_evpd_86() 473 buf[6] = 0x01; spc_emulate_evpd_86() 477 buf[8] = 0x10; spc_emulate_evpd_86() 484 spc_emulate_evpd_b0(struct se_cmd *cmd, unsigned char *buf) spc_emulate_evpd_b0() argument 498 buf[0] = dev->transport->get_device_type(dev); spc_emulate_evpd_b0() 499 buf[3] = have_tp ? 0x3c : 0x10; spc_emulate_evpd_b0() 502 buf[4] = 0x01; spc_emulate_evpd_b0() 507 buf[5] = 0x01; spc_emulate_evpd_b0() 513 put_unaligned_be16(min / dev->dev_attrib.block_size, &buf[6]); spc_emulate_evpd_b0() 515 put_unaligned_be16(1, &buf[6]); spc_emulate_evpd_b0() 527 put_unaligned_be32(min_not_zero(mtl, dev->dev_attrib.hw_max_sectors), &buf[8]); spc_emulate_evpd_b0() 533 put_unaligned_be32(opt / dev->dev_attrib.block_size, &buf[12]); spc_emulate_evpd_b0() 535 put_unaligned_be32(dev->dev_attrib.optimal_sectors, &buf[12]); spc_emulate_evpd_b0() 546 put_unaligned_be32(dev->dev_attrib.max_unmap_lba_count, &buf[20]); spc_emulate_evpd_b0() 552 &buf[24]); spc_emulate_evpd_b0() 557 put_unaligned_be32(dev->dev_attrib.unmap_granularity, &buf[28]); spc_emulate_evpd_b0() 563 &buf[32]); spc_emulate_evpd_b0() 565 buf[32] |= 0x80; /* Set the UGAVALID bit */ spc_emulate_evpd_b0() 571 put_unaligned_be64(dev->dev_attrib.max_write_same_len, &buf[36]); spc_emulate_evpd_b0() 578 spc_emulate_evpd_b1(struct se_cmd *cmd, unsigned char *buf) spc_emulate_evpd_b1() argument 582 buf[0] = dev->transport->get_device_type(dev); spc_emulate_evpd_b1() 583 buf[3] = 0x3c; spc_emulate_evpd_b1() 584 buf[5] = dev->dev_attrib.is_nonrot ? 1 : 0; spc_emulate_evpd_b1() 591 spc_emulate_evpd_b2(struct se_cmd *cmd, unsigned char *buf) spc_emulate_evpd_b2() argument 603 buf[0] = dev->transport->get_device_type(dev); spc_emulate_evpd_b2() 608 put_unaligned_be16(0x0004, &buf[2]); spc_emulate_evpd_b2() 619 buf[4] = 0x00; spc_emulate_evpd_b2() 627 buf[5] = 0x80; spc_emulate_evpd_b2() 636 buf[5] |= 0x40 | 0x20; spc_emulate_evpd_b2() 643 spc_emulate_evpd_b3(struct se_cmd *cmd, unsigned char *buf) spc_emulate_evpd_b3() argument 647 buf[0] = dev->transport->get_device_type(dev); spc_emulate_evpd_b3() 648 buf[3] = 0x0c; spc_emulate_evpd_b3() 649 put_unaligned_be32(dev->t10_alua.lba_map_segment_size, &buf[8]); spc_emulate_evpd_b3() 650 put_unaligned_be32(dev->t10_alua.lba_map_segment_multiplier, &buf[12]); spc_emulate_evpd_b3() 656 spc_emulate_evpd_00(struct se_cmd *cmd, unsigned char *buf); 674 spc_emulate_evpd_00(struct se_cmd *cmd, unsigned char *buf) spc_emulate_evpd_00() argument 684 buf[3] = ARRAY_SIZE(evpd_handlers); spc_emulate_evpd_00() 686 buf[p + 4] = evpd_handlers[p].page; spc_emulate_evpd_00() 699 unsigned char *buf; spc_emulate_inquiry() local 704 buf = kzalloc(SE_INQUIRY_BUF, GFP_KERNEL); spc_emulate_inquiry() 705 if (!buf) { spc_emulate_inquiry() 711 buf[0] = 0x3f; /* Not connected */ spc_emulate_inquiry() 713 buf[0] = dev->transport->get_device_type(dev); spc_emulate_inquiry() 723 ret = spc_emulate_inquiry_std(cmd, buf); spc_emulate_inquiry() 724 len = buf[4] + 5; spc_emulate_inquiry() 730 buf[1] = cdb[2]; spc_emulate_inquiry() 731 ret = evpd_handlers[p].emulate(cmd, buf); spc_emulate_inquiry() 732 len = get_unaligned_be16(&buf[2]) + 4; spc_emulate_inquiry() 743 memcpy(rbuf, buf, min_t(u32, SE_INQUIRY_BUF, cmd->data_length)); spc_emulate_inquiry() 746 kfree(buf); spc_emulate_inquiry() 923 static void spc_modesense_write_protect(unsigned char *buf, int type) spc_modesense_write_protect() argument 933 buf[0] |= 0x80; /* WP bit */ spc_modesense_write_protect() 938 static void spc_modesense_dpofua(unsigned char *buf, int type) spc_modesense_dpofua() argument 942 buf[0] |= 0x10; /* DPOFUA bit */ spc_modesense_dpofua() 949 static int spc_modesense_blockdesc(unsigned char *buf, u64 blocks, u32 block_size) spc_modesense_blockdesc() argument 951 *buf++ = 8; spc_modesense_blockdesc() 952 put_unaligned_be32(min(blocks, 0xffffffffull), buf); spc_modesense_blockdesc() 953 buf += 4; spc_modesense_blockdesc() 954 put_unaligned_be32(block_size, buf); spc_modesense_blockdesc() 958 static int spc_modesense_long_blockdesc(unsigned char *buf, u64 blocks, u32 block_size) spc_modesense_long_blockdesc() argument 961 return spc_modesense_blockdesc(buf + 3, blocks, block_size) + 3; spc_modesense_long_blockdesc() 963 *buf++ = 1; /* LONGLBA */ spc_modesense_long_blockdesc() 964 buf += 2; spc_modesense_long_blockdesc() 965 *buf++ = 16; spc_modesense_long_blockdesc() 966 put_unaligned_be64(blocks, buf); spc_modesense_long_blockdesc() 967 buf += 12; spc_modesense_long_blockdesc() 968 put_unaligned_be32(block_size, buf); spc_modesense_long_blockdesc() 977 unsigned char buf[SE_MODE_PAGE_BUF], *rbuf; spc_emulate_modesense() local 990 memset(buf, 0, SE_MODE_PAGE_BUF); spc_emulate_modesense() 1000 spc_modesense_write_protect(&buf[length], type); spc_emulate_modesense() 1008 spc_modesense_dpofua(&buf[length], type); spc_emulate_modesense() 1024 length += spc_modesense_long_blockdesc(&buf[length], spc_emulate_modesense() 1028 length += spc_modesense_blockdesc(&buf[length], spc_emulate_modesense() 1032 length += spc_modesense_blockdesc(&buf[length], blocks, spc_emulate_modesense() 1056 ret = modesense_handlers[i].emulate(cmd, pc, &buf[length]); spc_emulate_modesense() 1069 length += modesense_handlers[i].emulate(cmd, pc, &buf[length]); spc_emulate_modesense() 1085 put_unaligned_be16(length - 2, buf); spc_emulate_modesense() 1087 buf[0] = length - 1; spc_emulate_modesense() 1091 memcpy(rbuf, buf, min_t(u32, SE_MODE_PAGE_BUF, cmd->data_length)); spc_emulate_modesense() 1106 unsigned char *buf; spc_emulate_modeselect() local 1120 buf = transport_kmap_data_sg(cmd); spc_emulate_modeselect() 1121 if (!buf) spc_emulate_modeselect() 1129 page = buf[off] & 0x3f; spc_emulate_modeselect() 1130 subpage = buf[off] & 0x40 ? buf[off + 1] : 0; spc_emulate_modeselect() 1149 if (memcmp(buf + off, tbuf, length)) spc_emulate_modeselect() 1165 unsigned char buf[SE_SENSE_BUF]; spc_emulate_request_sense() local 1168 memset(buf, 0, SE_SENSE_BUF); spc_emulate_request_sense() 1181 scsi_build_sense_buffer(desc_format, buf, UNIT_ATTENTION, spc_emulate_request_sense() 1184 scsi_build_sense_buffer(desc_format, buf, NO_SENSE, 0x0, 0x0); spc_emulate_request_sense() 1186 memcpy(rbuf, buf, min_t(u32, sizeof(buf), cmd->data_length)); spc_emulate_request_sense() 1199 unsigned char *buf; spc_emulate_report_luns() local 1203 buf = transport_kmap_data_sg(cmd); spc_emulate_report_luns() 1204 if (cmd->data_length && !buf) spc_emulate_report_luns() 1229 memcpy(buf + offset, &slun, spc_emulate_report_luns() 1245 memcpy(buf + offset, &slun, spc_emulate_report_luns() 1250 if (buf) { spc_emulate_report_luns() 1252 memcpy(buf, &len, min_t(int, sizeof len, cmd->data_length)); spc_emulate_report_luns() 138 spc_parse_naa_6h_vendor_specific(struct se_device *dev, unsigned char *buf) spc_parse_naa_6h_vendor_specific() argument
|
H A D | target_core_fabric_lib.c | 50 unsigned char *buf) sas_get_pr_transport_id() 55 ret = hex2bin(&buf[4], &nacl->initiatorname[4], 8); sas_get_pr_transport_id() 67 unsigned char *buf) fc_get_pr_transport_id() 83 ret = hex2bin(&buf[off++], &ptr[i], 1); fc_get_pr_transport_id() 99 unsigned char *buf) sbp_get_pr_transport_id() 103 ret = hex2bin(&buf[8], nacl->initiatorname, 8); sbp_get_pr_transport_id() 115 unsigned char *buf) srp_get_pr_transport_id() 130 memset(buf + 8, 0, leading_zero_bytes); srp_get_pr_transport_id() 131 rc = hex2bin(buf + 8 + leading_zero_bytes, p, count); srp_get_pr_transport_id() 144 unsigned char *buf) iscsi_get_pr_transport_id() 161 len = sprintf(&buf[off], "%s", se_nacl->initiatorname); iscsi_get_pr_transport_id() 179 buf[0] |= 0x40; iscsi_get_pr_transport_id() 194 buf[off+len] = 0x2c; off++; /* ASCII Character: "," */ iscsi_get_pr_transport_id() 195 buf[off+len] = 0x69; off++; /* ASCII Character: "i" */ iscsi_get_pr_transport_id() 196 buf[off+len] = 0x2c; off++; /* ASCII Character: "," */ iscsi_get_pr_transport_id() 197 buf[off+len] = 0x30; off++; /* ASCII Character: "0" */ iscsi_get_pr_transport_id() 198 buf[off+len] = 0x78; off++; /* ASCII Character: "x" */ iscsi_get_pr_transport_id() 200 buf[off+len] = pr_reg->pr_reg_isid[0]; off++; iscsi_get_pr_transport_id() 201 buf[off+len] = pr_reg->pr_reg_isid[1]; off++; iscsi_get_pr_transport_id() 202 buf[off+len] = pr_reg->pr_reg_isid[2]; off++; iscsi_get_pr_transport_id() 203 buf[off+len] = pr_reg->pr_reg_isid[3]; off++; iscsi_get_pr_transport_id() 204 buf[off+len] = pr_reg->pr_reg_isid[4]; off++; iscsi_get_pr_transport_id() 205 buf[off+len] = pr_reg->pr_reg_isid[5]; off++; iscsi_get_pr_transport_id() 206 buf[off+len] = '\0'; off++; iscsi_get_pr_transport_id() 219 buf[2] = ((len >> 8) & 0xff); iscsi_get_pr_transport_id() 220 buf[3] = (len & 0xff); iscsi_get_pr_transport_id() 276 const char *buf, iscsi_parse_pr_out_transport_id() 284 u8 format_code = (buf[0] & 0xc0); iscsi_parse_pr_out_transport_id() 309 add_len = (buf[2] << 8) | buf[3]; iscsi_parse_pr_out_transport_id() 311 tid_len = strlen(&buf[4]); iscsi_parse_pr_out_transport_id() 332 p = strstr(&buf[4], ",i,0x"); iscsi_parse_pr_out_transport_id() 336 &buf[4]); iscsi_parse_pr_out_transport_id() 359 return (char *)&buf[4]; iscsi_parse_pr_out_transport_id() 387 unsigned char *buf) target_get_pr_transport_id() 391 return sas_get_pr_transport_id(nacl, format_code, buf); target_get_pr_transport_id() 393 return sbp_get_pr_transport_id(nacl, format_code, buf); target_get_pr_transport_id() 395 return srp_get_pr_transport_id(nacl, format_code, buf); target_get_pr_transport_id() 397 return fc_get_pr_transport_id(nacl, format_code, buf); target_get_pr_transport_id() 400 buf); target_get_pr_transport_id() 408 const char *buf, u32 *out_tid_len, char **port_nexus_ptr) target_parse_pr_out_transport_id() 426 return iscsi_parse_pr_out_transport_id(tpg, buf, out_tid_len, target_parse_pr_out_transport_id() 435 return buf + offset; target_parse_pr_out_transport_id() 47 sas_get_pr_transport_id( struct se_node_acl *nacl, int *format_code, unsigned char *buf) sas_get_pr_transport_id() argument 64 fc_get_pr_transport_id( struct se_node_acl *se_nacl, int *format_code, unsigned char *buf) fc_get_pr_transport_id() argument 96 sbp_get_pr_transport_id( struct se_node_acl *nacl, int *format_code, unsigned char *buf) sbp_get_pr_transport_id() argument 112 srp_get_pr_transport_id( struct se_node_acl *nacl, int *format_code, unsigned char *buf) srp_get_pr_transport_id() argument 140 iscsi_get_pr_transport_id( struct se_node_acl *se_nacl, struct t10_pr_registration *pr_reg, int *format_code, unsigned char *buf) iscsi_get_pr_transport_id() argument 274 iscsi_parse_pr_out_transport_id( struct se_portal_group *se_tpg, const char *buf, u32 *out_tid_len, char **port_nexus_ptr) iscsi_parse_pr_out_transport_id() argument 385 target_get_pr_transport_id(struct se_node_acl *nacl, struct t10_pr_registration *pr_reg, int *format_code, unsigned char *buf) target_get_pr_transport_id() argument 407 target_parse_pr_out_transport_id(struct se_portal_group *tpg, const char *buf, u32 *out_tid_len, char **port_nexus_ptr) target_parse_pr_out_transport_id() argument
|
/linux-4.4.14/net/sunrpc/auth_gss/ |
H A D | gss_krb5_wrap.c | 49 gss_krb5_add_padding(struct xdr_buf *buf, int offset, int blocksize) gss_krb5_add_padding() argument 51 int padding = gss_krb5_padding(blocksize, buf->len - offset); gss_krb5_add_padding() 55 if (buf->page_len || buf->tail[0].iov_len) gss_krb5_add_padding() 56 iov = &buf->tail[0]; gss_krb5_add_padding() 58 iov = &buf->head[0]; gss_krb5_add_padding() 61 buf->len += padding; gss_krb5_add_padding() 66 gss_krb5_remove_padding(struct xdr_buf *buf, int blocksize) gss_krb5_remove_padding() argument 70 size_t len = buf->len; gss_krb5_remove_padding() 72 if (len <= buf->head[0].iov_len) { gss_krb5_remove_padding() 73 pad = *(u8 *)(buf->head[0].iov_base + len - 1); gss_krb5_remove_padding() 74 if (pad > buf->head[0].iov_len) gss_krb5_remove_padding() 76 buf->head[0].iov_len -= pad; gss_krb5_remove_padding() 79 len -= buf->head[0].iov_len; gss_krb5_remove_padding() 80 if (len <= buf->page_len) { gss_krb5_remove_padding() 81 unsigned int last = (buf->page_base + len - 1) gss_krb5_remove_padding() 83 unsigned int offset = (buf->page_base + len - 1) gss_krb5_remove_padding() 85 ptr = kmap_atomic(buf->pages[last]); gss_krb5_remove_padding() 90 len -= buf->page_len; gss_krb5_remove_padding() 91 BUG_ON(len > buf->tail[0].iov_len); gss_krb5_remove_padding() 92 pad = *(u8 *)(buf->tail[0].iov_base + len - 1); gss_krb5_remove_padding() 109 if (buf->len > pad) gss_krb5_remove_padding() 110 buf->len -= pad; gss_krb5_remove_padding() 159 struct xdr_buf *buf, struct page **pages) gss_wrap_kerberos_v1() 178 gss_krb5_add_padding(buf, offset, blocksize); gss_wrap_kerberos_v1() 179 BUG_ON((buf->len - offset) % blocksize); gss_wrap_kerberos_v1() 180 plainlen = conflen + buf->len - offset; gss_wrap_kerberos_v1() 184 (buf->len - offset); gss_wrap_kerberos_v1() 186 ptr = buf->head[0].iov_base + offset; gss_wrap_kerberos_v1() 188 xdr_extend_head(buf, offset, headlen); gss_wrap_kerberos_v1() 191 BUG_ON((buf->len - offset - headlen) % blocksize); gss_wrap_kerberos_v1() 222 tmp_pages = buf->pages; gss_wrap_kerberos_v1() 223 buf->pages = pages; gss_wrap_kerberos_v1() 224 if (make_checksum(kctx, ptr, 8, buf, offset + headlen - conflen, gss_wrap_kerberos_v1() 227 buf->pages = tmp_pages; gss_wrap_kerberos_v1() 251 err = gss_encrypt_xdr_buf(cipher, buf, gss_wrap_kerberos_v1() 257 if (gss_encrypt_xdr_buf(kctx->enc, buf, gss_wrap_kerberos_v1() 266 gss_unwrap_kerberos_v1(struct krb5_ctx *kctx, int offset, struct xdr_buf *buf) gss_unwrap_kerberos_v1() argument 287 ptr = (u8 *)buf->head[0].iov_base + offset; gss_unwrap_kerberos_v1() 289 buf->len - offset)) gss_unwrap_kerberos_v1() 316 (unsigned char *)buf->head[0].iov_base; gss_unwrap_kerberos_v1() 340 err = gss_decrypt_xdr_buf(cipher, buf, crypt_offset); gss_unwrap_kerberos_v1() 345 if (gss_decrypt_xdr_buf(kctx->enc, buf, crypt_offset)) gss_unwrap_kerberos_v1() 354 if (make_checksum(kctx, ptr, 8, buf, crypt_offset, gss_unwrap_kerberos_v1() 377 orig_start = buf->head[0].iov_base + offset; gss_unwrap_kerberos_v1() 378 data_len = (buf->head[0].iov_base + buf->head[0].iov_len) - data_start; gss_unwrap_kerberos_v1() 380 buf->head[0].iov_len -= (data_start - orig_start); gss_unwrap_kerberos_v1() 381 buf->len -= (data_start - orig_start); gss_unwrap_kerberos_v1() 383 if (gss_krb5_remove_padding(buf, blocksize)) gss_unwrap_kerberos_v1() 401 static void rotate_buf_a_little(struct xdr_buf *buf, unsigned int shift) rotate_buf_a_little() argument 409 read_bytes_from_xdr_buf(buf, 0, head, shift); rotate_buf_a_little() 410 for (i = 0; i + shift < buf->len; i += LOCAL_BUF_LEN) { rotate_buf_a_little() 411 this_len = min(LOCAL_BUF_LEN, buf->len - (i + shift)); rotate_buf_a_little() 412 read_bytes_from_xdr_buf(buf, i+shift, tmp, this_len); rotate_buf_a_little() 413 write_bytes_to_xdr_buf(buf, i, tmp, this_len); rotate_buf_a_little() 415 write_bytes_to_xdr_buf(buf, buf->len - shift, head, shift); rotate_buf_a_little() 418 static void _rotate_left(struct xdr_buf *buf, unsigned int shift) _rotate_left() argument 423 shift %= buf->len; _rotate_left() 426 rotate_buf_a_little(buf, this_shift); _rotate_left() 431 static void rotate_left(u32 base, struct xdr_buf *buf, unsigned int shift) rotate_left() argument 435 xdr_buf_subsegment(buf, &subbuf, base, buf->len - base); rotate_left() 441 struct xdr_buf *buf, struct page **pages) gss_wrap_kerberos_v2() 457 if (xdr_extend_head(buf, offset, GSS_KRB5_TOK_HDR_LEN)) gss_wrap_kerberos_v2() 461 ptr = plainhdr = buf->head[0].iov_base + offset; gss_wrap_kerberos_v2() 486 err = (*kctx->gk5e->encrypt_v2)(kctx, offset, buf, pages); gss_wrap_kerberos_v2() 495 gss_unwrap_kerberos_v2(struct krb5_ctx *kctx, int offset, struct xdr_buf *buf) gss_unwrap_kerberos_v2() argument 512 ptr = buf->head[0].iov_base + offset; gss_unwrap_kerberos_v2() 539 rotate_left(offset + 16, buf, rrc); gss_unwrap_kerberos_v2() 541 err = (*kctx->gk5e->decrypt_v2)(kctx, offset, buf, gss_unwrap_kerberos_v2() 550 err = read_bytes_from_xdr_buf(buf, gss_unwrap_kerberos_v2() 551 buf->len - GSS_KRB5_TOK_HDR_LEN - tailskip, gss_unwrap_kerberos_v2() 574 * Note that buf->head[0].iov_len may indicate the available gss_unwrap_kerberos_v2() 577 movelen = min_t(unsigned int, buf->head[0].iov_len, buf->len); gss_unwrap_kerberos_v2() 580 buf->head[0].iov_len); gss_unwrap_kerberos_v2() 582 buf->head[0].iov_len -= GSS_KRB5_TOK_HDR_LEN + headskip; gss_unwrap_kerberos_v2() 583 buf->len -= GSS_KRB5_TOK_HDR_LEN + headskip; gss_unwrap_kerberos_v2() 586 xdr_buf_trim(buf, ec + GSS_KRB5_TOK_HDR_LEN + tailskip); gss_unwrap_kerberos_v2() 592 struct xdr_buf *buf, struct page **pages) gss_wrap_kerberos() 602 return gss_wrap_kerberos_v1(kctx, offset, buf, pages); gss_wrap_kerberos() 605 return gss_wrap_kerberos_v2(kctx, offset, buf, pages); gss_wrap_kerberos() 610 gss_unwrap_kerberos(struct gss_ctx *gctx, int offset, struct xdr_buf *buf) gss_unwrap_kerberos() argument 620 return gss_unwrap_kerberos_v1(kctx, offset, buf); gss_unwrap_kerberos() 623 return gss_unwrap_kerberos_v2(kctx, offset, buf); gss_unwrap_kerberos() 158 gss_wrap_kerberos_v1(struct krb5_ctx *kctx, int offset, struct xdr_buf *buf, struct page **pages) gss_wrap_kerberos_v1() argument 440 gss_wrap_kerberos_v2(struct krb5_ctx *kctx, u32 offset, struct xdr_buf *buf, struct page **pages) gss_wrap_kerberos_v2() argument 591 gss_wrap_kerberos(struct gss_ctx *gctx, int offset, struct xdr_buf *buf, struct page **pages) gss_wrap_kerberos() argument
|
/linux-4.4.14/drivers/scsi/qla2xxx/ |
H A D | qla_tmpl.c | 109 qla27xx_insert16(uint16_t value, void *buf, ulong *len) qla27xx_insert16() argument 111 if (buf) { qla27xx_insert16() 112 buf += *len; qla27xx_insert16() 113 *(__le16 *)buf = cpu_to_le16(value); qla27xx_insert16() 119 qla27xx_insert32(uint32_t value, void *buf, ulong *len) qla27xx_insert32() argument 121 if (buf) { qla27xx_insert32() 122 buf += *len; qla27xx_insert32() 123 *(__le32 *)buf = cpu_to_le32(value); qla27xx_insert32() 129 qla27xx_insertbuf(void *mem, ulong size, void *buf, ulong *len) qla27xx_insertbuf() argument 132 if (buf && mem && size) { qla27xx_insertbuf() 133 buf += *len; qla27xx_insertbuf() 134 memcpy(buf, mem, size); qla27xx_insertbuf() 140 qla27xx_read8(void __iomem *window, void *buf, ulong *len) qla27xx_read8() argument 144 if (buf) { qla27xx_read8() 147 qla27xx_insert32(value, buf, len); qla27xx_read8() 151 qla27xx_read16(void __iomem *window, void *buf, ulong *len) qla27xx_read16() argument 155 if (buf) { qla27xx_read16() 158 qla27xx_insert32(value, buf, len); qla27xx_read16() 162 qla27xx_read32(void __iomem *window, void *buf, ulong *len) qla27xx_read32() argument 166 if (buf) { qla27xx_read32() 169 qla27xx_insert32(value, buf, len); qla27xx_read32() 182 uint offset, void *buf, ulong *len) qla27xx_read_reg() 186 qla27xx_read32(window, buf, len); qla27xx_read_reg() 191 uint offset, uint32_t data, void *buf) qla27xx_write_reg() 195 if (buf) { qla27xx_write_reg() 202 uint32_t addr, uint offset, uint count, uint width, void *buf, qla27xx_read_window() 208 qla27xx_write_reg(reg, IOBASE_ADDR, addr, buf); qla27xx_read_window() 210 qla27xx_insert32(addr, buf, len); qla27xx_read_window() 211 readn(window, buf, len); qla27xx_read_window() 218 qla27xx_skip_entry(struct qla27xx_fwdt_entry *ent, void *buf) qla27xx_skip_entry() argument 220 if (buf) qla27xx_skip_entry() 228 struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) qla27xx_fwdt_entry_t0() 232 qla27xx_skip_entry(ent, buf); qla27xx_fwdt_entry_t0() 239 struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) qla27xx_fwdt_entry_t255() 243 qla27xx_skip_entry(ent, buf); qla27xx_fwdt_entry_t255() 251 struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) qla27xx_fwdt_entry_t256() 258 ent->t256.reg_count, ent->t256.reg_width, buf, len); qla27xx_fwdt_entry_t256() 265 struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) qla27xx_fwdt_entry_t257() 271 qla27xx_write_reg(reg, IOBASE_ADDR, ent->t257.base_addr, buf); qla27xx_fwdt_entry_t257() 272 qla27xx_write_reg(reg, ent->t257.pci_offset, ent->t257.write_data, buf); qla27xx_fwdt_entry_t257() 279 struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) qla27xx_fwdt_entry_t258() 285 qla27xx_write_reg(reg, ent->t258.banksel_offset, ent->t258.bank, buf); qla27xx_fwdt_entry_t258() 287 ent->t258.reg_count, ent->t258.reg_width, buf, len); qla27xx_fwdt_entry_t258() 294 struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) qla27xx_fwdt_entry_t259() 300 qla27xx_write_reg(reg, IOBASE_ADDR, ent->t259.base_addr, buf); qla27xx_fwdt_entry_t259() 301 qla27xx_write_reg(reg, ent->t259.banksel_offset, ent->t259.bank, buf); qla27xx_fwdt_entry_t259() 302 qla27xx_write_reg(reg, ent->t259.pci_offset, ent->t259.write_data, buf); qla27xx_fwdt_entry_t259() 309 struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) qla27xx_fwdt_entry_t260() 315 qla27xx_insert32(ent->t260.pci_offset, buf, len); qla27xx_fwdt_entry_t260() 316 qla27xx_read_reg(reg, ent->t260.pci_offset, buf, len); qla27xx_fwdt_entry_t260() 323 struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) qla27xx_fwdt_entry_t261() 329 qla27xx_write_reg(reg, ent->t261.pci_offset, ent->t261.write_data, buf); qla27xx_fwdt_entry_t261() 336 struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) qla27xx_fwdt_entry_t262() 351 if (buf) qla27xx_fwdt_entry_t262() 356 if (buf) { qla27xx_fwdt_entry_t262() 363 qla27xx_skip_entry(ent, buf); qla27xx_fwdt_entry_t262() 371 qla27xx_skip_entry(ent, buf); qla27xx_fwdt_entry_t262() 376 if (buf) { qla27xx_fwdt_entry_t262() 377 buf += *len; qla27xx_fwdt_entry_t262() 378 qla24xx_dump_ram(vha->hw, start, buf, dwords, &buf); qla27xx_fwdt_entry_t262() 387 struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) qla27xx_fwdt_entry_t263() 402 if (req || !buf) { qla27xx_fwdt_entry_t263() 405 qla27xx_insert16(i, buf, len); qla27xx_fwdt_entry_t263() 406 qla27xx_insert16(length, buf, len); qla27xx_fwdt_entry_t263() 408 length * sizeof(*req->ring), buf, len); qla27xx_fwdt_entry_t263() 419 if (rsp || !buf) { qla27xx_fwdt_entry_t263() 422 qla27xx_insert16(i, buf, len); qla27xx_fwdt_entry_t263() 423 qla27xx_insert16(length, buf, len); qla27xx_fwdt_entry_t263() 425 length * sizeof(*rsp->ring), buf, len); qla27xx_fwdt_entry_t263() 432 qla27xx_skip_entry(ent, buf); qla27xx_fwdt_entry_t263() 435 if (buf) qla27xx_fwdt_entry_t263() 443 struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) qla27xx_fwdt_entry_t264() 448 if (buf) { qla27xx_fwdt_entry_t264() 459 qla27xx_insertbuf(vha->hw->fce, FCE_SIZE, buf, len); qla27xx_fwdt_entry_t264() 463 qla27xx_skip_entry(ent, buf); qla27xx_fwdt_entry_t264() 471 struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) qla27xx_fwdt_entry_t265() 477 if (buf) qla27xx_fwdt_entry_t265() 485 struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) qla27xx_fwdt_entry_t266() 489 if (buf) qla27xx_fwdt_entry_t266() 497 struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) qla27xx_fwdt_entry_t267() 503 qla27xx_write_reg(reg, ent->t267.pci_offset, ent->t267.data, buf); qla27xx_fwdt_entry_t267() 510 struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) qla27xx_fwdt_entry_t268() 516 if (buf) { qla27xx_fwdt_entry_t268() 520 qla27xx_insertbuf(vha->hw->eft, EFT_SIZE, buf, len); qla27xx_fwdt_entry_t268() 524 qla27xx_skip_entry(ent, buf); qla27xx_fwdt_entry_t268() 529 qla27xx_skip_entry(ent, buf); qla27xx_fwdt_entry_t268() 537 struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) qla27xx_fwdt_entry_t269() 541 qla27xx_insert32(0xaaaaaaaa, buf, len); qla27xx_fwdt_entry_t269() 542 qla27xx_insert32(0xbbbbbbbb, buf, len); qla27xx_fwdt_entry_t269() 543 qla27xx_insert32(0xcccccccc, buf, len); qla27xx_fwdt_entry_t269() 544 qla27xx_insert32(0xdddddddd, buf, len); qla27xx_fwdt_entry_t269() 545 qla27xx_insert32(*len + sizeof(uint32_t), buf, len); qla27xx_fwdt_entry_t269() 546 if (buf) qla27xx_fwdt_entry_t269() 554 struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) qla27xx_fwdt_entry_t270() 562 qla27xx_write_reg(reg, IOBASE_ADDR, 0x40, buf); qla27xx_fwdt_entry_t270() 564 qla27xx_write_reg(reg, 0xc0, addr|0x80000000, buf); qla27xx_fwdt_entry_t270() 565 qla27xx_insert32(addr, buf, len); qla27xx_fwdt_entry_t270() 566 qla27xx_read_reg(reg, 0xc4, buf, len); qla27xx_fwdt_entry_t270() 575 struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) qla27xx_fwdt_entry_t271() 583 qla27xx_write_reg(reg, IOBASE_ADDR, 0x40, buf); qla27xx_fwdt_entry_t271() 584 qla27xx_write_reg(reg, 0xc4, data, buf); qla27xx_fwdt_entry_t271() 585 qla27xx_write_reg(reg, 0xc0, addr, buf); qla27xx_fwdt_entry_t271() 592 struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) qla27xx_fwdt_entry_t272() 599 if (buf) { qla27xx_fwdt_entry_t272() 602 buf += *len; qla27xx_fwdt_entry_t272() 603 qla27xx_dump_mpi_ram(vha->hw, start, buf, dwords, &buf); qla27xx_fwdt_entry_t272() 612 struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) qla27xx_fwdt_entry_t273() 625 qla27xx_insert32(addr, buf, len); qla27xx_fwdt_entry_t273() 626 qla27xx_insert32(value, buf, len); qla27xx_fwdt_entry_t273() 635 struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) qla27xx_fwdt_entry_t274() 649 if (req || !buf) { qla27xx_fwdt_entry_t274() 650 qla27xx_insert16(i, buf, len); qla27xx_fwdt_entry_t274() 651 qla27xx_insert16(1, buf, len); qla27xx_fwdt_entry_t274() 653 *req->out_ptr : 0, buf, len); qla27xx_fwdt_entry_t274() 664 if (rsp || !buf) { qla27xx_fwdt_entry_t274() 665 qla27xx_insert16(i, buf, len); qla27xx_fwdt_entry_t274() 666 qla27xx_insert16(1, buf, len); qla27xx_fwdt_entry_t274() 668 *rsp->in_ptr : 0, buf, len); qla27xx_fwdt_entry_t274() 675 qla27xx_skip_entry(ent, buf); qla27xx_fwdt_entry_t274() 678 if (buf) qla27xx_fwdt_entry_t274() 682 qla27xx_skip_entry(ent, buf); qla27xx_fwdt_entry_t274() 689 struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) qla27xx_fwdt_entry_t275() 698 qla27xx_skip_entry(ent, buf); qla27xx_fwdt_entry_t275() 704 qla27xx_skip_entry(ent, buf); qla27xx_fwdt_entry_t275() 708 qla27xx_insertbuf(ent->t275.buffer, ent->t275.length, buf, len); qla27xx_fwdt_entry_t275() 715 struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) qla27xx_fwdt_entry_other() 719 qla27xx_skip_entry(ent, buf); qla27xx_fwdt_entry_other() 782 struct qla27xx_fwdt_template *tmp, void *buf, ulong *len) qla27xx_walk_template() 790 if (qla27xx_find_entry(ent->hdr.entry_type)(vha, ent, buf, len)) qla27xx_walk_template() 806 if (buf) { qla27xx_walk_template() 858 uint32_t *buf = p; qla27xx_template_checksum() local 861 size /= sizeof(*buf); qla27xx_template_checksum() 864 sum += *buf++; qla27xx_template_checksum() 181 qla27xx_read_reg(__iomem struct device_reg_24xx *reg, uint offset, void *buf, ulong *len) qla27xx_read_reg() argument 190 qla27xx_write_reg(__iomem struct device_reg_24xx *reg, uint offset, uint32_t data, void *buf) qla27xx_write_reg() argument 201 qla27xx_read_window(__iomem struct device_reg_24xx *reg, uint32_t addr, uint offset, uint count, uint width, void *buf, ulong *len) qla27xx_read_window() argument 227 qla27xx_fwdt_entry_t0(struct scsi_qla_host *vha, struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) qla27xx_fwdt_entry_t0() argument 238 qla27xx_fwdt_entry_t255(struct scsi_qla_host *vha, struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) qla27xx_fwdt_entry_t255() argument 250 qla27xx_fwdt_entry_t256(struct scsi_qla_host *vha, struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) qla27xx_fwdt_entry_t256() argument 264 qla27xx_fwdt_entry_t257(struct scsi_qla_host *vha, struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) qla27xx_fwdt_entry_t257() argument 278 qla27xx_fwdt_entry_t258(struct scsi_qla_host *vha, struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) qla27xx_fwdt_entry_t258() argument 293 qla27xx_fwdt_entry_t259(struct scsi_qla_host *vha, struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) qla27xx_fwdt_entry_t259() argument 308 qla27xx_fwdt_entry_t260(struct scsi_qla_host *vha, struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) qla27xx_fwdt_entry_t260() argument 322 qla27xx_fwdt_entry_t261(struct scsi_qla_host *vha, struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) qla27xx_fwdt_entry_t261() argument 335 qla27xx_fwdt_entry_t262(struct scsi_qla_host *vha, struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) qla27xx_fwdt_entry_t262() argument 386 qla27xx_fwdt_entry_t263(struct scsi_qla_host *vha, struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) qla27xx_fwdt_entry_t263() argument 442 qla27xx_fwdt_entry_t264(struct scsi_qla_host *vha, struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) qla27xx_fwdt_entry_t264() argument 470 qla27xx_fwdt_entry_t265(struct scsi_qla_host *vha, struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) qla27xx_fwdt_entry_t265() argument 484 qla27xx_fwdt_entry_t266(struct scsi_qla_host *vha, struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) qla27xx_fwdt_entry_t266() argument 496 qla27xx_fwdt_entry_t267(struct scsi_qla_host *vha, struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) qla27xx_fwdt_entry_t267() argument 509 qla27xx_fwdt_entry_t268(struct scsi_qla_host *vha, struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) qla27xx_fwdt_entry_t268() argument 536 qla27xx_fwdt_entry_t269(struct scsi_qla_host *vha, struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) qla27xx_fwdt_entry_t269() argument 553 qla27xx_fwdt_entry_t270(struct scsi_qla_host *vha, struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) qla27xx_fwdt_entry_t270() argument 574 qla27xx_fwdt_entry_t271(struct scsi_qla_host *vha, struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) qla27xx_fwdt_entry_t271() argument 591 qla27xx_fwdt_entry_t272(struct scsi_qla_host *vha, struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) qla27xx_fwdt_entry_t272() argument 611 qla27xx_fwdt_entry_t273(struct scsi_qla_host *vha, struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) qla27xx_fwdt_entry_t273() argument 634 qla27xx_fwdt_entry_t274(struct scsi_qla_host *vha, struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) qla27xx_fwdt_entry_t274() argument 688 qla27xx_fwdt_entry_t275(struct scsi_qla_host *vha, struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) qla27xx_fwdt_entry_t275() argument 714 qla27xx_fwdt_entry_other(struct scsi_qla_host *vha, struct qla27xx_fwdt_entry *ent, void *buf, ulong *len) qla27xx_fwdt_entry_other() argument 781 qla27xx_walk_template(struct scsi_qla_host *vha, struct qla27xx_fwdt_template *tmp, void *buf, ulong *len) qla27xx_walk_template() argument
|
/linux-4.4.14/sound/arm/ |
H A D | pxa2xx-pcm-lib.c | 154 struct snd_dma_buffer *buf = &substream->dma_buffer; pxa2xx_pcm_preallocate_dma_buffer() local 156 buf->dev.type = SNDRV_DMA_TYPE_DEV; pxa2xx_pcm_preallocate_dma_buffer() 157 buf->dev.dev = pcm->card->dev; pxa2xx_pcm_preallocate_dma_buffer() 158 buf->private_data = NULL; pxa2xx_pcm_preallocate_dma_buffer() 159 buf->area = dma_alloc_writecombine(pcm->card->dev, size, pxa2xx_pcm_preallocate_dma_buffer() 160 &buf->addr, GFP_KERNEL); pxa2xx_pcm_preallocate_dma_buffer() 161 if (!buf->area) pxa2xx_pcm_preallocate_dma_buffer() 163 buf->bytes = size; pxa2xx_pcm_preallocate_dma_buffer() 171 struct snd_dma_buffer *buf; pxa2xx_pcm_free_dma_buffers() local 178 buf = &substream->dma_buffer; pxa2xx_pcm_free_dma_buffers() 179 if (!buf->area) pxa2xx_pcm_free_dma_buffers() 181 dma_free_writecombine(pcm->card->dev, buf->bytes, pxa2xx_pcm_free_dma_buffers() 182 buf->area, buf->addr); pxa2xx_pcm_free_dma_buffers() 183 buf->area = NULL; pxa2xx_pcm_free_dma_buffers()
|
/linux-4.4.14/arch/sparc/kernel/ |
H A D | led.c | 67 char *buf = NULL; led_proc_write() local 72 buf = kmalloc(sizeof(char) * (count + 1), GFP_KERNEL); led_proc_write() 73 if (!buf) led_proc_write() 76 if (copy_from_user(buf, buffer, count)) { led_proc_write() 77 kfree(buf); led_proc_write() 81 buf[count] = '\0'; led_proc_write() 84 if (buf[count - 1] == '\n') led_proc_write() 85 buf[count - 1] = '\0'; led_proc_write() 92 if (!strcmp(buf, "on")) { led_proc_write() 94 } else if (!strcmp(buf, "toggle")) { led_proc_write() 96 } else if ((*buf > '0') && (*buf <= '9')) { led_proc_write() 97 led_blink(simple_strtoul(buf, NULL, 10)); led_proc_write() 98 } else if (!strcmp(buf, "load")) { led_proc_write() 104 kfree(buf); led_proc_write()
|
/linux-4.4.14/net/irda/ |
H A D | parameters.c | 38 static int irda_extract_integer(void *self, __u8 *buf, int len, __u8 pi, 40 static int irda_extract_string(void *self, __u8 *buf, int len, __u8 pi, 42 static int irda_extract_octseq(void *self, __u8 *buf, int len, __u8 pi, 44 static int irda_extract_no_value(void *self, __u8 *buf, int len, __u8 pi, 47 static int irda_insert_integer(void *self, __u8 *buf, int len, __u8 pi, 49 static int irda_insert_no_value(void *self, __u8 *buf, int len, __u8 pi, 52 static int irda_param_unpack(__u8 *buf, char *fmt, ...); 76 * Function irda_insert_no_value (self, buf, len, pi, type, func) 78 static int irda_insert_no_value(void *self, __u8 *buf, int len, __u8 pi, irda_insert_no_value() argument 91 irda_param_pack(buf, "bb", p.pi, p.pl); irda_insert_no_value() 100 * Function irda_extract_no_value (self, buf, len, type, func) 105 static int irda_extract_no_value(void *self, __u8 *buf, int len, __u8 pi, irda_extract_no_value() argument 112 irda_param_unpack(buf, "bb", &p.pi, &p.pl); irda_extract_no_value() 124 * Function irda_insert_integer (self, buf, len, pi, type, func) 126 static int irda_insert_integer(void *self, __u8 *buf, int len, __u8 pi, irda_insert_integer() argument 169 n += irda_param_pack(buf, "bbb", p.pi, p.pl, (__u8) p.pv.i); irda_insert_integer() 176 n += irda_param_pack(buf, "bbs", p.pi, p.pl, (__u16) p.pv.i); irda_insert_integer() 183 n += irda_param_pack(buf, "bbi", p.pi, p.pl, p.pv.i); irda_insert_integer() 197 * Function irda_extract integer (self, buf, len, pi, type, func) 202 static int irda_extract_integer(void *self, __u8 *buf, int len, __u8 pi, irda_extract_integer() argument 211 p.pl = buf[1]; /* Extract length of value */ irda_extract_integer() 249 n += irda_param_unpack(buf+2, "b", &p.pv.i); irda_extract_integer() 252 n += irda_param_unpack(buf+2, "s", &p.pv.i); irda_extract_integer() 259 n += irda_param_unpack(buf+2, "i", &p.pv.i); irda_extract_integer() 284 * Function irda_extract_string (self, buf, len, type, func) 286 static int irda_extract_string(void *self, __u8 *buf, int len, __u8 pi, irda_extract_string() argument 294 p.pl = buf[1]; /* Extract length of value */ irda_extract_string() 310 strncpy(str, buf+2, p.pl); irda_extract_string() 329 * Function irda_extract_octseq (self, buf, len, type, func) 331 static int irda_extract_octseq(void *self, __u8 *buf, int len, __u8 pi, irda_extract_octseq() argument 337 p.pl = buf[1]; /* Extract length of value */ irda_extract_octseq() 359 int irda_param_pack(__u8 *buf, char *fmt, ...) irda_param_pack() argument 371 buf[n++] = (__u8)va_arg(args, int); irda_param_pack() 375 put_unaligned((__u16)arg.i, (__u16 *)(buf+n)); n+=2; irda_param_pack() 379 put_unaligned(arg.i, (__u32 *)(buf+n)); n+=4; irda_param_pack() 384 strcpy(buf+n, arg.c); irda_param_pack() 402 static int irda_param_unpack(__u8 *buf, char *fmt, ...) irda_param_unpack() argument 415 *arg.ip = buf[n++]; irda_param_unpack() 419 *arg.ip = get_unaligned((__u16 *)(buf+n)); n+=2; irda_param_unpack() 423 *arg.ip = get_unaligned((__u32 *)(buf+n)); n+=4; irda_param_unpack() 428 strcpy(arg.c, buf+n); irda_param_unpack() 444 * Function irda_param_insert (self, pi, buf, len, info) 449 int irda_param_insert(void *self, __u8 pi, __u8 *buf, int len, irda_param_insert() argument 459 IRDA_ASSERT(buf != NULL, return ret;); irda_param_insert() 491 ret = (*pv_insert_table[type & PV_MASK])(self, buf+n, len, pi, type, irda_param_insert() 498 * Function irda_param_extract (self, buf, len, info) 504 static int irda_param_extract(void *self, __u8 *buf, int len, irda_param_extract() argument 514 IRDA_ASSERT(buf != NULL, return ret;); irda_param_extract() 517 pi_minor = buf[n] & info->pi_mask; irda_param_extract() 518 pi_major = buf[n] >> info->pi_major_offset; irda_param_extract() 525 __func__, buf[0]); irda_param_extract() 528 return 2 + buf[n + 1]; /* Continue */ irda_param_extract() 543 __func__, buf[n]); irda_param_extract() 545 return 2 + buf[n + 1]; /* Continue */ irda_param_extract() 549 ret = (*pv_extract_table[type & PV_MASK])(self, buf+n, len, buf[n], irda_param_extract() 555 * Function irda_param_extract_all (self, buf, len, info) 561 int irda_param_extract_all(void *self, __u8 *buf, int len, irda_param_extract_all() argument 567 IRDA_ASSERT(buf != NULL, return ret;); irda_param_extract_all() 575 ret = irda_param_extract(self, buf+n, len, info); irda_param_extract_all()
|
/linux-4.4.14/drivers/md/bcache/ |
H A D | sysfs.h | 16 char *buf) \ 20 const char *buf, size_t size) \ 27 ret = __ ## fn ## _show(kobj, attr, buf); \ 37 ret = __ ## fn ## _store(kobj, attr, buf, size); \ 53 return snprintf(buf, PAGE_SIZE, fmt "\n", __VA_ARGS__); \ 59 return snprint(buf, PAGE_SIZE, var); \ 65 ssize_t ret = bch_hprint(buf, val); \ 66 strcat(buf, "\n"); \ 78 return strtoul_safe(buf, var) ?: (ssize_t) size; \ 84 return strtoul_safe_clamp(buf, var, min, max) \ 107 return strtoi_h(buf, &var) ?: (ssize_t) size; \
|
/linux-4.4.14/sound/firewire/digi00x/ |
H A D | digi00x-transaction.c | 12 static int fill_midi_message(struct snd_rawmidi_substream *substream, u8 *buf) fill_midi_message() argument 16 buf[0] = 0x80; fill_midi_message() 17 bytes = snd_rawmidi_transmit_peek(substream, buf + 1, 2); fill_midi_message() 19 buf[3] = 0xc0 | bytes; fill_midi_message() 24 static void handle_midi_control(struct snd_dg00x *dg00x, __be32 *buf, handle_midi_control() argument 39 b = (u8 *)&buf[i]; handle_midi_control() 47 unsigned long long offset, __be32 *buf) handle_unknown_message() 52 dg00x->msg = be32_to_cpu(*buf); handle_unknown_message() 64 __be32 *buf = (__be32 *)data; handle_message() local 67 handle_unknown_message(dg00x, offset, buf); handle_message() 69 handle_midi_control(dg00x, buf, length); handle_message() 46 handle_unknown_message(struct snd_dg00x *dg00x, unsigned long long offset, __be32 *buf) handle_unknown_message() argument
|
/linux-4.4.14/drivers/staging/iio/addac/ |
H A D | adt7316.c | 221 char *buf) adt7316_show_enabled() 226 return sprintf(buf, "%d\n", !!(chip->config1 & ADT7316_EN)); adt7316_show_enabled() 252 const char *buf, adt7316_store_enabled() 259 if (buf[0] == '1') adt7316_store_enabled() 277 char *buf) adt7316_show_select_ex_temp() 285 return sprintf(buf, "%d\n", !!(chip->config1 & ADT7516_SEL_EX_TEMP)); adt7316_show_select_ex_temp() 290 const char *buf, adt7316_store_select_ex_temp() 302 if (buf[0] == '1') adt7316_store_select_ex_temp() 321 char *buf) adt7316_show_mode() 327 return sprintf(buf, "single_channel\n"); adt7316_show_mode() 329 return sprintf(buf, "round_robin\n"); adt7316_show_mode() 334 const char *buf, adt7316_store_mode() 343 if (!memcmp(buf, "single_channel", 14)) adt7316_store_mode() 362 char *buf) adt7316_show_all_modes() 364 return sprintf(buf, "single_channel\nround_robin\n"); adt7316_show_all_modes() 371 char *buf) adt7316_show_ad_channel() 381 return sprintf(buf, "0 - VDD\n"); adt7316_show_ad_channel() 383 return sprintf(buf, "1 - Internal Temperature\n"); adt7316_show_ad_channel() 387 return sprintf(buf, "2 - AIN1\n"); adt7316_show_ad_channel() 389 return sprintf(buf, "2 - External Temperature\n"); adt7316_show_ad_channel() 392 return sprintf(buf, "3 - AIN2\n"); adt7316_show_ad_channel() 394 return sprintf(buf, "N/A\n"); adt7316_show_ad_channel() 397 return sprintf(buf, "4 - AIN3\n"); adt7316_show_ad_channel() 399 return sprintf(buf, "N/A\n"); adt7316_show_ad_channel() 401 return sprintf(buf, "5 - AIN4\n"); adt7316_show_ad_channel() 403 return sprintf(buf, "N/A\n"); adt7316_show_ad_channel() 409 const char *buf, adt7316_store_ad_channel() 421 ret = kstrtou8(buf, 10, &data); adt7316_store_ad_channel() 456 char *buf) adt7316_show_all_ad_channels() 465 return sprintf(buf, "0 - VDD\n1 - Internal Temperature\n" adt7316_show_all_ad_channels() 469 return sprintf(buf, "0 - VDD\n1 - Internal Temperature\n" adt7316_show_all_ad_channels() 478 char *buf) adt7316_show_disable_averaging() 483 return sprintf(buf, "%d\n", adt7316_show_disable_averaging() 489 const char *buf, adt7316_store_disable_averaging() 498 if (buf[0] == '1') adt7316_store_disable_averaging() 517 char *buf) adt7316_show_enable_smbus_timeout() 522 return sprintf(buf, "%d\n", adt7316_show_enable_smbus_timeout() 528 const char *buf, adt7316_store_enable_smbus_timeout() 537 if (buf[0] == '1') adt7316_store_enable_smbus_timeout() 556 char *buf) adt7316_show_powerdown() 561 return sprintf(buf, "%d\n", !!(chip->config1 & ADT7316_PD)); adt7316_show_powerdown() 566 const char *buf, adt7316_store_powerdown() 575 if (buf[0] == '1') adt7316_store_powerdown() 594 char *buf) adt7316_show_fast_ad_clock() 599 return sprintf(buf, "%d\n", !!(chip->config3 & ADT7316_ADCLK_22_5)); adt7316_show_fast_ad_clock() 604 const char *buf, adt7316_store_fast_ad_clock() 613 if (buf[0] == '1') adt7316_store_fast_ad_clock() 632 char *buf) adt7316_show_da_high_resolution() 639 return sprintf(buf, "1 (12 bits)\n"); adt7316_show_da_high_resolution() 641 return sprintf(buf, "1 (10 bits)\n"); adt7316_show_da_high_resolution() 644 return sprintf(buf, "0 (8 bits)\n"); adt7316_show_da_high_resolution() 649 const char *buf, adt7316_store_da_high_resolution() 659 if (buf[0] == '1') { adt7316_store_da_high_resolution() 684 char *buf) adt7316_show_AIN_internal_Vref() 692 return sprintf(buf, "%d\n", adt7316_show_AIN_internal_Vref() 698 const char *buf, adt7316_store_AIN_internal_Vref() 709 if (buf[0] != '1') adt7316_store_AIN_internal_Vref() 731 char *buf) adt7316_show_enable_prop_DACA() 736 return sprintf(buf, "%d\n", adt7316_show_enable_prop_DACA() 742 const char *buf, adt7316_store_enable_prop_DACA() 751 if (buf[0] == '1') adt7316_store_enable_prop_DACA() 770 char *buf) adt7316_show_enable_prop_DACB() 775 return sprintf(buf, "%d\n", adt7316_show_enable_prop_DACB() 781 const char *buf, adt7316_store_enable_prop_DACB() 790 if (buf[0] == '1') adt7316_store_enable_prop_DACB() 809 char *buf) adt7316_show_DAC_2Vref_ch_mask() 814 return sprintf(buf, "0x%x\n", adt7316_show_DAC_2Vref_ch_mask() 820 const char *buf, adt7316_store_DAC_2Vref_ch_mask() 829 ret = kstrtou8(buf, 16, &data); adt7316_store_DAC_2Vref_ch_mask() 852 char *buf) adt7316_show_DAC_update_mode() 858 return sprintf(buf, "manual\n"); adt7316_show_DAC_update_mode() 862 return sprintf(buf, adt7316_show_DAC_update_mode() 865 return sprintf(buf, adt7316_show_DAC_update_mode() 868 return sprintf(buf, adt7316_show_DAC_update_mode() 871 return sprintf(buf, "3 - manual\n"); adt7316_show_DAC_update_mode() 877 const char *buf, adt7316_store_DAC_update_mode() 889 ret = kstrtou8(buf, 10, &data); adt7316_store_DAC_update_mode() 912 char *buf) adt7316_show_all_DAC_update_modes() 918 return sprintf(buf, "0 - auto at any MSB DAC writing\n" adt7316_show_all_DAC_update_modes() 923 return sprintf(buf, "manual\n"); adt7316_show_all_DAC_update_modes() 932 const char *buf, adt7316_store_update_DAC() 946 ret = kstrtou8(buf, 16, &data); adt7316_store_update_DAC() 972 char *buf) adt7316_show_DA_AB_Vref_bypass() 980 return sprintf(buf, "%d\n", adt7316_show_DA_AB_Vref_bypass() 986 const char *buf, adt7316_store_DA_AB_Vref_bypass() 998 if (buf[0] == '1') adt7316_store_DA_AB_Vref_bypass() 1017 char *buf) adt7316_show_DA_CD_Vref_bypass() 1025 return sprintf(buf, "%d\n", adt7316_show_DA_CD_Vref_bypass() 1031 const char *buf, adt7316_store_DA_CD_Vref_bypass() 1043 if (buf[0] == '1') adt7316_store_DA_CD_Vref_bypass() 1062 char *buf) adt7316_show_DAC_internal_Vref() 1068 return sprintf(buf, "0x%x\n", adt7316_show_DAC_internal_Vref() 1072 return sprintf(buf, "%d\n", adt7316_show_DAC_internal_Vref() 1078 const char *buf, adt7316_store_DAC_internal_Vref() 1088 ret = kstrtou8(buf, 16, &data); adt7316_store_DAC_internal_Vref() 1098 ret = kstrtou8(buf, 16, &data); adt7316_store_DAC_internal_Vref() 1123 int channel, char *buf) adt7316_show_ad() 1163 return sprintf(buf, "%d\n", data); adt7316_show_ad() 1181 return sprintf(buf, "%d\n", data); adt7316_show_ad() 1192 return sprintf(buf, "%c%d.%.2d\n", sign, adt7316_show_ad() 1199 char *buf) adt7316_show_VDD() 1204 return adt7316_show_ad(chip, ADT7316_AD_SINGLE_CH_VDD, buf); adt7316_show_VDD() 1210 char *buf) adt7316_show_in_temp() 1215 return adt7316_show_ad(chip, ADT7316_AD_SINGLE_CH_IN, buf); adt7316_show_in_temp() 1222 char *buf) adt7316_show_ex_temp_AIN1() 1227 return adt7316_show_ad(chip, ADT7316_AD_SINGLE_CH_EX, buf); adt7316_show_ex_temp_AIN1() 1236 char *buf) adt7316_show_AIN2() 1241 return adt7316_show_ad(chip, ADT7516_AD_SINGLE_CH_AIN2, buf); adt7316_show_AIN2() 1247 char *buf) adt7316_show_AIN3() 1252 return adt7316_show_ad(chip, ADT7516_AD_SINGLE_CH_AIN3, buf); adt7316_show_AIN3() 1258 char *buf) adt7316_show_AIN4() 1263 return adt7316_show_ad(chip, ADT7516_AD_SINGLE_CH_AIN4, buf); adt7316_show_AIN4() 1268 int offset_addr, char *buf) adt7316_show_temp_offset() 1282 return sprintf(buf, "%d\n", data); adt7316_show_temp_offset() 1286 int offset_addr, const char *buf, size_t len) adt7316_store_temp_offset() 1292 ret = kstrtoint(buf, 10, &data); adt7316_store_temp_offset() 1310 char *buf) adt7316_show_in_temp_offset() 1315 return adt7316_show_temp_offset(chip, ADT7316_IN_TEMP_OFFSET, buf); adt7316_show_in_temp_offset() 1320 const char *buf, adt7316_store_in_temp_offset() 1326 return adt7316_store_temp_offset(chip, ADT7316_IN_TEMP_OFFSET, buf, adt7316_store_in_temp_offset() 1336 char *buf) adt7316_show_ex_temp_offset() 1341 return adt7316_show_temp_offset(chip, ADT7316_EX_TEMP_OFFSET, buf); adt7316_show_ex_temp_offset() 1346 const char *buf, adt7316_store_ex_temp_offset() 1352 return adt7316_store_temp_offset(chip, ADT7316_EX_TEMP_OFFSET, buf, adt7316_store_ex_temp_offset() 1362 char *buf) adt7316_show_in_analog_temp_offset() 1368 ADT7316_IN_ANALOG_TEMP_OFFSET, buf); adt7316_show_in_analog_temp_offset() 1373 const char *buf, adt7316_store_in_analog_temp_offset() 1380 ADT7316_IN_ANALOG_TEMP_OFFSET, buf, len); adt7316_store_in_analog_temp_offset() 1389 char *buf) adt7316_show_ex_analog_temp_offset() 1395 ADT7316_EX_ANALOG_TEMP_OFFSET, buf); adt7316_show_ex_analog_temp_offset() 1400 const char *buf, adt7316_store_ex_analog_temp_offset() 1407 ADT7316_EX_ANALOG_TEMP_OFFSET, buf, len); adt7316_store_ex_analog_temp_offset() 1415 int channel, char *buf) adt7316_show_DAC() 1444 return sprintf(buf, "%d\n", data); adt7316_show_DAC() 1448 int channel, const char *buf, size_t len) adt7316_store_DAC() 1463 ret = kstrtou16(buf, 10, &data); adt7316_store_DAC() 1486 char *buf) adt7316_show_DAC_A() 1491 return adt7316_show_DAC(chip, 0, buf); adt7316_show_DAC_A() 1496 const char *buf, adt7316_store_DAC_A() 1502 return adt7316_store_DAC(chip, 0, buf, len); adt7316_store_DAC_A() 1510 char *buf) adt7316_show_DAC_B() 1515 return adt7316_show_DAC(chip, 1, buf); adt7316_show_DAC_B() 1520 const char *buf, adt7316_store_DAC_B() 1526 return adt7316_store_DAC(chip, 1, buf, len); adt7316_store_DAC_B() 1534 char *buf) adt7316_show_DAC_C() 1539 return adt7316_show_DAC(chip, 2, buf); adt7316_show_DAC_C() 1544 const char *buf, adt7316_store_DAC_C() 1550 return adt7316_store_DAC(chip, 2, buf, len); adt7316_store_DAC_C() 1558 char *buf) adt7316_show_DAC_D() 1563 return adt7316_show_DAC(chip, 3, buf); adt7316_show_DAC_D() 1568 const char *buf, adt7316_store_DAC_D() 1574 return adt7316_store_DAC(chip, 3, buf, len); adt7316_store_DAC_D() 1582 char *buf) adt7316_show_device_id() 1593 return sprintf(buf, "%d\n", id); adt7316_show_device_id() 1600 char *buf) adt7316_show_manufactorer_id() 1611 return sprintf(buf, "%d\n", id); adt7316_show_manufactorer_id() 1619 char *buf) adt7316_show_device_rev() 1630 return sprintf(buf, "%d\n", rev); adt7316_show_device_rev() 1637 char *buf) adt7316_show_bus_type() 1649 return sprintf(buf, "spi\n"); adt7316_show_bus_type() 1651 return sprintf(buf, "i2c\n"); adt7316_show_bus_type() 1821 char *buf) adt7316_show_int_mask() 1826 return sprintf(buf, "0x%x\n", chip->int_mask); adt7316_show_int_mask() 1834 const char *buf, adt7316_set_int_mask() 1843 ret = kstrtou16(buf, 16, &data); adt7316_set_int_mask() 1874 char *buf) adt7316_show_ad_bound() 1899 return sprintf(buf, "%d\n", data); adt7316_show_ad_bound() 1904 const char *buf, adt7316_set_ad_bound() 1918 ret = kstrtoint(buf, 10, &data); adt7316_set_ad_bound() 1945 char *buf) adt7316_show_int_enabled() 1950 return sprintf(buf, "%d\n", !!(chip->config1 & ADT7316_INT_EN)); adt7316_show_int_enabled() 1955 const char *buf, adt7316_set_int_enabled() 1964 if (buf[0] == '1') adt7316_set_int_enabled() 219 adt7316_show_enabled(struct device *dev, struct device_attribute *attr, char *buf) adt7316_show_enabled() argument 250 adt7316_store_enabled(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) adt7316_store_enabled() argument 275 adt7316_show_select_ex_temp(struct device *dev, struct device_attribute *attr, char *buf) adt7316_show_select_ex_temp() argument 288 adt7316_store_select_ex_temp(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) adt7316_store_select_ex_temp() argument 319 adt7316_show_mode(struct device *dev, struct device_attribute *attr, char *buf) adt7316_show_mode() argument 332 adt7316_store_mode(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) adt7316_store_mode() argument 360 adt7316_show_all_modes(struct device *dev, struct device_attribute *attr, char *buf) adt7316_show_all_modes() argument 369 adt7316_show_ad_channel(struct device *dev, struct device_attribute *attr, char *buf) adt7316_show_ad_channel() argument 407 adt7316_store_ad_channel(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) adt7316_store_ad_channel() argument 454 adt7316_show_all_ad_channels(struct device *dev, struct device_attribute *attr, char *buf) adt7316_show_all_ad_channels() argument 476 adt7316_show_disable_averaging(struct device *dev, struct device_attribute *attr, char *buf) adt7316_show_disable_averaging() argument 487 adt7316_store_disable_averaging(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) adt7316_store_disable_averaging() argument 515 adt7316_show_enable_smbus_timeout(struct device *dev, struct device_attribute *attr, char *buf) adt7316_show_enable_smbus_timeout() argument 526 adt7316_store_enable_smbus_timeout(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) adt7316_store_enable_smbus_timeout() argument 554 adt7316_show_powerdown(struct device *dev, struct device_attribute *attr, char *buf) adt7316_show_powerdown() argument 564 adt7316_store_powerdown(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) adt7316_store_powerdown() argument 592 adt7316_show_fast_ad_clock(struct device *dev, struct device_attribute *attr, char *buf) adt7316_show_fast_ad_clock() argument 602 adt7316_store_fast_ad_clock(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) adt7316_store_fast_ad_clock() argument 630 adt7316_show_da_high_resolution(struct device *dev, struct device_attribute *attr, char *buf) adt7316_show_da_high_resolution() argument 647 adt7316_store_da_high_resolution(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) adt7316_store_da_high_resolution() argument 682 adt7316_show_AIN_internal_Vref(struct device *dev, struct device_attribute *attr, char *buf) adt7316_show_AIN_internal_Vref() argument 696 adt7316_store_AIN_internal_Vref(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) adt7316_store_AIN_internal_Vref() argument 729 adt7316_show_enable_prop_DACA(struct device *dev, struct device_attribute *attr, char *buf) adt7316_show_enable_prop_DACA() argument 740 adt7316_store_enable_prop_DACA(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) adt7316_store_enable_prop_DACA() argument 768 adt7316_show_enable_prop_DACB(struct device *dev, struct device_attribute *attr, char *buf) adt7316_show_enable_prop_DACB() argument 779 adt7316_store_enable_prop_DACB(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) adt7316_store_enable_prop_DACB() argument 807 adt7316_show_DAC_2Vref_ch_mask(struct device *dev, struct device_attribute *attr, char *buf) adt7316_show_DAC_2Vref_ch_mask() argument 818 adt7316_store_DAC_2Vref_ch_mask(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) adt7316_store_DAC_2Vref_ch_mask() argument 850 adt7316_show_DAC_update_mode(struct device *dev, struct device_attribute *attr, char *buf) adt7316_show_DAC_update_mode() argument 875 adt7316_store_DAC_update_mode(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) adt7316_store_DAC_update_mode() argument 910 adt7316_show_all_DAC_update_modes(struct device *dev, struct device_attribute *attr, char *buf) adt7316_show_all_DAC_update_modes() argument 930 adt7316_store_update_DAC(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) adt7316_store_update_DAC() argument 970 adt7316_show_DA_AB_Vref_bypass(struct device *dev, struct device_attribute *attr, char *buf) adt7316_show_DA_AB_Vref_bypass() argument 984 adt7316_store_DA_AB_Vref_bypass(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) adt7316_store_DA_AB_Vref_bypass() argument 1015 adt7316_show_DA_CD_Vref_bypass(struct device *dev, struct device_attribute *attr, char *buf) adt7316_show_DA_CD_Vref_bypass() argument 1029 adt7316_store_DA_CD_Vref_bypass(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) adt7316_store_DA_CD_Vref_bypass() argument 1060 adt7316_show_DAC_internal_Vref(struct device *dev, struct device_attribute *attr, char *buf) adt7316_show_DAC_internal_Vref() argument 1076 adt7316_store_DAC_internal_Vref(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) adt7316_store_DAC_internal_Vref() argument 1122 adt7316_show_ad(struct adt7316_chip_info *chip, int channel, char *buf) adt7316_show_ad() argument 1197 adt7316_show_VDD(struct device *dev, struct device_attribute *attr, char *buf) adt7316_show_VDD() argument 1208 adt7316_show_in_temp(struct device *dev, struct device_attribute *attr, char *buf) adt7316_show_in_temp() argument 1220 adt7316_show_ex_temp_AIN1(struct device *dev, struct device_attribute *attr, char *buf) adt7316_show_ex_temp_AIN1() argument 1234 adt7316_show_AIN2(struct device *dev, struct device_attribute *attr, char *buf) adt7316_show_AIN2() argument 1245 adt7316_show_AIN3(struct device *dev, struct device_attribute *attr, char *buf) adt7316_show_AIN3() argument 1256 adt7316_show_AIN4(struct device *dev, struct device_attribute *attr, char *buf) adt7316_show_AIN4() argument 1267 adt7316_show_temp_offset(struct adt7316_chip_info *chip, int offset_addr, char *buf) adt7316_show_temp_offset() argument 1285 adt7316_store_temp_offset(struct adt7316_chip_info *chip, int offset_addr, const char *buf, size_t len) adt7316_store_temp_offset() argument 1308 adt7316_show_in_temp_offset(struct device *dev, struct device_attribute *attr, char *buf) adt7316_show_in_temp_offset() argument 1318 adt7316_store_in_temp_offset(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) adt7316_store_in_temp_offset() argument 1334 adt7316_show_ex_temp_offset(struct device *dev, struct device_attribute *attr, char *buf) adt7316_show_ex_temp_offset() argument 1344 adt7316_store_ex_temp_offset(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) adt7316_store_ex_temp_offset() argument 1360 adt7316_show_in_analog_temp_offset(struct device *dev, struct device_attribute *attr, char *buf) adt7316_show_in_analog_temp_offset() argument 1371 adt7316_store_in_analog_temp_offset(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) adt7316_store_in_analog_temp_offset() argument 1387 adt7316_show_ex_analog_temp_offset(struct device *dev, struct device_attribute *attr, char *buf) adt7316_show_ex_analog_temp_offset() argument 1398 adt7316_store_ex_analog_temp_offset(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) adt7316_store_ex_analog_temp_offset() argument 1414 adt7316_show_DAC(struct adt7316_chip_info *chip, int channel, char *buf) adt7316_show_DAC() argument 1447 adt7316_store_DAC(struct adt7316_chip_info *chip, int channel, const char *buf, size_t len) adt7316_store_DAC() argument 1484 adt7316_show_DAC_A(struct device *dev, struct device_attribute *attr, char *buf) adt7316_show_DAC_A() argument 1494 adt7316_store_DAC_A(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) adt7316_store_DAC_A() argument 1508 adt7316_show_DAC_B(struct device *dev, struct device_attribute *attr, char *buf) adt7316_show_DAC_B() argument 1518 adt7316_store_DAC_B(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) adt7316_store_DAC_B() argument 1532 adt7316_show_DAC_C(struct device *dev, struct device_attribute *attr, char *buf) adt7316_show_DAC_C() argument 1542 adt7316_store_DAC_C(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) adt7316_store_DAC_C() argument 1556 adt7316_show_DAC_D(struct device *dev, struct device_attribute *attr, char *buf) adt7316_show_DAC_D() argument 1566 adt7316_store_DAC_D(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) adt7316_store_DAC_D() argument 1580 adt7316_show_device_id(struct device *dev, struct device_attribute *attr, char *buf) adt7316_show_device_id() argument 1598 adt7316_show_manufactorer_id(struct device *dev, struct device_attribute *attr, char *buf) adt7316_show_manufactorer_id() argument 1617 adt7316_show_device_rev(struct device *dev, struct device_attribute *attr, char *buf) adt7316_show_device_rev() argument 1635 adt7316_show_bus_type(struct device *dev, struct device_attribute *attr, char *buf) adt7316_show_bus_type() argument 1819 adt7316_show_int_mask(struct device *dev, struct device_attribute *attr, char *buf) adt7316_show_int_mask() argument 1832 adt7316_set_int_mask(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) adt7316_set_int_mask() argument 1872 adt7316_show_ad_bound(struct device *dev, struct device_attribute *attr, char *buf) adt7316_show_ad_bound() argument 1902 adt7316_set_ad_bound(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) adt7316_set_ad_bound() argument 1943 adt7316_show_int_enabled(struct device *dev, struct device_attribute *attr, char *buf) adt7316_show_int_enabled() argument 1953 adt7316_set_int_enabled(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) adt7316_set_int_enabled() argument
|
/linux-4.4.14/sound/hda/ |
H A D | hdac_sysfs.c | 21 char *buf) \ 24 return sprintf(buf, "0x%x\n", codec->type); \ 31 char *buf) \ 34 return sprintf(buf, "%s\n", \ 49 char *buf) modalias_show() 51 return snd_hdac_codec_modalias(dev_to_hdac_dev(dev), buf, 256); modalias_show() 89 struct widget_attribute *attr, char *buf); 92 const char *buf, size_t count); 109 char *buf) widget_attr_show() 121 return wid_attr->show(codec, nid, wid_attr, buf); widget_attr_show() 125 const char *buf, size_t count) widget_attr_store() 137 return wid_attr->store(codec, nid, wid_attr, buf, count); widget_attr_store() 161 struct widget_attribute *attr, char *buf) caps_show() 163 return sprintf(buf, "0x%08x\n", get_wcaps(codec, nid)); caps_show() 167 struct widget_attribute *attr, char *buf) pin_caps_show() 171 return sprintf(buf, "0x%08x\n", pin_caps_show() 176 struct widget_attribute *attr, char *buf) pin_cfg_show() 184 return sprintf(buf, "0x%08x\n", val); pin_cfg_show() 201 struct widget_attribute *attr, char *buf) pcm_caps_show() 205 return sprintf(buf, "0x%08x\n", pcm_caps_show() 210 struct widget_attribute *attr, char *buf) pcm_formats_show() 214 return sprintf(buf, "0x%08x\n", pcm_formats_show() 219 struct widget_attribute *attr, char *buf) amp_in_caps_show() 223 return sprintf(buf, "0x%08x\n", amp_in_caps_show() 228 struct widget_attribute *attr, char *buf) amp_out_caps_show() 232 return sprintf(buf, "0x%08x\n", amp_out_caps_show() 237 struct widget_attribute *attr, char *buf) power_caps_show() 241 return sprintf(buf, "0x%08x\n", power_caps_show() 246 struct widget_attribute *attr, char *buf) gpio_caps_show() 248 return sprintf(buf, "0x%08x\n", gpio_caps_show() 253 struct widget_attribute *attr, char *buf) connections_show() 263 ret += sprintf(buf + ret, "%s0x%02x", i ? " " : "", list[i]); connections_show() 264 ret += sprintf(buf + ret, "\n"); connections_show() 48 modalias_show(struct device *dev, struct device_attribute *attr, char *buf) modalias_show() argument 108 widget_attr_show(struct kobject *kobj, struct attribute *attr, char *buf) widget_attr_show() argument 124 widget_attr_store(struct kobject *kobj, struct attribute *attr, const char *buf, size_t count) widget_attr_store() argument 160 caps_show(struct hdac_device *codec, hda_nid_t nid, struct widget_attribute *attr, char *buf) caps_show() argument 166 pin_caps_show(struct hdac_device *codec, hda_nid_t nid, struct widget_attribute *attr, char *buf) pin_caps_show() argument 175 pin_cfg_show(struct hdac_device *codec, hda_nid_t nid, struct widget_attribute *attr, char *buf) pin_cfg_show() argument 200 pcm_caps_show(struct hdac_device *codec, hda_nid_t nid, struct widget_attribute *attr, char *buf) pcm_caps_show() argument 209 pcm_formats_show(struct hdac_device *codec, hda_nid_t nid, struct widget_attribute *attr, char *buf) pcm_formats_show() argument 218 amp_in_caps_show(struct hdac_device *codec, hda_nid_t nid, struct widget_attribute *attr, char *buf) amp_in_caps_show() argument 227 amp_out_caps_show(struct hdac_device *codec, hda_nid_t nid, struct widget_attribute *attr, char *buf) amp_out_caps_show() argument 236 power_caps_show(struct hdac_device *codec, hda_nid_t nid, struct widget_attribute *attr, char *buf) power_caps_show() argument 245 gpio_caps_show(struct hdac_device *codec, hda_nid_t nid, struct widget_attribute *attr, char *buf) gpio_caps_show() argument 252 connections_show(struct hdac_device *codec, hda_nid_t nid, struct widget_attribute *attr, char *buf) connections_show() argument
|
/linux-4.4.14/drivers/tty/serial/ |
H A D | earlycon.c | 109 static int __init register_earlycon(char *buf, const struct earlycon_id *match) register_earlycon() argument 114 /* On parsing error, pass the options buf to the setup function */ register_earlycon() 115 if (buf && !parse_options(&early_console_dev, buf)) register_earlycon() 116 buf = NULL; register_earlycon() 124 err = match->setup(&early_console_dev, buf); register_earlycon() 136 * @buf: earlycon param string 139 * in the param string @buf. Acceptable param strings are of the form 152 int __init setup_earlycon(char *buf) setup_earlycon() argument 156 if (!buf || !buf[0]) setup_earlycon() 165 if (strncmp(buf, match->name, len)) setup_earlycon() 168 if (buf[len]) { setup_earlycon() 169 if (buf[len] != ',') setup_earlycon() 171 buf += len + 1; setup_earlycon() 173 buf = NULL; setup_earlycon() 175 return register_earlycon(buf, match); setup_earlycon() 182 static int __init param_setup_earlycon(char *buf) param_setup_earlycon() argument 190 if (!buf || !buf[0]) param_setup_earlycon() 193 err = setup_earlycon(buf); param_setup_earlycon()
|
/linux-4.4.14/drivers/gpu/drm/nouveau/ |
H A D | nouveau_sysfs.c | 53 char *buf = b; nouveau_sysfs_pstate_get() local 75 snappendf(buf, cnt, "%02x:", attr.state); nouveau_sysfs_pstate_get() 77 snappendf(buf, cnt, "%s:", info.pwrsrc == 0 ? "DC" : nouveau_sysfs_pstate_get() 90 snappendf(buf, cnt, " %s %d", attr.name, attr.min); nouveau_sysfs_pstate_get() 92 snappendf(buf, cnt, "-%d", attr.max); nouveau_sysfs_pstate_get() 93 snappendf(buf, cnt, " %s", attr.unit); nouveau_sysfs_pstate_get() 98 snappendf(buf, cnt, " AC"); nouveau_sysfs_pstate_get() 100 snappendf(buf, cnt, " DC"); nouveau_sysfs_pstate_get() 102 snappendf(buf, cnt, " *"); nouveau_sysfs_pstate_get() 105 snappendf(buf, cnt, " AC"); nouveau_sysfs_pstate_get() 107 snappendf(buf, cnt, " DC"); nouveau_sysfs_pstate_get() 110 snappendf(buf, cnt, "\n"); nouveau_sysfs_pstate_get() 118 const char *buf, size_t count) nouveau_sysfs_pstate_set() 125 if ((tmp = strchr(buf, '\n'))) nouveau_sysfs_pstate_set() 128 if (!strncasecmp(buf, "dc:", 3)) { nouveau_sysfs_pstate_set() 130 buf += 3; nouveau_sysfs_pstate_set() 132 if (!strncasecmp(buf, "ac:", 3)) { nouveau_sysfs_pstate_set() 134 buf += 3; nouveau_sysfs_pstate_set() 137 if (!strcasecmp(buf, "none")) nouveau_sysfs_pstate_set() 140 if (!strcasecmp(buf, "auto")) nouveau_sysfs_pstate_set() 143 ret = kstrtol(buf, 16, &value); nouveau_sysfs_pstate_set() 117 nouveau_sysfs_pstate_set(struct device *d, struct device_attribute *a, const char *buf, size_t count) nouveau_sysfs_pstate_set() argument
|
H A D | nouveau_hwmon.c | 39 nouveau_hwmon_show_temp(struct device *d, struct device_attribute *a, char *buf) nouveau_hwmon_show_temp() argument 49 return snprintf(buf, PAGE_SIZE, "%d\n", temp * 1000); nouveau_hwmon_show_temp() 56 struct device_attribute *a, char *buf) nouveau_hwmon_show_temp1_auto_point1_pwm() 58 return snprintf(buf, PAGE_SIZE, "%d\n", 100); nouveau_hwmon_show_temp1_auto_point1_pwm() 65 struct device_attribute *a, char *buf) nouveau_hwmon_temp1_auto_point1_temp() 71 return snprintf(buf, PAGE_SIZE, "%d\n", nouveau_hwmon_temp1_auto_point1_temp() 77 const char *buf, size_t count) nouveau_hwmon_set_temp1_auto_point1_temp() 84 if (kstrtol(buf, 10, &value) == -EINVAL) nouveau_hwmon_set_temp1_auto_point1_temp() 98 struct device_attribute *a, char *buf) nouveau_hwmon_temp1_auto_point1_temp_hyst() 104 return snprintf(buf, PAGE_SIZE, "%d\n", nouveau_hwmon_temp1_auto_point1_temp_hyst() 110 const char *buf, size_t count) nouveau_hwmon_set_temp1_auto_point1_temp_hyst() 117 if (kstrtol(buf, 10, &value) == -EINVAL) nouveau_hwmon_set_temp1_auto_point1_temp_hyst() 130 nouveau_hwmon_max_temp(struct device *d, struct device_attribute *a, char *buf) nouveau_hwmon_max_temp() argument 136 return snprintf(buf, PAGE_SIZE, "%d\n", nouveau_hwmon_max_temp() 141 const char *buf, size_t count) nouveau_hwmon_set_max_temp() 148 if (kstrtol(buf, 10, &value) == -EINVAL) nouveau_hwmon_set_max_temp() 161 char *buf) nouveau_hwmon_max_temp_hyst() 167 return snprintf(buf, PAGE_SIZE, "%d\n", nouveau_hwmon_max_temp_hyst() 172 const char *buf, size_t count) nouveau_hwmon_set_max_temp_hyst() 179 if (kstrtol(buf, 10, &value) == -EINVAL) nouveau_hwmon_set_max_temp_hyst() 193 char *buf) nouveau_hwmon_critical_temp() 199 return snprintf(buf, PAGE_SIZE, "%d\n", nouveau_hwmon_critical_temp() 204 const char *buf, nouveau_hwmon_set_critical_temp() 212 if (kstrtol(buf, 10, &value) == -EINVAL) nouveau_hwmon_set_critical_temp() 226 char *buf) nouveau_hwmon_critical_temp_hyst() 232 return snprintf(buf, PAGE_SIZE, "%d\n", nouveau_hwmon_critical_temp_hyst() 238 const char *buf, nouveau_hwmon_set_critical_temp_hyst() 246 if (kstrtol(buf, 10, &value) == -EINVAL) nouveau_hwmon_set_critical_temp_hyst() 259 char *buf) nouveau_hwmon_emergency_temp() 265 return snprintf(buf, PAGE_SIZE, "%d\n", nouveau_hwmon_emergency_temp() 270 const char *buf, nouveau_hwmon_set_emergency_temp() 278 if (kstrtol(buf, 10, &value) == -EINVAL) nouveau_hwmon_set_emergency_temp() 292 char *buf) nouveau_hwmon_emergency_temp_hyst() 298 return snprintf(buf, PAGE_SIZE, "%d\n", nouveau_hwmon_emergency_temp_hyst() 304 const char *buf, nouveau_hwmon_set_emergency_temp_hyst() 312 if (kstrtol(buf, 10, &value) == -EINVAL) nouveau_hwmon_set_emergency_temp_hyst() 327 char *buf) nouveau_hwmon_show_name() 329 return sprintf(buf, "nouveau\n"); nouveau_hwmon_show_name() 335 char *buf) nouveau_hwmon_show_update_rate() 337 return sprintf(buf, "1000\n"); nouveau_hwmon_show_update_rate() 345 char *buf) nouveau_hwmon_show_fan1_input() 351 return snprintf(buf, PAGE_SIZE, "%d\n", nvkm_therm_fan_sense(therm)); nouveau_hwmon_show_fan1_input() 358 struct device_attribute *a, char *buf) nouveau_hwmon_get_pwm1_enable() 369 return sprintf(buf, "%i\n", ret); nouveau_hwmon_get_pwm1_enable() 374 const char *buf, size_t count) nouveau_hwmon_set_pwm1_enable() 382 ret = kstrtol(buf, 10, &value); nouveau_hwmon_set_pwm1_enable() 397 nouveau_hwmon_get_pwm1(struct device *d, struct device_attribute *a, char *buf) nouveau_hwmon_get_pwm1() argument 408 return sprintf(buf, "%i\n", ret); nouveau_hwmon_get_pwm1() 413 const char *buf, size_t count) nouveau_hwmon_set_pwm1() 421 if (kstrtol(buf, 10, &value) == -EINVAL) nouveau_hwmon_set_pwm1() 437 struct device_attribute *a, char *buf) nouveau_hwmon_get_pwm1_min() 448 return sprintf(buf, "%i\n", ret); nouveau_hwmon_get_pwm1_min() 453 const char *buf, size_t count) nouveau_hwmon_set_pwm1_min() 461 if (kstrtol(buf, 10, &value) == -EINVAL) nouveau_hwmon_set_pwm1_min() 477 struct device_attribute *a, char *buf) nouveau_hwmon_get_pwm1_max() 488 return sprintf(buf, "%i\n", ret); nouveau_hwmon_get_pwm1_max() 493 const char *buf, size_t count) nouveau_hwmon_set_pwm1_max() 501 if (kstrtol(buf, 10, &value) == -EINVAL) nouveau_hwmon_set_pwm1_max() 55 nouveau_hwmon_show_temp1_auto_point1_pwm(struct device *d, struct device_attribute *a, char *buf) nouveau_hwmon_show_temp1_auto_point1_pwm() argument 64 nouveau_hwmon_temp1_auto_point1_temp(struct device *d, struct device_attribute *a, char *buf) nouveau_hwmon_temp1_auto_point1_temp() argument 75 nouveau_hwmon_set_temp1_auto_point1_temp(struct device *d, struct device_attribute *a, const char *buf, size_t count) nouveau_hwmon_set_temp1_auto_point1_temp() argument 97 nouveau_hwmon_temp1_auto_point1_temp_hyst(struct device *d, struct device_attribute *a, char *buf) nouveau_hwmon_temp1_auto_point1_temp_hyst() argument 108 nouveau_hwmon_set_temp1_auto_point1_temp_hyst(struct device *d, struct device_attribute *a, const char *buf, size_t count) nouveau_hwmon_set_temp1_auto_point1_temp_hyst() argument 140 nouveau_hwmon_set_max_temp(struct device *d, struct device_attribute *a, const char *buf, size_t count) nouveau_hwmon_set_max_temp() argument 160 nouveau_hwmon_max_temp_hyst(struct device *d, struct device_attribute *a, char *buf) nouveau_hwmon_max_temp_hyst() argument 171 nouveau_hwmon_set_max_temp_hyst(struct device *d, struct device_attribute *a, const char *buf, size_t count) nouveau_hwmon_set_max_temp_hyst() argument 192 nouveau_hwmon_critical_temp(struct device *d, struct device_attribute *a, char *buf) nouveau_hwmon_critical_temp() argument 203 nouveau_hwmon_set_critical_temp(struct device *d, struct device_attribute *a, const char *buf, size_t count) nouveau_hwmon_set_critical_temp() argument 225 nouveau_hwmon_critical_temp_hyst(struct device *d, struct device_attribute *a, char *buf) nouveau_hwmon_critical_temp_hyst() argument 236 nouveau_hwmon_set_critical_temp_hyst(struct device *d, struct device_attribute *a, const char *buf, size_t count) nouveau_hwmon_set_critical_temp_hyst() argument 258 nouveau_hwmon_emergency_temp(struct device *d, struct device_attribute *a, char *buf) nouveau_hwmon_emergency_temp() argument 269 nouveau_hwmon_set_emergency_temp(struct device *d, struct device_attribute *a, const char *buf, size_t count) nouveau_hwmon_set_emergency_temp() argument 291 nouveau_hwmon_emergency_temp_hyst(struct device *d, struct device_attribute *a, char *buf) nouveau_hwmon_emergency_temp_hyst() argument 302 nouveau_hwmon_set_emergency_temp_hyst(struct device *d, struct device_attribute *a, const char *buf, size_t count) nouveau_hwmon_set_emergency_temp_hyst() argument 325 nouveau_hwmon_show_name(struct device *dev, struct device_attribute *attr, char *buf) nouveau_hwmon_show_name() argument 333 nouveau_hwmon_show_update_rate(struct device *dev, struct device_attribute *attr, char *buf) nouveau_hwmon_show_update_rate() argument 344 nouveau_hwmon_show_fan1_input(struct device *d, struct device_attribute *attr, char *buf) nouveau_hwmon_show_fan1_input() argument 357 nouveau_hwmon_get_pwm1_enable(struct device *d, struct device_attribute *a, char *buf) nouveau_hwmon_get_pwm1_enable() argument 373 nouveau_hwmon_set_pwm1_enable(struct device *d, struct device_attribute *a, const char *buf, size_t count) nouveau_hwmon_set_pwm1_enable() argument 412 nouveau_hwmon_set_pwm1(struct device *d, struct device_attribute *a, const char *buf, size_t count) nouveau_hwmon_set_pwm1() argument 436 nouveau_hwmon_get_pwm1_min(struct device *d, struct device_attribute *a, char *buf) nouveau_hwmon_get_pwm1_min() argument 452 nouveau_hwmon_set_pwm1_min(struct device *d, struct device_attribute *a, const char *buf, size_t count) nouveau_hwmon_set_pwm1_min() argument 476 nouveau_hwmon_get_pwm1_max(struct device *d, struct device_attribute *a, char *buf) nouveau_hwmon_get_pwm1_max() argument 492 nouveau_hwmon_set_pwm1_max(struct device *d, struct device_attribute *a, const char *buf, size_t count) nouveau_hwmon_set_pwm1_max() argument
|
/linux-4.4.14/drivers/block/paride/ |
H A D | friq.c | 77 static void friq_read_block_int( PIA *pi, char * buf, int count, int regr ) friq_read_block_int() argument 87 buf[k] = j44(l,h); friq_read_block_int() 97 buf[k] = r0(); friq_read_block_int() 104 for (k=0;k<count-2;k++) buf[k] = r4(); friq_read_block_int() 106 buf[count-2] = r4(); friq_read_block_int() 107 buf[count-1] = r4(); friq_read_block_int() 112 for (k=0;k<(count/2)-1;k++) ((u16 *)buf)[k] = r4w(); friq_read_block_int() 114 buf[count-2] = r4(); friq_read_block_int() 115 buf[count-1] = r4(); friq_read_block_int() 120 for (k=0;k<(count/4)-1;k++) ((u32 *)buf)[k] = r4l(); friq_read_block_int() 121 buf[count-4] = r4(); friq_read_block_int() 122 buf[count-3] = r4(); friq_read_block_int() 124 buf[count-2] = r4(); friq_read_block_int() 125 buf[count-1] = r4(); friq_read_block_int() 132 static void friq_read_block( PIA *pi, char * buf, int count) friq_read_block() argument 134 { friq_read_block_int(pi,buf,count,0x08); friq_read_block() 137 static void friq_write_block( PIA *pi, char * buf, int count ) friq_write_block() argument 146 w0(buf[k]); friq_write_block() 153 for (k=0;k<count;k++) w4(buf[k]); friq_write_block() 158 for (k=0;k<count/2;k++) w4w(((u16 *)buf)[k]); friq_write_block() 163 for (k=0;k<count/4;k++) w4l(((u32 *)buf)[k]); friq_write_block()
|
/linux-4.4.14/include/net/ |
H A D | if_inet6.h | 211 static inline void ipv6_eth_mc_map(const struct in6_addr *addr, char *buf) ipv6_eth_mc_map() argument 219 buf[0]= 0x33; ipv6_eth_mc_map() 220 buf[1]= 0x33; ipv6_eth_mc_map() 222 memcpy(buf + 2, &addr->s6_addr32[3], sizeof(__u32)); ipv6_eth_mc_map() 225 static inline void ipv6_arcnet_mc_map(const struct in6_addr *addr, char *buf) ipv6_arcnet_mc_map() argument 227 buf[0] = 0x00; ipv6_arcnet_mc_map() 231 const unsigned char *broadcast, char *buf) ipv6_ib_mc_map() 235 buf[0] = 0; /* Reserved */ ipv6_ib_mc_map() 236 buf[1] = 0xff; /* Multicast QPN */ ipv6_ib_mc_map() 237 buf[2] = 0xff; ipv6_ib_mc_map() 238 buf[3] = 0xff; ipv6_ib_mc_map() 239 buf[4] = 0xff; ipv6_ib_mc_map() 240 buf[5] = 0x10 | scope; /* scope from broadcast address */ ipv6_ib_mc_map() 241 buf[6] = 0x60; /* IPv6 signature */ ipv6_ib_mc_map() 242 buf[7] = 0x1b; ipv6_ib_mc_map() 243 buf[8] = broadcast[8]; /* P_Key */ ipv6_ib_mc_map() 244 buf[9] = broadcast[9]; ipv6_ib_mc_map() 245 memcpy(buf + 10, addr->s6_addr + 6, 10); ipv6_ib_mc_map() 249 const unsigned char *broadcast, char *buf) ipv6_ipgre_mc_map() 252 memcpy(buf, broadcast, 4); ipv6_ipgre_mc_map() 258 memcpy(buf, &addr->s6_addr32[3], 4); ipv6_ipgre_mc_map() 230 ipv6_ib_mc_map(const struct in6_addr *addr, const unsigned char *broadcast, char *buf) ipv6_ib_mc_map() argument 248 ipv6_ipgre_mc_map(const struct in6_addr *addr, const unsigned char *broadcast, char *buf) ipv6_ipgre_mc_map() argument
|
/linux-4.4.14/drivers/base/ |
H A D | firmware_class.c | 182 struct firmware_buf *buf; __allocate_fw_buf() local 184 buf = kzalloc(sizeof(*buf), GFP_ATOMIC); __allocate_fw_buf() 185 if (!buf) __allocate_fw_buf() 188 buf->fw_id = kstrdup_const(fw_name, GFP_ATOMIC); __allocate_fw_buf() 189 if (!buf->fw_id) { __allocate_fw_buf() 190 kfree(buf); __allocate_fw_buf() 194 kref_init(&buf->ref); __allocate_fw_buf() 195 buf->fwc = fwc; __allocate_fw_buf() 196 init_completion(&buf->completion); __allocate_fw_buf() 198 INIT_LIST_HEAD(&buf->pending_list); __allocate_fw_buf() 201 pr_debug("%s: fw-%s buf=%p\n", __func__, fw_name, buf); __allocate_fw_buf() 203 return buf; __allocate_fw_buf() 219 struct firmware_buf **buf) fw_lookup_and_allocate_buf() 228 *buf = tmp; fw_lookup_and_allocate_buf() 236 *buf = tmp; fw_lookup_and_allocate_buf() 244 struct firmware_buf *buf = to_fwbuf(ref); variable in typeref:struct:firmware_buf 245 struct firmware_cache *fwc = buf->fwc; 247 pr_debug("%s: fw-%s buf=%p data=%p size=%u\n", 248 __func__, buf->fw_id, buf, buf->data, 249 (unsigned int)buf->size); 251 list_del(&buf->list); 255 if (buf->is_paged_buf) { 257 vunmap(buf->data); 258 for (i = 0; i < buf->nr_pages; i++) 259 __free_page(buf->pages[i]); 260 kfree(buf->pages); 263 vfree(buf->data); 264 kfree_const(buf->fw_id); 265 kfree(buf); variable 268 static void fw_free_buf(struct firmware_buf *buf) fw_free_buf() argument 270 struct firmware_cache *fwc = buf->fwc; fw_free_buf() 272 if (!kref_put(&buf->ref, __fw_free_buf)) fw_free_buf() 297 char *buf; fw_read_file_contents() local 305 buf = vmalloc(size); fw_read_file_contents() 306 if (!buf) fw_read_file_contents() 308 rc = kernel_read(file, 0, buf, size); fw_read_file_contents() 314 rc = security_kernel_fw_from_file(file, buf, size); fw_read_file_contents() 317 fw_buf->data = buf; fw_read_file_contents() 321 vfree(buf); fw_read_file_contents() 326 struct firmware_buf *buf) fw_get_filesystem_firmware() 344 fw_path[i], buf->fw_id); fw_get_filesystem_firmware() 353 rc = fw_read_file_contents(file, buf); fw_get_filesystem_firmware() 365 buf->fw_id); fw_get_filesystem_firmware() 367 set_bit(FW_STATUS_DONE, &buf->status); fw_get_filesystem_firmware() 368 complete_all(&buf->completion); fw_get_filesystem_firmware() 386 /* store the pages buffer info firmware from buf */ fw_set_page_data() 387 static void fw_set_page_data(struct firmware_buf *buf, struct firmware *fw) fw_set_page_data() argument 389 fw->priv = buf; fw_set_page_data() 391 fw->pages = buf->pages; fw_set_page_data() 393 fw->size = buf->size; fw_set_page_data() 394 fw->data = buf->data; fw_set_page_data() 396 pr_debug("%s: fw-%s buf=%p data=%p size=%u\n", fw_set_page_data() 397 __func__, buf->fw_id, buf, buf->data, fw_set_page_data() 398 (unsigned int)buf->size); fw_set_page_data() 470 struct firmware_buf *buf; member in struct:firmware_priv 479 static void __fw_load_abort(struct firmware_buf *buf) __fw_load_abort() argument 485 if (test_bit(FW_STATUS_DONE, &buf->status)) __fw_load_abort() 488 list_del_init(&buf->pending_list); __fw_load_abort() 489 set_bit(FW_STATUS_ABORT, &buf->status); __fw_load_abort() 490 complete_all(&buf->completion); __fw_load_abort() 495 struct firmware_buf *buf = fw_priv->buf; fw_load_abort() local 497 __fw_load_abort(buf); fw_load_abort() 500 fw_priv->buf = NULL; fw_load_abort() 503 #define is_fw_load_aborted(buf) \ 504 test_bit(FW_STATUS_ABORT, &(buf)->status) 526 char *buf) timeout_show() 528 return sprintf(buf, "%d\n", loading_timeout); timeout_show() 535 * @buf: buffer to scan for timeout value 536 * @count: number of bytes in @buf 545 const char *buf, size_t count) timeout_store() 547 loading_timeout = simple_strtol(buf, NULL, 10); timeout_store() 568 if (add_uevent_var(env, "FIRMWARE=%s", fw_priv->buf->fw_id)) do_firmware_uevent() 584 if (fw_priv->buf) firmware_uevent() 598 struct device_attribute *attr, char *buf) firmware_loading_show() 604 if (fw_priv->buf) firmware_loading_show() 605 loading = test_bit(FW_STATUS_LOADING, &fw_priv->buf->status); firmware_loading_show() 608 return sprintf(buf, "%d\n", loading); firmware_loading_show() 617 static int fw_map_pages_buf(struct firmware_buf *buf) fw_map_pages_buf() argument 619 if (!buf->is_paged_buf) fw_map_pages_buf() 622 vunmap(buf->data); fw_map_pages_buf() 623 buf->data = vmap(buf->pages, buf->nr_pages, 0, PAGE_KERNEL_RO); fw_map_pages_buf() 624 if (!buf->data) fw_map_pages_buf() 633 * @buf: buffer to scan for loading control value 634 * @count: number of bytes in @buf 644 const char *buf, size_t count) firmware_loading_store() 649 int loading = simple_strtol(buf, NULL, 10); firmware_loading_store() 653 fw_buf = fw_priv->buf; firmware_loading_store() 679 * one same firmware buf, so let all requests firmware_loading_store() 680 * see the mapped 'buf->data' once the loading firmware_loading_store() 724 struct firmware_buf *buf; firmware_data_read() local 728 buf = fw_priv->buf; firmware_data_read() 729 if (!buf || test_bit(FW_STATUS_DONE, &buf->status)) { firmware_data_read() 733 if (offset > buf->size) { firmware_data_read() 737 if (count > buf->size - offset) firmware_data_read() 738 count = buf->size - offset; firmware_data_read() 748 page_data = kmap(buf->pages[page_nr]); firmware_data_read() 752 kunmap(buf->pages[page_nr]); firmware_data_read() 764 struct firmware_buf *buf = fw_priv->buf; fw_realloc_buffer() local 768 if (buf->page_array_size < pages_needed) { fw_realloc_buffer() 770 buf->page_array_size * 2); fw_realloc_buffer() 779 memcpy(new_pages, buf->pages, fw_realloc_buffer() 780 buf->page_array_size * sizeof(void *)); fw_realloc_buffer() 781 memset(&new_pages[buf->page_array_size], 0, sizeof(void *) * fw_realloc_buffer() 782 (new_array_size - buf->page_array_size)); fw_realloc_buffer() 783 kfree(buf->pages); fw_realloc_buffer() 784 buf->pages = new_pages; fw_realloc_buffer() 785 buf->page_array_size = new_array_size; fw_realloc_buffer() 788 while (buf->nr_pages < pages_needed) { fw_realloc_buffer() 789 buf->pages[buf->nr_pages] = fw_realloc_buffer() 792 if (!buf->pages[buf->nr_pages]) { fw_realloc_buffer() 796 buf->nr_pages++; fw_realloc_buffer() 819 struct firmware_buf *buf; firmware_data_write() local 826 buf = fw_priv->buf; firmware_data_write() 827 if (!buf || test_bit(FW_STATUS_DONE, &buf->status)) { firmware_data_write() 844 page_data = kmap(buf->pages[page_nr]); firmware_data_write() 848 kunmap(buf->pages[page_nr]); firmware_data_write() 854 buf->size = max_t(size_t, offset, buf->size); firmware_data_write() 919 struct firmware_buf *buf = fw_priv->buf; _request_firmware_load() local 922 buf->is_paged_buf = true; _request_firmware_load() 933 list_add(&buf->pending_list, &pending_fw_head); _request_firmware_load() 937 buf->need_uevent = true; _request_firmware_load() 939 dev_dbg(f_dev, "firmware: requesting %s\n", buf->fw_id); _request_firmware_load() 945 retval = wait_for_completion_interruptible_timeout(&buf->completion, _request_firmware_load() 955 if (is_fw_load_aborted(buf)) _request_firmware_load() 957 else if (!buf->data) _request_firmware_load() 976 fw_priv->buf = firmware->priv; fw_load_from_user_helper() 984 struct firmware_buf *buf; kill_requests_without_uevent() local 988 list_for_each_entry_safe(buf, next, &pending_fw_head, pending_list) { kill_requests_without_uevent() 989 if (!buf->need_uevent) kill_requests_without_uevent() 990 __fw_load_abort(buf); kill_requests_without_uevent() 1006 #define is_fw_load_aborted(buf) false 1016 static int sync_cached_firmware_buf(struct firmware_buf *buf) sync_cached_firmware_buf() argument 1021 while (!test_bit(FW_STATUS_DONE, &buf->status)) { sync_cached_firmware_buf() 1022 if (is_fw_load_aborted(buf)) { sync_cached_firmware_buf() 1027 ret = wait_for_completion_interruptible(&buf->completion); sync_cached_firmware_buf() 1043 struct firmware_buf *buf; _request_firmware_prepare() local 1058 ret = fw_lookup_and_allocate_buf(name, &fw_cache, &buf); _request_firmware_prepare() 1061 * bind with 'buf' now to avoid warning in failure path _request_firmware_prepare() 1064 firmware->priv = buf; _request_firmware_prepare() 1067 ret = sync_cached_firmware_buf(buf); _request_firmware_prepare() 1069 fw_set_page_data(buf, firmware); _request_firmware_prepare() 1082 struct firmware_buf *buf = fw->priv; assign_firmware_buf() local 1085 if (!buf->size || is_fw_load_aborted(buf)) { assign_firmware_buf() 1099 fw_add_devm_name(device, buf->fw_id); assign_firmware_buf() 1105 if (buf->fwc->state == FW_LOADER_START_CACHE) { assign_firmware_buf() 1106 if (fw_cache_piggyback_on_request(buf->fw_id)) assign_firmware_buf() 1107 kref_get(&buf->ref); assign_firmware_buf() 1111 fw_set_page_data(buf, fw); assign_firmware_buf() 1401 struct firmware_buf *buf; uncache_firmware() local 1409 buf = fw_lookup_buf(fw_name); uncache_firmware() 1410 if (buf) { uncache_firmware() 1411 fw_free_buf(buf); uncache_firmware() 217 fw_lookup_and_allocate_buf(const char *fw_name, struct firmware_cache *fwc, struct firmware_buf **buf) fw_lookup_and_allocate_buf() argument 325 fw_get_filesystem_firmware(struct device *device, struct firmware_buf *buf) fw_get_filesystem_firmware() argument 525 timeout_show(struct class *class, struct class_attribute *attr, char *buf) timeout_show() argument 544 timeout_store(struct class *class, struct class_attribute *attr, const char *buf, size_t count) timeout_store() argument 597 firmware_loading_show(struct device *dev, struct device_attribute *attr, char *buf) firmware_loading_show() argument 642 firmware_loading_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) firmware_loading_store() argument
|
/linux-4.4.14/fs/nfsd/ |
H A D | nfsctl.c | 60 static ssize_t write_filehandle(struct file *file, char *buf, size_t size); 61 static ssize_t write_unlock_ip(struct file *file, char *buf, size_t size); 62 static ssize_t write_unlock_fs(struct file *file, char *buf, size_t size); 63 static ssize_t write_threads(struct file *file, char *buf, size_t size); 64 static ssize_t write_pool_threads(struct file *file, char *buf, size_t size); 65 static ssize_t write_versions(struct file *file, char *buf, size_t size); 66 static ssize_t write_ports(struct file *file, char *buf, size_t size); 67 static ssize_t write_maxblksize(struct file *file, char *buf, size_t size); 68 static ssize_t write_maxconn(struct file *file, char *buf, size_t size); 70 static ssize_t write_leasetime(struct file *file, char *buf, size_t size); 71 static ssize_t write_gracetime(struct file *file, char *buf, size_t size); 72 static ssize_t write_recoverydir(struct file *file, char *buf, size_t size); 73 static ssize_t write_v4_end_grace(struct file *file, char *buf, size_t size); 94 static ssize_t nfsctl_transaction_write(struct file *file, const char __user *buf, size_t size, loff_t *pos) nfsctl_transaction_write() argument 103 data = simple_transaction_get(file, buf, size); nfsctl_transaction_write() 115 static ssize_t nfsctl_transaction_read(struct file *file, char __user *buf, size_t size, loff_t *pos) nfsctl_transaction_read() argument 122 ssize_t rv = nfsctl_transaction_write(file, buf, 0, pos); nfsctl_transaction_read() 126 return simple_transaction_read(file, buf, size, pos); nfsctl_transaction_read() 246 * buf: '\n'-terminated C string containing a 248 * size: length of C string in @buf 254 static ssize_t write_unlock_ip(struct file *file, char *buf, size_t size) write_unlock_ip() argument 266 if (buf[size-1] != '\n') write_unlock_ip() 269 fo_path = buf; write_unlock_ip() 270 if (qword_get(&buf, fo_path, size) < 0) write_unlock_ip() 285 * buf: '\n'-terminated C string containing the 287 * size: length of C string in @buf 293 static ssize_t write_unlock_fs(struct file *file, char *buf, size_t size) write_unlock_fs() argument 303 if (buf[size-1] != '\n') write_unlock_fs() 306 fo_path = buf; write_unlock_fs() 307 if (qword_get(&buf, fo_path, size) < 0) write_unlock_fs() 337 * buf: 341 * @buf 342 * size: length of C string in @buf 350 static ssize_t write_filehandle(struct file *file, char *buf, size_t size) write_filehandle() argument 354 char *mesg = buf; write_filehandle() 362 if (buf[size-1] != '\n') write_filehandle() 364 buf[size-1] = 0; write_filehandle() 387 /* we have all the words, they are in buf.. */ write_filehandle() 397 mesg = buf; write_filehandle() 401 return mesg - buf; write_filehandle() 408 * buf: ignored 420 * buf: C string containing an unsigned 423 * size: non-zero length of C string in @buf 432 static ssize_t write_threads(struct file *file, char *buf, size_t size) write_threads() argument 434 char *mesg = buf; write_threads() 451 return scnprintf(buf, SIMPLE_TRANSACTION_LIMIT, "%d\n", rv); write_threads() 458 * buf: ignored 464 * buf: C string containing whitespace- 468 * size: non-zero length of C string in @buf 476 static ssize_t write_pool_threads(struct file *file, char *buf, size_t size) write_pool_threads() argument 481 char *mesg = buf; write_pool_threads() 498 strcpy(buf, "0\n"); write_pool_threads() 499 return strlen(buf); write_pool_threads() 527 mesg = buf; write_pool_threads() 535 rv = mesg - buf; write_pool_threads() 542 static ssize_t __write_versions(struct file *file, char *buf, size_t size) __write_versions() argument 544 char *mesg = buf; __write_versions() 559 if (buf[size-1] != '\n') __write_versions() 561 buf[size-1] = 0; __write_versions() 607 len = snprintf(buf, remaining, "%s%c%d", sep, __write_versions() 615 buf += len; __write_versions() 621 len = snprintf(buf, remaining, " %c4.%u", __write_versions() 630 buf += len; __write_versions() 634 len = snprintf(buf, remaining, "\n"); __write_versions() 644 * buf: ignored 657 * buf: C string containing whitespace- 662 * size: non-zero length of C string in @buf 672 static ssize_t write_versions(struct file *file, char *buf, size_t size) write_versions() argument 677 rv = __write_versions(file, buf, size); write_versions() 686 static ssize_t __write_ports_names(char *buf, struct net *net) __write_ports_names() argument 692 return svc_xprt_names(nn->nfsd_serv, buf, SIMPLE_TRANSACTION_LIMIT); __write_ports_names() 700 static ssize_t __write_ports_addfd(char *buf, struct net *net) __write_ports_addfd() argument 702 char *mesg = buf; __write_ports_addfd() 719 err = svc_addsock(nn->nfsd_serv, fd, buf, SIMPLE_TRANSACTION_LIMIT); __write_ports_addfd() 734 static ssize_t __write_ports_addxprt(char *buf, struct net *net) __write_ports_addxprt() argument 741 if (sscanf(buf, "%15s %5u", transport, &port) != 2) __write_ports_addxprt() 775 static ssize_t __write_ports(struct file *file, char *buf, size_t size, __write_ports() argument 779 return __write_ports_names(buf, net); __write_ports() 781 if (isdigit(buf[0])) __write_ports() 782 return __write_ports_addfd(buf, net); __write_ports() 784 if (isalpha(buf[0])) __write_ports() 785 return __write_ports_addxprt(buf, net); __write_ports() 794 * buf: ignored 806 * buf: C string containing an unsigned 812 * size: non-zero length of C string in @buf 824 * buf: C string containing a transport 828 * size: non-zero length of C string in @buf 833 static ssize_t write_ports(struct file *file, char *buf, size_t size) write_ports() argument 838 rv = __write_ports(file, buf, size, netns(file)); write_ports() 850 * buf: ignored 856 * buf: C string containing an unsigned 859 * size: non-zero length of C string in @buf 867 static ssize_t write_maxblksize(struct file *file, char *buf, size_t size) write_maxblksize() argument 869 char *mesg = buf; write_maxblksize() 892 return scnprintf(buf, SIMPLE_TRANSACTION_LIMIT, "%d\n", write_maxblksize() 900 * buf: ignored 905 * buf: C string containing an unsigned 908 * size: non-zero length of C string in @buf 916 static ssize_t write_maxconn(struct file *file, char *buf, size_t size) write_maxconn() argument 918 char *mesg = buf; write_maxconn() 930 return scnprintf(buf, SIMPLE_TRANSACTION_LIMIT, "%u\n", maxconn); write_maxconn() 934 static ssize_t __nfsd4_write_time(struct file *file, char *buf, size_t size, __nfsd4_write_time() argument 937 char *mesg = buf; __nfsd4_write_time() 963 return scnprintf(buf, SIMPLE_TRANSACTION_LIMIT, "%ld\n", *time); __nfsd4_write_time() 966 static ssize_t nfsd4_write_time(struct file *file, char *buf, size_t size, nfsd4_write_time() argument 972 rv = __nfsd4_write_time(file, buf, size, time, nn); nfsd4_write_time() 981 * buf: ignored 987 * buf: C string containing an unsigned 990 * size: non-zero length of C string in @buf 998 static ssize_t write_leasetime(struct file *file, char *buf, size_t size) write_leasetime() argument 1001 return nfsd4_write_time(file, buf, size, &nn->nfsd4_lease, nn); write_leasetime() 1014 static ssize_t write_gracetime(struct file *file, char *buf, size_t size) write_gracetime() argument 1017 return nfsd4_write_time(file, buf, size, &nn->nfsd4_grace, nn); write_gracetime() 1020 static ssize_t __write_recoverydir(struct file *file, char *buf, size_t size, __write_recoverydir() argument 1023 char *mesg = buf; __write_recoverydir() 1030 if (size > PATH_MAX || buf[size-1] != '\n') __write_recoverydir() 1032 buf[size-1] = 0; __write_recoverydir() 1044 return scnprintf(buf, SIMPLE_TRANSACTION_LIMIT, "%s\n", __write_recoverydir() 1052 * buf: ignored 1058 * buf: C string containing the pathname 1062 * size: non-zero length of C string in @buf 1069 static ssize_t write_recoverydir(struct file *file, char *buf, size_t size) write_recoverydir() argument 1075 rv = __write_recoverydir(file, buf, size, nn); write_recoverydir() 1084 * buf: ignored 1089 * buf: any value 1090 * size: non-zero length of C string in @buf 1100 static ssize_t write_v4_end_grace(struct file *file, char *buf, size_t size) write_v4_end_grace() argument 1105 switch(buf[0]) { write_v4_end_grace() 1116 return scnprintf(buf, SIMPLE_TRANSACTION_LIMIT, "%c\n", write_v4_end_grace()
|
/linux-4.4.14/drivers/misc/mic/cosm/ |
H A D | cosm_sysfs.c | 67 family_show(struct device *dev, struct device_attribute *attr, char *buf) family_show() argument 74 return cdev->hw_ops->family(cdev, buf); family_show() 79 stepping_show(struct device *dev, struct device_attribute *attr, char *buf) stepping_show() argument 86 return cdev->hw_ops->stepping(cdev, buf); stepping_show() 91 state_show(struct device *dev, struct device_attribute *attr, char *buf) state_show() argument 98 return scnprintf(buf, PAGE_SIZE, "%s\n", state_show() 104 const char *buf, size_t count) state_store() 112 if (sysfs_streq(buf, "boot")) { state_store() 116 if (sysfs_streq(buf, "reset")) { state_store() 121 if (sysfs_streq(buf, "shutdown")) { state_store() 134 struct device_attribute *attr, char *buf) shutdown_status_show() 141 return scnprintf(buf, PAGE_SIZE, "%s\n", shutdown_status_show() 148 struct device_attribute *attr, char *buf) heartbeat_enable_show() 155 return scnprintf(buf, PAGE_SIZE, "%d\n", cdev->sysfs_heartbeat_enable); heartbeat_enable_show() 161 const char *buf, size_t count) heartbeat_enable_store() 171 ret = kstrtoint(buf, 10, &enable); heartbeat_enable_store() 187 cmdline_show(struct device *dev, struct device_attribute *attr, char *buf) cmdline_show() argument 198 return scnprintf(buf, PAGE_SIZE, "%s\n", cmdline); cmdline_show() 204 const char *buf, size_t count) cmdline_store() 220 strncpy(cdev->cmdline, buf, count); cmdline_store() 233 firmware_show(struct device *dev, struct device_attribute *attr, char *buf) firmware_show() argument 244 return scnprintf(buf, PAGE_SIZE, "%s\n", firmware); firmware_show() 250 const char *buf, size_t count) firmware_store() 265 strncpy(cdev->firmware, buf, count); firmware_store() 278 ramdisk_show(struct device *dev, struct device_attribute *attr, char *buf) ramdisk_show() argument 289 return scnprintf(buf, PAGE_SIZE, "%s\n", ramdisk); ramdisk_show() 295 const char *buf, size_t count) ramdisk_store() 311 strncpy(cdev->ramdisk, buf, count); ramdisk_store() 324 bootmode_show(struct device *dev, struct device_attribute *attr, char *buf) bootmode_show() argument 335 return scnprintf(buf, PAGE_SIZE, "%s\n", bootmode); bootmode_show() 341 const char *buf, size_t count) bootmode_store() 348 if (!sysfs_streq(buf, "linux") && !sysfs_streq(buf, "flash")) bootmode_store() 360 strncpy(cdev->bootmode, buf, count); bootmode_store() 374 char *buf) log_buf_addr_show() 381 return scnprintf(buf, PAGE_SIZE, "%p\n", cdev->log_buf_addr); log_buf_addr_show() 386 const char *buf, size_t count) log_buf_addr_store() 395 ret = kstrtoul(buf, 16, &addr); log_buf_addr_store() 408 char *buf) log_buf_len_show() 415 return scnprintf(buf, PAGE_SIZE, "%p\n", cdev->log_buf_len); log_buf_len_show() 420 const char *buf, size_t count) log_buf_len_store() 429 ret = kstrtoul(buf, 16, &addr); log_buf_len_store() 103 state_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) state_store() argument 133 shutdown_status_show(struct device *dev, struct device_attribute *attr, char *buf) shutdown_status_show() argument 147 heartbeat_enable_show(struct device *dev, struct device_attribute *attr, char *buf) heartbeat_enable_show() argument 159 heartbeat_enable_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) heartbeat_enable_store() argument 203 cmdline_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) cmdline_store() argument 249 firmware_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) firmware_store() argument 294 ramdisk_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) ramdisk_store() argument 340 bootmode_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) bootmode_store() argument 373 log_buf_addr_show(struct device *dev, struct device_attribute *attr, char *buf) log_buf_addr_show() argument 385 log_buf_addr_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) log_buf_addr_store() argument 407 log_buf_len_show(struct device *dev, struct device_attribute *attr, char *buf) log_buf_len_show() argument 419 log_buf_len_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) log_buf_len_store() argument
|
/linux-4.4.14/drivers/net/ethernet/mellanox/mlxsw/ |
H A D | item.h | 75 static inline u16 __mlxsw_item_get16(char *buf, struct mlxsw_item *item, __mlxsw_item_get16() argument 79 __be16 *b = (__be16 *) buf; __mlxsw_item_get16() 90 static inline void __mlxsw_item_set16(char *buf, struct mlxsw_item *item, __mlxsw_item_set16() argument 95 __be16 *b = (__be16 *) buf; __mlxsw_item_set16() 108 static inline u32 __mlxsw_item_get32(char *buf, struct mlxsw_item *item, __mlxsw_item_get32() argument 112 __be32 *b = (__be32 *) buf; __mlxsw_item_get32() 123 static inline void __mlxsw_item_set32(char *buf, struct mlxsw_item *item, __mlxsw_item_set32() argument 128 __be32 *b = (__be32 *) buf; __mlxsw_item_set32() 141 static inline u64 __mlxsw_item_get64(char *buf, struct mlxsw_item *item, __mlxsw_item_get64() argument 145 __be64 *b = (__be64 *) buf; __mlxsw_item_get64() 156 static inline void __mlxsw_item_set64(char *buf, struct mlxsw_item *item, __mlxsw_item_set64() argument 160 __be64 *b = (__be64 *) buf; __mlxsw_item_set64() 173 static inline void __mlxsw_item_memcpy_from(char *buf, char *dst, __mlxsw_item_memcpy_from() argument 179 memcpy(dst, &buf[offset], item->size.bytes); __mlxsw_item_memcpy_from() 182 static inline void __mlxsw_item_memcpy_to(char *buf, const char *src, __mlxsw_item_memcpy_to() argument 188 memcpy(&buf[offset], src, item->size.bytes); __mlxsw_item_memcpy_to() 215 static inline u8 __mlxsw_item_bit_array_get(char *buf, struct mlxsw_item *item, __mlxsw_item_bit_array_get() argument 221 tmp = buf[offset]; __mlxsw_item_bit_array_get() 227 static inline void __mlxsw_item_bit_array_set(char *buf, struct mlxsw_item *item, __mlxsw_item_bit_array_set() argument 236 tmp = buf[offset]; __mlxsw_item_bit_array_set() 239 buf[offset] = tmp; __mlxsw_item_bit_array_set() 257 static inline u16 mlxsw_##_type##_##_cname##_##_iname##_get(char *buf) \ 259 return __mlxsw_item_get16(buf, &__ITEM_NAME(_type, _cname, _iname), 0); \ 261 static inline void mlxsw_##_type##_##_cname##_##_iname##_set(char *buf, u16 val)\ 263 __mlxsw_item_set16(buf, &__ITEM_NAME(_type, _cname, _iname), 0, val); \ 278 mlxsw_##_type##_##_cname##_##_iname##_get(char *buf, unsigned short index) \ 280 return __mlxsw_item_get16(buf, &__ITEM_NAME(_type, _cname, _iname), \ 284 mlxsw_##_type##_##_cname##_##_iname##_set(char *buf, unsigned short index, \ 287 __mlxsw_item_set16(buf, &__ITEM_NAME(_type, _cname, _iname), \ 298 static inline u32 mlxsw_##_type##_##_cname##_##_iname##_get(char *buf) \ 300 return __mlxsw_item_get32(buf, &__ITEM_NAME(_type, _cname, _iname), 0); \ 302 static inline void mlxsw_##_type##_##_cname##_##_iname##_set(char *buf, u32 val)\ 304 __mlxsw_item_set32(buf, &__ITEM_NAME(_type, _cname, _iname), 0, val); \ 319 mlxsw_##_type##_##_cname##_##_iname##_get(char *buf, unsigned short index) \ 321 return __mlxsw_item_get32(buf, &__ITEM_NAME(_type, _cname, _iname), \ 325 mlxsw_##_type##_##_cname##_##_iname##_set(char *buf, unsigned short index, \ 328 __mlxsw_item_set32(buf, &__ITEM_NAME(_type, _cname, _iname), \ 339 static inline u64 mlxsw_##_type##_##_cname##_##_iname##_get(char *buf) \ 341 return __mlxsw_item_get64(buf, &__ITEM_NAME(_type, _cname, _iname), 0); \ 343 static inline void mlxsw_##_type##_##_cname##_##_iname##_set(char *buf, u64 val)\ 345 __mlxsw_item_set64(buf, &__ITEM_NAME(_type, _cname, _iname), 0, val); \ 360 mlxsw_##_type##_##_cname##_##_iname##_get(char *buf, unsigned short index) \ 362 return __mlxsw_item_get64(buf, &__ITEM_NAME(_type, _cname, _iname), \ 366 mlxsw_##_type##_##_cname##_##_iname##_set(char *buf, unsigned short index, \ 369 __mlxsw_item_set64(buf, &__ITEM_NAME(_type, _cname, _iname), \ 380 mlxsw_##_type##_##_cname##_##_iname##_memcpy_from(char *buf, char *dst) \ 382 __mlxsw_item_memcpy_from(buf, dst, \ 386 mlxsw_##_type##_##_cname##_##_iname##_memcpy_to(char *buf, const char *src) \ 388 __mlxsw_item_memcpy_to(buf, src, \ 402 mlxsw_##_type##_##_cname##_##_iname##_memcpy_from(char *buf, \ 406 __mlxsw_item_memcpy_from(buf, dst, \ 410 mlxsw_##_type##_##_cname##_##_iname##_memcpy_to(char *buf, \ 414 __mlxsw_item_memcpy_to(buf, src, \ 427 mlxsw_##_type##_##_cname##_##_iname##_get(char *buf, u16 index) \ 429 return __mlxsw_item_bit_array_get(buf, \ 434 mlxsw_##_type##_##_cname##_##_iname##_set(char *buf, u16 index, u8 val) \ 436 return __mlxsw_item_bit_array_set(buf, \
|
/linux-4.4.14/drivers/scsi/snic/ |
H A D | snic_attrs.c | 26 char *buf) snic_show_sym_name() 30 return snprintf(buf, PAGE_SIZE, "%s\n", snic->name); snic_show_sym_name() 36 char *buf) snic_show_state() 40 return snprintf(buf, PAGE_SIZE, "%s\n", snic_show_state() 47 char *buf) snic_show_drv_version() 49 return snprintf(buf, PAGE_SIZE, "%s\n", SNIC_DRV_VERSION); snic_show_drv_version() 55 char *buf) snic_show_link_state() 62 return snprintf(buf, PAGE_SIZE, "%s\n", snic_show_link_state() 24 snic_show_sym_name(struct device *dev, struct device_attribute *attr, char *buf) snic_show_sym_name() argument 34 snic_show_state(struct device *dev, struct device_attribute *attr, char *buf) snic_show_state() argument 45 snic_show_drv_version(struct device *dev, struct device_attribute *attr, char *buf) snic_show_drv_version() argument 53 snic_show_link_state(struct device *dev, struct device_attribute *attr, char *buf) snic_show_link_state() argument
|
/linux-4.4.14/arch/um/drivers/ |
H A D | slip.h | 17 extern int slip_user_read(int fd, void *buf, int len, struct slip_data *pri); 18 extern int slip_user_write(int fd, void *buf, int len, struct slip_data *pri);
|