kcs 123 drivers/char/ipmi/ipmi_kcs_sm.c static unsigned int init_kcs_data(struct si_sm_data *kcs, kcs 126 drivers/char/ipmi/ipmi_kcs_sm.c kcs->state = KCS_IDLE; kcs 127 drivers/char/ipmi/ipmi_kcs_sm.c kcs->io = io; kcs 128 drivers/char/ipmi/ipmi_kcs_sm.c kcs->write_pos = 0; kcs 129 drivers/char/ipmi/ipmi_kcs_sm.c kcs->write_count = 0; kcs 130 drivers/char/ipmi/ipmi_kcs_sm.c kcs->orig_write_count = 0; kcs 131 drivers/char/ipmi/ipmi_kcs_sm.c kcs->read_pos = 0; kcs 132 drivers/char/ipmi/ipmi_kcs_sm.c kcs->error_retries = 0; kcs 133 drivers/char/ipmi/ipmi_kcs_sm.c kcs->truncated = 0; kcs 134 drivers/char/ipmi/ipmi_kcs_sm.c kcs->ibf_timeout = IBF_RETRY_TIMEOUT; kcs 135 drivers/char/ipmi/ipmi_kcs_sm.c kcs->obf_timeout = OBF_RETRY_TIMEOUT; kcs 141 drivers/char/ipmi/ipmi_kcs_sm.c static inline unsigned char read_status(struct si_sm_data *kcs) kcs 143 drivers/char/ipmi/ipmi_kcs_sm.c return kcs->io->inputb(kcs->io, 1); kcs 146 drivers/char/ipmi/ipmi_kcs_sm.c static inline unsigned char read_data(struct si_sm_data *kcs) kcs 148 drivers/char/ipmi/ipmi_kcs_sm.c return kcs->io->inputb(kcs->io, 0); kcs 151 drivers/char/ipmi/ipmi_kcs_sm.c static inline void write_cmd(struct si_sm_data *kcs, unsigned char data) kcs 153 drivers/char/ipmi/ipmi_kcs_sm.c kcs->io->outputb(kcs->io, 1, data); kcs 156 drivers/char/ipmi/ipmi_kcs_sm.c static inline void write_data(struct si_sm_data *kcs, unsigned char data) kcs 158 drivers/char/ipmi/ipmi_kcs_sm.c kcs->io->outputb(kcs->io, 0, data); kcs 178 drivers/char/ipmi/ipmi_kcs_sm.c static inline void write_next_byte(struct si_sm_data *kcs) kcs 180 drivers/char/ipmi/ipmi_kcs_sm.c write_data(kcs, kcs->write_data[kcs->write_pos]); kcs 181 drivers/char/ipmi/ipmi_kcs_sm.c (kcs->write_pos)++; kcs 182 drivers/char/ipmi/ipmi_kcs_sm.c (kcs->write_count)--; kcs 185 drivers/char/ipmi/ipmi_kcs_sm.c static inline void start_error_recovery(struct si_sm_data *kcs, char *reason) kcs 187 drivers/char/ipmi/ipmi_kcs_sm.c (kcs->error_retries)++; kcs 188 drivers/char/ipmi/ipmi_kcs_sm.c if (kcs->error_retries > MAX_ERROR_RETRIES) { kcs 192 drivers/char/ipmi/ipmi_kcs_sm.c kcs->state = KCS_HOSED; kcs 194 drivers/char/ipmi/ipmi_kcs_sm.c kcs->error0_timeout = jiffies + ERROR0_OBF_WAIT_JIFFIES; kcs 195 drivers/char/ipmi/ipmi_kcs_sm.c kcs->state = KCS_ERROR0; kcs 199 drivers/char/ipmi/ipmi_kcs_sm.c static inline void read_next_byte(struct si_sm_data *kcs) kcs 201 drivers/char/ipmi/ipmi_kcs_sm.c if (kcs->read_pos >= MAX_KCS_READ_SIZE) { kcs 203 drivers/char/ipmi/ipmi_kcs_sm.c read_data(kcs); kcs 204 drivers/char/ipmi/ipmi_kcs_sm.c kcs->truncated = 1; kcs 206 drivers/char/ipmi/ipmi_kcs_sm.c kcs->read_data[kcs->read_pos] = read_data(kcs); kcs 207 drivers/char/ipmi/ipmi_kcs_sm.c (kcs->read_pos)++; kcs 209 drivers/char/ipmi/ipmi_kcs_sm.c write_data(kcs, KCS_READ_BYTE); kcs 212 drivers/char/ipmi/ipmi_kcs_sm.c static inline int check_ibf(struct si_sm_data *kcs, unsigned char status, kcs 216 drivers/char/ipmi/ipmi_kcs_sm.c kcs->ibf_timeout -= time; kcs 217 drivers/char/ipmi/ipmi_kcs_sm.c if (kcs->ibf_timeout < 0) { kcs 218 drivers/char/ipmi/ipmi_kcs_sm.c start_error_recovery(kcs, "IBF not ready in time"); kcs 219 drivers/char/ipmi/ipmi_kcs_sm.c kcs->ibf_timeout = IBF_RETRY_TIMEOUT; kcs 224 drivers/char/ipmi/ipmi_kcs_sm.c kcs->ibf_timeout = IBF_RETRY_TIMEOUT; kcs 228 drivers/char/ipmi/ipmi_kcs_sm.c static inline int check_obf(struct si_sm_data *kcs, unsigned char status, kcs 232 drivers/char/ipmi/ipmi_kcs_sm.c kcs->obf_timeout -= time; kcs 233 drivers/char/ipmi/ipmi_kcs_sm.c if (kcs->obf_timeout < 0) { kcs 234 drivers/char/ipmi/ipmi_kcs_sm.c kcs->obf_timeout = OBF_RETRY_TIMEOUT; kcs 235 drivers/char/ipmi/ipmi_kcs_sm.c start_error_recovery(kcs, "OBF not ready in time"); kcs 240 drivers/char/ipmi/ipmi_kcs_sm.c kcs->obf_timeout = OBF_RETRY_TIMEOUT; kcs 244 drivers/char/ipmi/ipmi_kcs_sm.c static void clear_obf(struct si_sm_data *kcs, unsigned char status) kcs 247 drivers/char/ipmi/ipmi_kcs_sm.c read_data(kcs); kcs 250 drivers/char/ipmi/ipmi_kcs_sm.c static void restart_kcs_transaction(struct si_sm_data *kcs) kcs 252 drivers/char/ipmi/ipmi_kcs_sm.c kcs->write_count = kcs->orig_write_count; kcs 253 drivers/char/ipmi/ipmi_kcs_sm.c kcs->write_pos = 0; kcs 254 drivers/char/ipmi/ipmi_kcs_sm.c kcs->read_pos = 0; kcs 255 drivers/char/ipmi/ipmi_kcs_sm.c kcs->state = KCS_WAIT_WRITE_START; kcs 256 drivers/char/ipmi/ipmi_kcs_sm.c kcs->ibf_timeout = IBF_RETRY_TIMEOUT; kcs 257 drivers/char/ipmi/ipmi_kcs_sm.c kcs->obf_timeout = OBF_RETRY_TIMEOUT; kcs 258 drivers/char/ipmi/ipmi_kcs_sm.c write_cmd(kcs, KCS_WRITE_START); kcs 261 drivers/char/ipmi/ipmi_kcs_sm.c static int start_kcs_transaction(struct si_sm_data *kcs, unsigned char *data, kcs 271 drivers/char/ipmi/ipmi_kcs_sm.c if ((kcs->state != KCS_IDLE) && (kcs->state != KCS_HOSED)) kcs 280 drivers/char/ipmi/ipmi_kcs_sm.c kcs->error_retries = 0; kcs 281 drivers/char/ipmi/ipmi_kcs_sm.c memcpy(kcs->write_data, data, size); kcs 282 drivers/char/ipmi/ipmi_kcs_sm.c kcs->write_count = size; kcs 283 drivers/char/ipmi/ipmi_kcs_sm.c kcs->orig_write_count = size; kcs 284 drivers/char/ipmi/ipmi_kcs_sm.c kcs->write_pos = 0; kcs 285 drivers/char/ipmi/ipmi_kcs_sm.c kcs->read_pos = 0; kcs 286 drivers/char/ipmi/ipmi_kcs_sm.c kcs->state = KCS_START_OP; kcs 287 drivers/char/ipmi/ipmi_kcs_sm.c kcs->ibf_timeout = IBF_RETRY_TIMEOUT; kcs 288 drivers/char/ipmi/ipmi_kcs_sm.c kcs->obf_timeout = OBF_RETRY_TIMEOUT; kcs 292 drivers/char/ipmi/ipmi_kcs_sm.c static int get_kcs_result(struct si_sm_data *kcs, unsigned char *data, kcs 295 drivers/char/ipmi/ipmi_kcs_sm.c if (length < kcs->read_pos) { kcs 296 drivers/char/ipmi/ipmi_kcs_sm.c kcs->read_pos = length; kcs 297 drivers/char/ipmi/ipmi_kcs_sm.c kcs->truncated = 1; kcs 300 drivers/char/ipmi/ipmi_kcs_sm.c memcpy(data, kcs->read_data, kcs->read_pos); kcs 302 drivers/char/ipmi/ipmi_kcs_sm.c if ((length >= 3) && (kcs->read_pos < 3)) { kcs 306 drivers/char/ipmi/ipmi_kcs_sm.c kcs->read_pos = 3; kcs 308 drivers/char/ipmi/ipmi_kcs_sm.c if (kcs->truncated) { kcs 315 drivers/char/ipmi/ipmi_kcs_sm.c kcs->truncated = 0; kcs 318 drivers/char/ipmi/ipmi_kcs_sm.c return kcs->read_pos; kcs 326 drivers/char/ipmi/ipmi_kcs_sm.c static enum si_sm_result kcs_event(struct si_sm_data *kcs, long time) kcs 331 drivers/char/ipmi/ipmi_kcs_sm.c status = read_status(kcs); kcs 334 drivers/char/ipmi/ipmi_kcs_sm.c printk(KERN_DEBUG "KCS: State = %d, %x\n", kcs->state, status); kcs 337 drivers/char/ipmi/ipmi_kcs_sm.c if (!check_ibf(kcs, status, time)) kcs 343 drivers/char/ipmi/ipmi_kcs_sm.c switch (kcs->state) { kcs 346 drivers/char/ipmi/ipmi_kcs_sm.c clear_obf(kcs, status); kcs 355 drivers/char/ipmi/ipmi_kcs_sm.c start_error_recovery(kcs, kcs 360 drivers/char/ipmi/ipmi_kcs_sm.c clear_obf(kcs, status); kcs 361 drivers/char/ipmi/ipmi_kcs_sm.c write_cmd(kcs, KCS_WRITE_START); kcs 362 drivers/char/ipmi/ipmi_kcs_sm.c kcs->state = KCS_WAIT_WRITE_START; kcs 368 drivers/char/ipmi/ipmi_kcs_sm.c kcs, kcs 372 drivers/char/ipmi/ipmi_kcs_sm.c read_data(kcs); kcs 373 drivers/char/ipmi/ipmi_kcs_sm.c if (kcs->write_count == 1) { kcs 374 drivers/char/ipmi/ipmi_kcs_sm.c write_cmd(kcs, KCS_WRITE_END); kcs 375 drivers/char/ipmi/ipmi_kcs_sm.c kcs->state = KCS_WAIT_WRITE_END; kcs 377 drivers/char/ipmi/ipmi_kcs_sm.c write_next_byte(kcs); kcs 378 drivers/char/ipmi/ipmi_kcs_sm.c kcs->state = KCS_WAIT_WRITE; kcs 384 drivers/char/ipmi/ipmi_kcs_sm.c start_error_recovery(kcs, kcs 388 drivers/char/ipmi/ipmi_kcs_sm.c clear_obf(kcs, status); kcs 389 drivers/char/ipmi/ipmi_kcs_sm.c if (kcs->write_count == 1) { kcs 390 drivers/char/ipmi/ipmi_kcs_sm.c write_cmd(kcs, KCS_WRITE_END); kcs 391 drivers/char/ipmi/ipmi_kcs_sm.c kcs->state = KCS_WAIT_WRITE_END; kcs 393 drivers/char/ipmi/ipmi_kcs_sm.c write_next_byte(kcs); kcs 399 drivers/char/ipmi/ipmi_kcs_sm.c start_error_recovery(kcs, kcs 404 drivers/char/ipmi/ipmi_kcs_sm.c clear_obf(kcs, status); kcs 405 drivers/char/ipmi/ipmi_kcs_sm.c write_next_byte(kcs); kcs 406 drivers/char/ipmi/ipmi_kcs_sm.c kcs->state = KCS_WAIT_READ; kcs 412 drivers/char/ipmi/ipmi_kcs_sm.c kcs, kcs 418 drivers/char/ipmi/ipmi_kcs_sm.c if (!check_obf(kcs, status, time)) kcs 420 drivers/char/ipmi/ipmi_kcs_sm.c read_next_byte(kcs); kcs 431 drivers/char/ipmi/ipmi_kcs_sm.c clear_obf(kcs, status); kcs 432 drivers/char/ipmi/ipmi_kcs_sm.c kcs->orig_write_count = 0; kcs 433 drivers/char/ipmi/ipmi_kcs_sm.c kcs->state = KCS_IDLE; kcs 439 drivers/char/ipmi/ipmi_kcs_sm.c clear_obf(kcs, status); kcs 440 drivers/char/ipmi/ipmi_kcs_sm.c status = read_status(kcs); kcs 443 drivers/char/ipmi/ipmi_kcs_sm.c if (time_before(jiffies, kcs->error0_timeout)) kcs 445 drivers/char/ipmi/ipmi_kcs_sm.c write_cmd(kcs, KCS_GET_STATUS_ABORT); kcs 446 drivers/char/ipmi/ipmi_kcs_sm.c kcs->state = KCS_ERROR1; kcs 450 drivers/char/ipmi/ipmi_kcs_sm.c clear_obf(kcs, status); kcs 451 drivers/char/ipmi/ipmi_kcs_sm.c write_data(kcs, 0); kcs 452 drivers/char/ipmi/ipmi_kcs_sm.c kcs->state = KCS_ERROR2; kcs 457 drivers/char/ipmi/ipmi_kcs_sm.c start_error_recovery(kcs, kcs 461 drivers/char/ipmi/ipmi_kcs_sm.c if (!check_obf(kcs, status, time)) kcs 464 drivers/char/ipmi/ipmi_kcs_sm.c clear_obf(kcs, status); kcs 465 drivers/char/ipmi/ipmi_kcs_sm.c write_data(kcs, KCS_READ_BYTE); kcs 466 drivers/char/ipmi/ipmi_kcs_sm.c kcs->state = KCS_ERROR3; kcs 471 drivers/char/ipmi/ipmi_kcs_sm.c start_error_recovery(kcs, kcs 476 drivers/char/ipmi/ipmi_kcs_sm.c if (!check_obf(kcs, status, time)) kcs 479 drivers/char/ipmi/ipmi_kcs_sm.c clear_obf(kcs, status); kcs 480 drivers/char/ipmi/ipmi_kcs_sm.c if (kcs->orig_write_count) { kcs 481 drivers/char/ipmi/ipmi_kcs_sm.c restart_kcs_transaction(kcs); kcs 483 drivers/char/ipmi/ipmi_kcs_sm.c kcs->state = KCS_IDLE; kcs 492 drivers/char/ipmi/ipmi_kcs_sm.c if (kcs->state == KCS_HOSED) { kcs 493 drivers/char/ipmi/ipmi_kcs_sm.c init_kcs_data(kcs, kcs->io); kcs 505 drivers/char/ipmi/ipmi_kcs_sm.c static int kcs_detect(struct si_sm_data *kcs) kcs 513 drivers/char/ipmi/ipmi_kcs_sm.c if (read_status(kcs) == 0xff) kcs 519 drivers/char/ipmi/ipmi_kcs_sm.c static void kcs_cleanup(struct si_sm_data *kcs) kcs 559 drivers/char/ipmi/ipmi_smic_sm.c static void smic_cleanup(struct si_sm_data *kcs) kcs 775 drivers/s390/crypto/pkey_api.c struct pkey_clr2seck kcs; kcs 777 drivers/s390/crypto/pkey_api.c if (copy_from_user(&kcs, ucs, sizeof(kcs))) kcs 779 drivers/s390/crypto/pkey_api.c rc = cca_clr2seckey(kcs.cardnr, kcs.domain, kcs.keytype, kcs 780 drivers/s390/crypto/pkey_api.c kcs.clrkey.clrkey, kcs.seckey.seckey); kcs 784 drivers/s390/crypto/pkey_api.c if (copy_to_user(ucs, &kcs, sizeof(kcs))) kcs 786 drivers/s390/crypto/pkey_api.c memzero_explicit(&kcs, sizeof(kcs)); kcs 952 drivers/s390/crypto/pkey_api.c struct pkey_clr2seck2 kcs; kcs 957 drivers/s390/crypto/pkey_api.c if (copy_from_user(&kcs, ucs, sizeof(kcs))) kcs 959 drivers/s390/crypto/pkey_api.c apqns = _copy_apqns_from_user(kcs.apqns, kcs.apqn_entries); kcs 967 drivers/s390/crypto/pkey_api.c rc = pkey_clr2seckey2(apqns, kcs.apqn_entries, kcs 968 drivers/s390/crypto/pkey_api.c kcs.type, kcs.size, kcs.keygenflags, kcs 969 drivers/s390/crypto/pkey_api.c kcs.clrkey.clrkey, kkey, &klen); kcs 976 drivers/s390/crypto/pkey_api.c if (kcs.key) { kcs 977 drivers/s390/crypto/pkey_api.c if (kcs.keylen < klen) { kcs 981 drivers/s390/crypto/pkey_api.c if (copy_to_user(kcs.key, kkey, klen)) { kcs 986 drivers/s390/crypto/pkey_api.c kcs.keylen = klen; kcs 987 drivers/s390/crypto/pkey_api.c if (copy_to_user(ucs, &kcs, sizeof(kcs))) kcs 989 drivers/s390/crypto/pkey_api.c memzero_explicit(&kcs, sizeof(kcs)); kcs 26 fs/proc/stat.c static u64 get_idle_time(struct kernel_cpustat *kcs, int cpu) kcs 30 fs/proc/stat.c idle = kcs->cpustat[CPUTIME_IDLE]; kcs 36 fs/proc/stat.c static u64 get_iowait_time(struct kernel_cpustat *kcs, int cpu) kcs 40 fs/proc/stat.c iowait = kcs->cpustat[CPUTIME_IOWAIT]; kcs 48 fs/proc/stat.c static u64 get_idle_time(struct kernel_cpustat *kcs, int cpu) kcs 57 fs/proc/stat.c idle = kcs->cpustat[CPUTIME_IDLE]; kcs 64 fs/proc/stat.c static u64 get_iowait_time(struct kernel_cpustat *kcs, int cpu) kcs 73 fs/proc/stat.c iowait = kcs->cpustat[CPUTIME_IOWAIT]; kcs 123 fs/proc/stat.c struct kernel_cpustat *kcs = &kcpustat_cpu(i); kcs 125 fs/proc/stat.c user += kcs->cpustat[CPUTIME_USER]; kcs 126 fs/proc/stat.c nice += kcs->cpustat[CPUTIME_NICE]; kcs 127 fs/proc/stat.c system += kcs->cpustat[CPUTIME_SYSTEM]; kcs 128 fs/proc/stat.c idle += get_idle_time(kcs, i); kcs 129 fs/proc/stat.c iowait += get_iowait_time(kcs, i); kcs 130 fs/proc/stat.c irq += kcs->cpustat[CPUTIME_IRQ]; kcs 131 fs/proc/stat.c softirq += kcs->cpustat[CPUTIME_SOFTIRQ]; kcs 132 fs/proc/stat.c steal += kcs->cpustat[CPUTIME_STEAL]; kcs 133 fs/proc/stat.c guest += kcs->cpustat[CPUTIME_GUEST]; kcs 134 fs/proc/stat.c guest_nice += kcs->cpustat[CPUTIME_GUEST_NICE]; kcs 160 fs/proc/stat.c struct kernel_cpustat *kcs = &kcpustat_cpu(i); kcs 163 fs/proc/stat.c user = kcs->cpustat[CPUTIME_USER]; kcs 164 fs/proc/stat.c nice = kcs->cpustat[CPUTIME_NICE]; kcs 165 fs/proc/stat.c system = kcs->cpustat[CPUTIME_SYSTEM]; kcs 166 fs/proc/stat.c idle = get_idle_time(kcs, i); kcs 167 fs/proc/stat.c iowait = get_iowait_time(kcs, i); kcs 168 fs/proc/stat.c irq = kcs->cpustat[CPUTIME_IRQ]; kcs 169 fs/proc/stat.c softirq = kcs->cpustat[CPUTIME_SOFTIRQ]; kcs 170 fs/proc/stat.c steal = kcs->cpustat[CPUTIME_STEAL]; kcs 171 fs/proc/stat.c guest = kcs->cpustat[CPUTIME_GUEST]; kcs 172 fs/proc/stat.c guest_nice = kcs->cpustat[CPUTIME_GUEST_NICE];