/drivers/scsi/ |
D | scsicam.c | 25 static int setsize(unsigned long capacity, unsigned int *cyls, unsigned int *hds, 68 int scsicam_bios_param(struct block_device *bdev, sector_t capacity, int *ip) in scsicam_bios_param() argument 71 u64 capacity64 = capacity; /* Suppress gcc warning */ in scsicam_bios_param() 79 ret = scsi_partsize(p, (unsigned long)capacity, (unsigned int *)ip + 2, in scsicam_bios_param() 87 ret = setsize((unsigned long)capacity, (unsigned int *)ip + 2, in scsicam_bios_param() 94 if ((capacity >> 11) > 65534) { in scsicam_bios_param() 102 if (capacity > 65535*63*255) in scsicam_bios_param() 105 ip[2] = (unsigned long)capacity / (ip[0] * ip[1]); in scsicam_bios_param() 126 int scsi_partsize(unsigned char *buf, unsigned long capacity, in scsi_partsize() argument 185 *cyls = capacity / ((end_head + 1) * end_sector); in scsi_partsize() [all …]
|
D | sd_zbc.c | 411 if (lba + 1 == sdkp->capacity) in sd_zbc_check_capacity() 417 (unsigned long long)sdkp->capacity, in sd_zbc_check_capacity() 419 sdkp->capacity = lba + 1; in sd_zbc_check_capacity() 486 (block + this_zone_blocks < sdkp->capacity in sd_zbc_check_zone_size() 495 if (block < sdkp->capacity) { in sd_zbc_check_zone_size() 502 } while (block < sdkp->capacity); in sd_zbc_check_zone_size() 541 nr_zones = round_up(sdkp->capacity, zone_blocks) >> zone_shift; in sd_zbc_setup() 632 sdkp->capacity = 0; in sd_zbc_read_zones() 646 if (!sd_is_zoned(sdkp) || !sdkp->capacity) in sd_zbc_print_zones() 649 if (sdkp->capacity & (sdkp->zone_blocks - 1)) in sd_zbc_print_zones()
|
D | sr.c | 370 cd->capacity - error_sector < 4 * 75) in sr_done() 726 cd->capacity = 0x1fffff; in sr_probe() 736 cd->cdi.capacity = 1; in sr_probe() 745 set_capacity(disk, cd->capacity); in sr_probe() 803 cd->capacity = 0x1fffff; in get_sectorsize() 808 cd->capacity = 1 + ((buffer[0] << 24) | (buffer[1] << 16) | in get_sectorsize() 818 cd->capacity = max_t(long, cd->capacity, last_written); in get_sectorsize() 835 cd->capacity *= 4; in get_sectorsize() 842 cd->capacity = 0; in get_sectorsize() 851 set_capacity(cd->disk, cd->capacity); in get_sectorsize() [all …]
|
D | sd.c | 1431 sector_t capacity = logical_to_sectors(sdp, sdkp->capacity); in sd_getgeo() local 1437 diskinfo[2] = capacity >> 11; in sd_getgeo() 1441 host->hostt->bios_param(sdp, bdev, capacity, diskinfo); in sd_getgeo() 1443 scsicam_bios_param(bdev, capacity, diskinfo); in sd_getgeo() 1523 sdkp->capacity = 0; in set_media_not_present() 2279 sdkp->capacity = 0; /* unknown mapped to zero - as usual */ in read_capacity_error() 2366 sdkp->capacity = 0; in read_capacity_16() 2374 sdkp->capacity = 0; in read_capacity_16() 2400 sdkp->capacity = lba + 1; in read_capacity_16() 2454 sdkp->capacity = 0; in read_capacity_10() [all …]
|
/drivers/misc/vmw_vmci/ |
D | vmci_handle_array.c | 19 static size_t handle_arr_calc_size(u32 capacity) in handle_arr_calc_size() argument 22 capacity * sizeof(struct vmci_handle); in handle_arr_calc_size() 25 struct vmci_handle_arr *vmci_handle_arr_create(u32 capacity, u32 max_capacity) in vmci_handle_arr_create() argument 29 if (max_capacity == 0 || capacity > max_capacity) in vmci_handle_arr_create() 32 if (capacity == 0) in vmci_handle_arr_create() 33 capacity = min((u32)VMCI_HANDLE_ARRAY_DEFAULT_CAPACITY, in vmci_handle_arr_create() 36 array = kmalloc(handle_arr_calc_size(capacity), GFP_ATOMIC); in vmci_handle_arr_create() 40 array->capacity = capacity; in vmci_handle_arr_create() 57 if (unlikely(array->size >= array->capacity)) { in vmci_handle_arr_append_entry() 60 u32 capacity_bump = min(array->max_capacity - array->capacity, in vmci_handle_arr_append_entry() [all …]
|
D | vmci_handle_array.h | 24 u32 capacity; member 40 struct vmci_handle_arr *vmci_handle_arr_create(u32 capacity, u32 max_capacity);
|
/drivers/base/ |
D | arch_topology.c | 67 void topology_set_cpu_scale(unsigned int cpu, unsigned long capacity) in topology_set_cpu_scale() argument 69 per_cpu(cpu_scale, cpu) = capacity; in topology_set_cpu_scale() 231 unsigned long max_capacity, capacity; in topology_detect_flags() local 242 capacity = topology_get_cpu_scale(NULL, thread); in topology_detect_flags() 244 if (capacity > max_capacity) { in topology_detect_flags() 248 max_capacity = capacity; in topology_detect_flags() 257 capacity = topology_get_cpu_scale(NULL, core); in topology_detect_flags() 259 if (capacity > max_capacity) { in topology_detect_flags() 263 max_capacity = capacity; in topology_detect_flags() 268 capacity = topology_get_cpu_scale(NULL, die_cpu); in topology_detect_flags() [all …]
|
/drivers/power/supply/ |
D | ds2782_battery.c | 53 int (*get_battery_capacity)(struct ds278x_info *info, int *capacity); 66 int capacity; member 165 static int ds2782_get_capacity(struct ds278x_info *info, int *capacity) in ds2782_get_capacity() argument 173 *capacity = raw; in ds2782_get_capacity() 205 static int ds2786_get_capacity(struct ds278x_info *info, int *capacity) in ds2786_get_capacity() argument 214 *capacity = raw/2 ; in ds2786_get_capacity() 222 int capacity; in ds278x_get_status() local 228 err = info->ops->get_battery_capacity(info, &capacity); in ds278x_get_status() 232 info->capacity = capacity; in ds278x_get_status() 234 if (capacity == 100) in ds278x_get_status() [all …]
|
D | rx51_battery.c | 147 int capacity = rx51_battery_read_adc(di->channel_bsi); in rx51_battery_read_capacity() local 149 if (capacity < 0) { in rx51_battery_read_capacity() 150 dev_err(di->dev, "Could not read ADC: %d\n", capacity); in rx51_battery_read_capacity() 151 return capacity; in rx51_battery_read_capacity() 154 return 1280 * (1200 * capacity)/(1024 - capacity); in rx51_battery_read_capacity()
|
D | da9052-battery.c | 357 static int da9052_bat_read_capacity(struct da9052_battery *bat, int *capacity) in da9052_bat_read_capacity() argument 381 *capacity = 100; in da9052_bat_read_capacity() 385 *capacity = 0; in da9052_bat_read_capacity() 404 *capacity = da9052_bat_interpolate(vbat_lower, vbat_upper, level_lower, in da9052_bat_read_capacity() 414 int capacity; in da9052_bat_check_health() local 426 ret = da9052_bat_read_capacity(bat, &capacity); in da9052_bat_check_health() 429 if (capacity < DA9052_BAT_LOW_CAP) in da9052_bat_check_health()
|
/drivers/staging/fwserial/ |
D | dma_fifo.c | 70 int capacity; in dma_fifo_alloc() local 76 capacity = size + align * open_limit + align * DMA_FIFO_GUARD; in dma_fifo_alloc() 77 fifo->data = kmalloc(capacity, gfp_mask); in dma_fifo_alloc() 91 fifo->capacity = capacity; in dma_fifo_alloc() 162 ofs = fifo->in % fifo->capacity; in dma_fifo_in() 163 l = min(n, fifo->capacity - ofs); in dma_fifo_in() 211 ofs = fifo->out % fifo->capacity; in dma_fifo_out_pend() 212 l = fifo->capacity - ofs; in dma_fifo_out_pend()
|
/drivers/ide/ |
D | ide-disk.c | 300 u64 capacity, set_max; in ide_disk_hpa_get_native_capacity() local 302 capacity = drive->capacity64; in ide_disk_hpa_get_native_capacity() 310 if (set_max == capacity + 1) in ide_disk_hpa_get_native_capacity() 328 u64 capacity, set_max; in idedisk_check_hpa() local 331 capacity = drive->capacity64; in idedisk_check_hpa() 334 if (set_max <= capacity) in idedisk_check_hpa() 343 capacity, sectors_to_MB(capacity), in idedisk_check_hpa() 529 unsigned long long capacity; in update_flush() local 539 capacity = ide_gd_capacity(drive); in update_flush() 543 capacity <= (1ULL << 28) || in update_flush() [all …]
|
D | ide-floppy.c | 321 int capacity, lba_capacity; in ide_floppy_get_flexible_disk_page() local 348 capacity = cyls * heads * sectors * sector_size; in ide_floppy_get_flexible_disk_page() 353 drive->name, capacity / 1024, cyls, heads, in ide_floppy_get_flexible_disk_page() 362 if (capacity < lba_capacity) { in ide_floppy_get_flexible_disk_page() 365 drive->name, lba_capacity, capacity); in ide_floppy_get_flexible_disk_page() 367 capacity / floppy->block_size : 0; in ide_floppy_get_flexible_disk_page()
|
D | ide-cd.c | 892 static int cdrom_read_capacity(ide_drive_t *drive, unsigned long *capacity, in cdrom_read_capacity() argument 937 *capacity = 1 + be32_to_cpu(capbuf.lba); in cdrom_read_capacity() 941 *capacity, *sectors_per_frame); in cdrom_read_capacity() 1005 stat = cdrom_read_capacity(drive, &toc->capacity, §ors_per_frame, in ide_cd_read_toc() 1008 toc->capacity = 0x1fffff; in ide_cd_read_toc() 1010 set_capacity(info->disk, toc->capacity * sectors_per_frame); in ide_cd_read_toc() 1012 drive->probed_capacity = toc->capacity * sectors_per_frame; in ide_cd_read_toc() 1125 if (!stat && (last_written > toc->capacity)) { in ide_cd_read_toc() 1126 toc->capacity = last_written; in ide_cd_read_toc() 1127 set_capacity(info->disk, toc->capacity * sectors_per_frame); in ide_cd_read_toc() [all …]
|
/drivers/usb/storage/ |
D | sddr55.c | 99 unsigned long capacity; /* Size of card in bytes */ member 661 if (!info->capacity) in sddr55_read_map() 664 numblocks = info->capacity >> (info->blockshift + info->pageshift); in sddr55_read_map() 799 unsigned long capacity; in sddr55_transport() local 873 capacity = sddr55_get_capacity(us); in sddr55_transport() 875 if (!capacity) { in sddr55_transport() 880 info->capacity = capacity; in sddr55_transport() 886 info->max_log_blks = ((info->capacity >> (info->pageshift + info->blockshift)) / 256) * 250; in sddr55_transport() 892 capacity = (capacity / 256) * 250; in sddr55_transport() 894 capacity /= PAGESIZE; in sddr55_transport() [all …]
|
D | alauda.c | 98 unsigned long capacity; /* total media size in bytes */ member 300 unsigned int num_zones = media_info->capacity >> shift; in alauda_free_maps() 434 MEDIA_INFO(us).capacity = 1 << media_info->chipshift; in alauda_init_media() 436 MEDIA_INFO(us).capacity >> 20); in alauda_init_media() 449 num_zones = MEDIA_INFO(us).capacity >> (MEDIA_INFO(us).zoneshift in alauda_init_media() 948 max_lba = MEDIA_INFO(us).capacity >> (blockshift + pageshift); in alauda_read_data() 1050 max_lba = MEDIA_INFO(us).capacity >> (pageshift + blockshift); in alauda_write_data() 1155 unsigned long capacity; in alauda_transport() local 1161 num_zones = MEDIA_INFO(us).capacity >> (MEDIA_INFO(us).zoneshift in alauda_transport() 1164 capacity = num_zones * MEDIA_INFO(us).uzonesize in alauda_transport() [all …]
|
/drivers/net/wireless/st/cw1200/ |
D | queue.c | 120 if (queue->num_queued <= (queue->capacity >> 1)) { in __cw1200_queue_gc() 168 size_t capacity, in cw1200_queue_init() argument 175 queue->capacity = capacity; in cw1200_queue_init() 184 queue->pool = kzalloc(sizeof(struct cw1200_queue_item) * capacity, in cw1200_queue_init() 197 for (i = 0; i < capacity; ++i) in cw1200_queue_init() 254 queue->capacity = 0; in cw1200_queue_deinit() 321 (queue->capacity - (num_present_cpus() - 1))) { in cw1200_queue_put() 390 } else if (item_id >= (unsigned) queue->capacity) { in cw1200_queue_requeue() 461 } else if (item_id >= (unsigned) queue->capacity) { in cw1200_queue_remove() 481 (queue->num_queued <= (queue->capacity >> 1))) { in cw1200_queue_remove() [all …]
|
/drivers/net/wireless/intel/iwlwifi/dvm/ |
D | main.c | 419 u32 capacity, u32 mode) in iwl_print_cont_event_trace() argument 444 if (WARN_ON(num_events > capacity - start_idx)) in iwl_print_cont_event_trace() 445 num_events = capacity - start_idx; in iwl_print_cont_event_trace() 469 u32 capacity; /* event log capacity in # entries */ in iwl_continuous_event_trace() local 471 u32 capacity; in iwl_continuous_event_trace() member 485 capacity = read.capacity; in iwl_continuous_event_trace() 497 if (unlikely(next_entry == capacity)) in iwl_continuous_event_trace() 515 capacity, mode); in iwl_continuous_event_trace() 531 capacity - priv->event_log.next_entry, in iwl_continuous_event_trace() 532 capacity, mode); in iwl_continuous_event_trace() [all …]
|
/drivers/hid/ |
D | hid-logitech-hidpp.c | 126 int capacity; member 556 hidpp->battery.capacity = response.rap.params[0]; in hidpp10_query_battery_mileage() 569 int status, capacity, level; in hidpp10_battery_event() local 577 capacity = hidpp->battery.capacity; in hidpp10_battery_event() 582 capacity = report->rap.params[0]; in hidpp10_battery_event() 590 changed = capacity != hidpp->battery.capacity || in hidpp10_battery_event() 909 static int hidpp_map_battery_level(int capacity) in hidpp_map_battery_level() argument 911 if (capacity < 11) in hidpp_map_battery_level() 917 else if (capacity < 30) in hidpp_map_battery_level() 919 else if (capacity < 81) in hidpp_map_battery_level() [all …]
|
/drivers/uwb/ |
D | ie.c | 203 int capacity; in uwb_rc_ie_setup() local 205 capacity = uwb_rc_get_ie(uwb_rc, &ie_info); in uwb_rc_ie_setup() 206 if (capacity < 0) in uwb_rc_ie_setup() 207 return capacity; in uwb_rc_ie_setup() 214 uwb_rc->ies_capacity = capacity; in uwb_rc_ie_setup()
|
/drivers/scsi/aic7xxx/ |
D | aiclib.h | 137 aic_sector_div(sector_t capacity, int heads, int sectors) in aic_sector_div() argument 140 sector_div(capacity, (heads * sectors)); in aic_sector_div() 141 return (int)capacity; in aic_sector_div()
|
/drivers/block/paride/ |
D | pd.c | 227 int capacity; /* Size of this volume in sectors */ member 696 disk->capacity = le32_to_cpu(*(__le32 *) (pd_scratch + 120)); in pd_identify() 698 disk->capacity = disk->sectors * disk->heads * disk->cylinders; in pd_identify() 713 disk->capacity, disk->capacity / 2048, in pd_identify() 717 if (disk->capacity) in pd_identify() 777 geo->cylinders = disk->capacity / (geo->heads * geo->sectors); in pd_getgeo() 830 set_capacity(p, disk->capacity); in pd_revalidate() 889 disk->capacity = 0; in pd_detect() 929 set_capacity(disk->gd, disk->capacity); in pd_detect()
|
/drivers/net/ethernet/qlogic/qed/ |
D | qed_spq.c | 501 u32 i, capacity; in qed_spq_setup() local 513 capacity = qed_chain_get_capacity(&p_spq->chain); in qed_spq_setup() 514 for (i = 0; i < capacity; i++) { in qed_spq_setup() 545 u32 capacity; in qed_spq_alloc() local 563 capacity = qed_chain_get_capacity(&p_spq->chain); in qed_spq_alloc() 565 capacity * sizeof(struct qed_spq_entry), in qed_spq_alloc() 585 u32 capacity; in qed_spq_free() local 591 capacity = qed_chain_get_capacity(&p_spq->chain); in qed_spq_free() 593 capacity * in qed_spq_free()
|
/drivers/firewire/ |
D | nosy.c | 73 size_t capacity; member 128 packet_buffer_init(struct packet_buffer *buffer, size_t capacity) in packet_buffer_init() argument 130 buffer->data = kmalloc(capacity, GFP_KERNEL); in packet_buffer_init() 135 buffer->capacity = capacity; in packet_buffer_init() 166 end = buffer->data + buffer->capacity; in packet_buffer_get() 200 if (buffer->capacity < in packet_buffer_put() 206 end = buffer->data + buffer->capacity; in packet_buffer_put()
|
/drivers/block/ |
D | virtio_blk.c | 387 u64 capacity; in virtblk_config_changed_work() local 390 virtio_cread(vdev, struct virtio_blk_config, capacity, &capacity); in virtblk_config_changed_work() 393 if ((sector_t)capacity != capacity) { in virtblk_config_changed_work() 395 (unsigned long long)capacity); in virtblk_config_changed_work() 396 capacity = (sector_t)-1; in virtblk_config_changed_work() 399 nblocks = DIV_ROUND_UP_ULL(capacity, queue_logical_block_size(q) >> 9); in virtblk_config_changed_work() 413 set_capacity(vblk->disk, capacity); in virtblk_config_changed_work() 727 virtio_cread(vdev, struct virtio_blk_config, capacity, &cap); in virtblk_probe()
|