Searched refs:hp (Results 1 - 200 of 488) sorted by relevance

123

/linux-4.4.14/drivers/tty/hvc/
H A Dhvc_irq.c23 int notifier_add_irq(struct hvc_struct *hp, int irq) notifier_add_irq() argument
28 hp->irq_requested = 0; notifier_add_irq()
32 "hvc_console", hp); notifier_add_irq()
34 hp->irq_requested = 1; notifier_add_irq()
38 void notifier_del_irq(struct hvc_struct *hp, int irq) notifier_del_irq() argument
40 if (!hp->irq_requested) notifier_del_irq()
42 free_irq(irq, hp); notifier_del_irq()
43 hp->irq_requested = 0; notifier_del_irq()
46 void notifier_hangup_irq(struct hvc_struct *hp, int irq) notifier_hangup_irq() argument
48 notifier_del_irq(hp, irq); notifier_hangup_irq()
H A Dhvsi.c100 static int (*hvsi_wait)(struct hvsi_struct *hp, int state);
112 static inline int is_console(struct hvsi_struct *hp) is_console() argument
114 return hp->flags & HVSI_CONSOLE; is_console()
117 static inline int is_open(struct hvsi_struct *hp) is_open() argument
120 return (hp->state == HVSI_OPEN) is_open()
121 || (hp->state == HVSI_WAIT_FOR_MCTRL_RESPONSE); is_open()
124 static inline void print_state(struct hvsi_struct *hp) print_state() argument
135 const char *name = (hp->state < ARRAY_SIZE(state_names)) print_state()
136 ? state_names[hp->state] : "UNKNOWN"; print_state()
138 pr_debug("hvsi%i: state = %s\n", hp->index, name); print_state()
142 static inline void __set_state(struct hvsi_struct *hp, int state) __set_state() argument
144 hp->state = state; __set_state()
145 print_state(hp); __set_state()
146 wake_up_all(&hp->stateq); __set_state()
149 static inline void set_state(struct hvsi_struct *hp, int state) set_state() argument
153 spin_lock_irqsave(&hp->lock, flags); set_state()
154 __set_state(hp, state); set_state()
155 spin_unlock_irqrestore(&hp->lock, flags); set_state()
169 static inline int got_packet(const struct hvsi_struct *hp, uint8_t *packet) got_packet() argument
171 if (hp->inbuf_end < packet + sizeof(struct hvsi_header)) got_packet()
174 if (hp->inbuf_end < (packet + len_packet(packet))) got_packet()
181 static void compact_inbuf(struct hvsi_struct *hp, uint8_t *read_to) compact_inbuf() argument
183 int remaining = (int)(hp->inbuf_end - read_to); compact_inbuf()
187 if (read_to != hp->inbuf) compact_inbuf()
188 memmove(hp->inbuf, read_to, remaining); compact_inbuf()
190 hp->inbuf_end = hp->inbuf + remaining; compact_inbuf()
229 static int hvsi_read(struct hvsi_struct *hp, char *buf, int count) hvsi_read() argument
233 got = hvc_get_chars(hp->vtermno, buf, count); hvsi_read()
238 static void hvsi_recv_control(struct hvsi_struct *hp, uint8_t *packet, hvsi_recv_control() argument
247 pr_debug("hvsi%i: CD dropped\n", hp->index); hvsi_recv_control()
248 hp->mctrl &= TIOCM_CD; hvsi_recv_control()
254 pr_debug("hvsi%i: service processor came back\n", hp->index); hvsi_recv_control()
255 if (hp->state != HVSI_CLOSED) { hvsi_recv_control()
256 *to_handshake = hp; hvsi_recv_control()
261 hp->index); hvsi_recv_control()
267 static void hvsi_recv_response(struct hvsi_struct *hp, uint8_t *packet) hvsi_recv_response() argument
272 switch (hp->state) { hvsi_recv_response()
274 __set_state(hp, HVSI_WAIT_FOR_VER_QUERY); hvsi_recv_response()
277 hp->mctrl = 0; hvsi_recv_response()
280 hp->mctrl |= TIOCM_DTR; hvsi_recv_response()
282 hp->mctrl |= TIOCM_CD; hvsi_recv_response()
283 __set_state(hp, HVSI_OPEN); hvsi_recv_response()
286 printk(KERN_ERR "hvsi%i: unexpected query response: ", hp->index); hvsi_recv_response()
293 static int hvsi_version_respond(struct hvsi_struct *hp, uint16_t query_seqno) hvsi_version_respond() argument
300 packet.hdr.seqno = cpu_to_be16(atomic_inc_return(&hp->seqno)); hvsi_version_respond()
308 wrote = hvc_put_chars(hp->vtermno, (char *)&packet, packet.hdr.len); hvsi_version_respond()
311 hp->index); hvsi_version_respond()
318 static void hvsi_recv_query(struct hvsi_struct *hp, uint8_t *packet) hvsi_recv_query() argument
322 switch (hp->state) { hvsi_recv_query()
324 hvsi_version_respond(hp, be16_to_cpu(query->hdr.seqno)); hvsi_recv_query()
325 __set_state(hp, HVSI_OPEN); hvsi_recv_query()
328 printk(KERN_ERR "hvsi%i: unexpected query: ", hp->index); hvsi_recv_query()
334 static void hvsi_insert_chars(struct hvsi_struct *hp, const char *buf, int len) hvsi_insert_chars() argument
342 hp->sysrq = 1; hvsi_insert_chars()
344 } else if (hp->sysrq) { hvsi_insert_chars()
346 hp->sysrq = 0; hvsi_insert_chars()
350 tty_insert_flip_char(&hp->port, c, 0); hvsi_insert_chars()
363 static bool hvsi_recv_data(struct hvsi_struct *hp, const uint8_t *packet) hvsi_recv_data() argument
380 hvsi_insert_chars(hp, data, datalen); hvsi_recv_data()
388 memcpy(hp->throttle_buf, data + TTY_THRESHOLD_THROTTLE, overflow); hvsi_recv_data()
389 hp->n_throttle = overflow; hvsi_recv_data()
401 static int hvsi_load_chunk(struct hvsi_struct *hp, struct tty_struct *tty, hvsi_load_chunk() argument
404 uint8_t *packet = hp->inbuf; hvsi_load_chunk()
410 chunklen = hvsi_read(hp, hp->inbuf_end, HVSI_MAX_READ); hvsi_load_chunk()
417 dbg_dump_hex(hp->inbuf_end, chunklen); hvsi_load_chunk()
419 hp->inbuf_end += chunklen; hvsi_load_chunk()
422 while ((packet < hp->inbuf_end) && got_packet(hp, packet)) { hvsi_load_chunk()
426 printk(KERN_ERR "hvsi%i: got malformed packet\n", hp->index); hvsi_load_chunk()
428 while ((packet < hp->inbuf_end) && (!is_header(packet))) hvsi_load_chunk()
439 if (!is_open(hp)) hvsi_load_chunk()
441 flip = hvsi_recv_data(hp, packet); hvsi_load_chunk()
444 hvsi_recv_control(hp, packet, tty, handshake); hvsi_load_chunk()
447 hvsi_recv_response(hp, packet); hvsi_load_chunk()
450 hvsi_recv_query(hp, packet); hvsi_load_chunk()
454 hp->index, header->type); hvsi_load_chunk()
467 compact_inbuf(hp, packet); hvsi_load_chunk()
470 tty_flip_buffer_push(&hp->port); hvsi_load_chunk()
475 static void hvsi_send_overflow(struct hvsi_struct *hp) hvsi_send_overflow() argument
478 hp->n_throttle); hvsi_send_overflow()
480 hvsi_insert_chars(hp, hp->throttle_buf, hp->n_throttle); hvsi_send_overflow()
481 hp->n_throttle = 0; hvsi_send_overflow()
490 struct hvsi_struct *hp = (struct hvsi_struct *)arg; hvsi_interrupt() local
498 tty = tty_port_tty_get(&hp->port); hvsi_interrupt()
501 spin_lock_irqsave(&hp->lock, flags); hvsi_interrupt()
502 again = hvsi_load_chunk(hp, tty, &handshake); hvsi_interrupt()
503 spin_unlock_irqrestore(&hp->lock, flags); hvsi_interrupt()
511 spin_lock_irqsave(&hp->lock, flags); hvsi_interrupt()
512 if (tty && hp->n_throttle && !test_bit(TTY_THROTTLED, &tty->flags)) { hvsi_interrupt()
515 hvsi_send_overflow(hp); hvsi_interrupt()
516 tty_flip_buffer_push(&hp->port); hvsi_interrupt()
518 spin_unlock_irqrestore(&hp->lock, flags); hvsi_interrupt()
526 static int __init poll_for_state(struct hvsi_struct *hp, int state) poll_for_state() argument
531 hvsi_interrupt(hp->virq, (void *)hp); /* get pending data */ poll_for_state()
533 if (hp->state == state) poll_for_state()
543 static int wait_for_state(struct hvsi_struct *hp, int state) wait_for_state() argument
547 if (!wait_event_timeout(hp->stateq, (hp->state == state), HVSI_TIMEOUT)) wait_for_state()
553 static int hvsi_query(struct hvsi_struct *hp, uint16_t verb) hvsi_query() argument
560 packet.hdr.seqno = cpu_to_be16(atomic_inc_return(&hp->seqno)); hvsi_query()
566 wrote = hvc_put_chars(hp->vtermno, (char *)&packet, packet.hdr.len); hvsi_query()
568 printk(KERN_ERR "hvsi%i: couldn't send query (%i)!\n", hp->index, hvsi_query()
576 static int hvsi_get_mctrl(struct hvsi_struct *hp) hvsi_get_mctrl() argument
580 set_state(hp, HVSI_WAIT_FOR_MCTRL_RESPONSE); hvsi_get_mctrl()
581 hvsi_query(hp, VSV_SEND_MODEM_CTL_STATUS); hvsi_get_mctrl()
583 ret = hvsi_wait(hp, HVSI_OPEN); hvsi_get_mctrl()
585 printk(KERN_ERR "hvsi%i: didn't get modem flags\n", hp->index); hvsi_get_mctrl()
586 set_state(hp, HVSI_OPEN); hvsi_get_mctrl()
590 pr_debug("%s: mctrl 0x%x\n", __func__, hp->mctrl); hvsi_get_mctrl()
596 static int hvsi_set_mctrl(struct hvsi_struct *hp, uint16_t mctrl) hvsi_set_mctrl() argument
602 packet.hdr.seqno = cpu_to_be16(atomic_inc_return(&hp->seqno)); hvsi_set_mctrl()
613 wrote = hvc_put_chars(hp->vtermno, (char *)&packet, packet.hdr.len); hvsi_set_mctrl()
615 printk(KERN_ERR "hvsi%i: couldn't set DTR!\n", hp->index); hvsi_set_mctrl()
622 static void hvsi_drain_input(struct hvsi_struct *hp) hvsi_drain_input() argument
628 if (0 == hvsi_read(hp, buf, HVSI_MAX_READ)) hvsi_drain_input()
632 static int hvsi_handshake(struct hvsi_struct *hp) hvsi_handshake() argument
643 hvsi_drain_input(hp); hvsi_handshake()
645 set_state(hp, HVSI_WAIT_FOR_VER_RESPONSE); hvsi_handshake()
646 ret = hvsi_query(hp, VSV_SEND_VERSION_NUMBER); hvsi_handshake()
648 printk(KERN_ERR "hvsi%i: couldn't send version query\n", hp->index); hvsi_handshake()
652 ret = hvsi_wait(hp, HVSI_OPEN); hvsi_handshake()
661 struct hvsi_struct *hp = hvsi_handshaker() local
664 if (hvsi_handshake(hp) >= 0) hvsi_handshaker()
667 printk(KERN_ERR "hvsi%i: re-handshaking failed\n", hp->index); hvsi_handshaker()
668 if (is_console(hp)) { hvsi_handshaker()
673 printk(KERN_ERR "hvsi%i: lost console!\n", hp->index); hvsi_handshaker()
677 static int hvsi_put_chars(struct hvsi_struct *hp, const char *buf, int count) hvsi_put_chars() argument
685 packet.hdr.seqno = cpu_to_be16(atomic_inc_return(&hp->seqno)); hvsi_put_chars()
689 ret = hvc_put_chars(hp->vtermno, (char *)&packet, packet.hdr.len); hvsi_put_chars()
697 static void hvsi_close_protocol(struct hvsi_struct *hp) hvsi_close_protocol() argument
702 packet.hdr.seqno = cpu_to_be16(atomic_inc_return(&hp->seqno)); hvsi_close_protocol()
709 hvc_put_chars(hp->vtermno, (char *)&packet, packet.hdr.len); hvsi_close_protocol()
714 struct hvsi_struct *hp; hvsi_open() local
720 hp = &hvsi_ports[tty->index]; hvsi_open()
722 tty->driver_data = hp; hvsi_open()
725 if (hp->state == HVSI_FSP_DIED) hvsi_open()
728 tty_port_tty_set(&hp->port, tty); hvsi_open()
729 spin_lock_irqsave(&hp->lock, flags); hvsi_open()
730 hp->port.count++; hvsi_open()
731 atomic_set(&hp->seqno, 0); hvsi_open()
732 h_vio_signal(hp->vtermno, VIO_IRQ_ENABLE); hvsi_open()
733 spin_unlock_irqrestore(&hp->lock, flags); hvsi_open()
735 if (is_console(hp)) hvsi_open()
738 ret = hvsi_handshake(hp); hvsi_open()
744 ret = hvsi_get_mctrl(hp); hvsi_open()
750 ret = hvsi_set_mctrl(hp, hp->mctrl | TIOCM_DTR); hvsi_open()
759 /* wait for hvsi_write_worker to empty hp->outbuf */ hvsi_flush_output()
760 static void hvsi_flush_output(struct hvsi_struct *hp) hvsi_flush_output() argument
762 wait_event_timeout(hp->emptyq, (hp->n_outbuf <= 0), HVSI_TIMEOUT); hvsi_flush_output()
765 cancel_delayed_work_sync(&hp->writer); hvsi_flush_output()
766 flush_work(&hp->handshaker); hvsi_flush_output()
772 hp->n_outbuf = 0; hvsi_flush_output()
777 struct hvsi_struct *hp = tty->driver_data; hvsi_close() local
785 spin_lock_irqsave(&hp->lock, flags); hvsi_close()
787 if (--hp->port.count == 0) { hvsi_close()
788 tty_port_tty_set(&hp->port, NULL); hvsi_close()
789 hp->inbuf_end = hp->inbuf; /* discard remaining partial packets */ hvsi_close()
792 if (!is_console(hp)) { hvsi_close()
793 h_vio_signal(hp->vtermno, VIO_IRQ_DISABLE); /* no more irqs */ hvsi_close()
794 __set_state(hp, HVSI_CLOSED); hvsi_close()
801 spin_unlock_irqrestore(&hp->lock, flags); hvsi_close()
804 synchronize_irq(hp->virq); hvsi_close()
807 hvsi_flush_output(hp); hvsi_close()
810 hvsi_close_protocol(hp); hvsi_close()
816 hvsi_drain_input(hp); hvsi_close()
818 spin_lock_irqsave(&hp->lock, flags); hvsi_close()
820 } else if (hp->port.count < 0) hvsi_close()
822 hp - hvsi_ports, hp->port.count); hvsi_close()
824 spin_unlock_irqrestore(&hp->lock, flags); hvsi_close()
829 struct hvsi_struct *hp = tty->driver_data; hvsi_hangup() local
834 tty_port_tty_set(&hp->port, NULL); hvsi_hangup()
836 spin_lock_irqsave(&hp->lock, flags); hvsi_hangup()
837 hp->port.count = 0; hvsi_hangup()
838 hp->n_outbuf = 0; hvsi_hangup()
839 spin_unlock_irqrestore(&hp->lock, flags); hvsi_hangup()
842 /* called with hp->lock held */ hvsi_push()
843 static void hvsi_push(struct hvsi_struct *hp) hvsi_push() argument
847 if (hp->n_outbuf <= 0) hvsi_push()
850 n = hvsi_put_chars(hp, hp->outbuf, hp->n_outbuf); hvsi_push()
854 hp->n_outbuf = 0; hvsi_push()
856 __set_state(hp, HVSI_FSP_DIED); hvsi_push()
857 printk(KERN_ERR "hvsi%i: service processor died\n", hp->index); hvsi_push()
864 struct hvsi_struct *hp = hvsi_write_worker() local
874 spin_lock_irqsave(&hp->lock, flags); hvsi_write_worker()
876 pr_debug("%s: %i chars in buffer\n", __func__, hp->n_outbuf); hvsi_write_worker()
878 if (!is_open(hp)) { hvsi_write_worker()
885 schedule_delayed_work(&hp->writer, HZ); hvsi_write_worker()
889 hvsi_push(hp); hvsi_write_worker()
890 if (hp->n_outbuf > 0) hvsi_write_worker()
891 schedule_delayed_work(&hp->writer, 10); hvsi_write_worker()
898 wake_up_all(&hp->emptyq); hvsi_write_worker()
899 tty_port_tty_wakeup(&hp->port); hvsi_write_worker()
903 spin_unlock_irqrestore(&hp->lock, flags); hvsi_write_worker()
908 struct hvsi_struct *hp = tty->driver_data; hvsi_write_room() local
910 return N_OUTBUF - hp->n_outbuf; hvsi_write_room()
915 struct hvsi_struct *hp = tty->driver_data; hvsi_chars_in_buffer() local
917 return hp->n_outbuf; hvsi_chars_in_buffer()
923 struct hvsi_struct *hp = tty->driver_data; hvsi_write() local
929 spin_lock_irqsave(&hp->lock, flags); hvsi_write()
931 pr_debug("%s: %i chars in buffer\n", __func__, hp->n_outbuf); hvsi_write()
933 if (!is_open(hp)) { hvsi_write()
940 * when the hypervisor buffer (16K) fills, data will stay in hp->outbuf hvsi_write()
947 BUG_ON(hp->n_outbuf < 0); hvsi_write()
948 memcpy(hp->outbuf + hp->n_outbuf, source, chunksize); hvsi_write()
949 hp->n_outbuf += chunksize; hvsi_write()
954 hvsi_push(hp); hvsi_write()
957 if (hp->n_outbuf > 0) { hvsi_write()
962 schedule_delayed_work(&hp->writer, 10); hvsi_write()
966 spin_unlock_irqrestore(&hp->lock, flags); hvsi_write()
981 struct hvsi_struct *hp = tty->driver_data; hvsi_throttle() local
985 h_vio_signal(hp->vtermno, VIO_IRQ_DISABLE); hvsi_throttle()
990 struct hvsi_struct *hp = tty->driver_data; hvsi_unthrottle() local
995 spin_lock_irqsave(&hp->lock, flags); hvsi_unthrottle()
996 if (hp->n_throttle) { hvsi_unthrottle()
997 hvsi_send_overflow(hp); hvsi_unthrottle()
998 tty_flip_buffer_push(&hp->port); hvsi_unthrottle()
1000 spin_unlock_irqrestore(&hp->lock, flags); hvsi_unthrottle()
1003 h_vio_signal(hp->vtermno, VIO_IRQ_ENABLE); hvsi_unthrottle()
1008 struct hvsi_struct *hp = tty->driver_data; hvsi_tiocmget() local
1010 hvsi_get_mctrl(hp); hvsi_tiocmget()
1011 return hp->mctrl; hvsi_tiocmget()
1017 struct hvsi_struct *hp = tty->driver_data; hvsi_tiocmset() local
1025 spin_lock_irqsave(&hp->lock, flags); hvsi_tiocmset()
1027 new_mctrl = (hp->mctrl & ~clear) | set; hvsi_tiocmset()
1029 if (hp->mctrl != new_mctrl) { hvsi_tiocmset()
1030 hvsi_set_mctrl(hp, new_mctrl); hvsi_tiocmset()
1031 hp->mctrl = new_mctrl; hvsi_tiocmset()
1033 spin_unlock_irqrestore(&hp->lock, flags); hvsi_tiocmset()
1073 struct hvsi_struct *hp = &hvsi_ports[i]; hvsi_init() local
1076 tty_port_link_device(&hp->port, hvsi_driver, i); hvsi_init()
1078 ret = request_irq(hp->virq, hvsi_interrupt, 0, "hvsi", hp); hvsi_init()
1081 hp->virq, ret); hvsi_init()
1099 struct hvsi_struct *hp = &hvsi_ports[console->index]; hvsi_console_print() local
1105 if (!is_open(hp)) hvsi_console_print()
1123 ret = hvsi_put_chars(hp, c, i); hvsi_console_print()
1140 struct hvsi_struct *hp; hvsi_console_setup() local
1145 hp = &hvsi_ports[console->index]; hvsi_console_setup()
1148 hvsi_close_protocol(hp); hvsi_console_setup()
1150 ret = hvsi_handshake(hp); hvsi_console_setup()
1154 ret = hvsi_get_mctrl(hp); hvsi_console_setup()
1158 ret = hvsi_set_mctrl(hp, hp->mctrl | TIOCM_DTR); hvsi_console_setup()
1162 hp->flags |= HVSI_CONSOLE; hvsi_console_setup()
1184 struct hvsi_struct *hp; hvsi_console_init() local
1197 hp = &hvsi_ports[hvsi_count]; hvsi_console_init()
1198 INIT_DELAYED_WORK(&hp->writer, hvsi_write_worker); hvsi_console_init()
1199 INIT_WORK(&hp->handshaker, hvsi_handshaker); hvsi_console_init()
1200 init_waitqueue_head(&hp->emptyq); hvsi_console_init()
1201 init_waitqueue_head(&hp->stateq); hvsi_console_init()
1202 spin_lock_init(&hp->lock); hvsi_console_init()
1203 tty_port_init(&hp->port); hvsi_console_init()
1204 hp->index = hvsi_count; hvsi_console_init()
1205 hp->inbuf_end = hp->inbuf; hvsi_console_init()
1206 hp->state = HVSI_CLOSED; hvsi_console_init()
1207 hp->vtermno = be32_to_cpup(vtermno); hvsi_console_init()
1208 hp->virq = irq_create_mapping(NULL, be32_to_cpup(irq)); hvsi_console_init()
1209 if (hp->virq == 0) { hvsi_console_init()
1212 tty_port_destroy(&hp->port); hvsi_console_init()
H A Dhvc_console.c106 struct hvc_struct *hp; hvc_get_by_index() local
111 list_for_each_entry(hp, &hvc_structs, next) { hvc_get_by_index()
112 spin_lock_irqsave(&hp->lock, flags); hvc_get_by_index()
113 if (hp->index == index) { hvc_get_by_index()
114 tty_port_get(&hp->port); hvc_get_by_index()
115 spin_unlock_irqrestore(&hp->lock, flags); hvc_get_by_index()
117 return hp; hvc_get_by_index()
119 spin_unlock_irqrestore(&hp->lock, flags); hvc_get_by_index()
121 hp = NULL; hvc_get_by_index()
124 return hp; hvc_get_by_index()
238 struct hvc_struct *hp = container_of(port, struct hvc_struct, port); hvc_port_destruct() local
243 spin_lock_irqsave(&hp->lock, flags); hvc_port_destruct()
244 list_del(&(hp->next)); hvc_port_destruct()
245 spin_unlock_irqrestore(&hp->lock, flags); hvc_port_destruct()
249 kfree(hp); hvc_port_destruct()
274 struct hvc_struct *hp; hvc_instantiate() local
283 hp = hvc_get_by_index(index); hvc_instantiate()
284 if (hp) { hvc_instantiate()
285 tty_port_put(&hp->port); hvc_instantiate()
318 struct hvc_struct *hp; hvc_install() local
322 hp = hvc_get_by_index(tty->index); hvc_install()
323 if (!hp) hvc_install()
326 tty->driver_data = hp; hvc_install()
328 rc = tty_port_install(&hp->port, driver, tty); hvc_install()
330 tty_port_put(&hp->port); hvc_install()
340 struct hvc_struct *hp = tty->driver_data; hvc_open() local
344 spin_lock_irqsave(&hp->port.lock, flags); hvc_open()
346 if (hp->port.count++ > 0) { hvc_open()
347 spin_unlock_irqrestore(&hp->port.lock, flags); hvc_open()
351 spin_unlock_irqrestore(&hp->port.lock, flags); hvc_open()
353 tty_port_tty_set(&hp->port, tty); hvc_open()
355 if (hp->ops->notifier_add) hvc_open()
356 rc = hp->ops->notifier_add(hp, hp->data); hvc_open()
365 tty_port_tty_set(&hp->port, NULL); hvc_open()
367 tty_port_put(&hp->port); hvc_open()
372 if (hp->ops->dtr_rts) hvc_open()
373 hp->ops->dtr_rts(hp, 1); hvc_open()
383 struct hvc_struct *hp; hvc_close() local
397 hp = tty->driver_data; hvc_close()
399 spin_lock_irqsave(&hp->port.lock, flags); hvc_close()
401 if (--hp->port.count == 0) { hvc_close()
402 spin_unlock_irqrestore(&hp->port.lock, flags); hvc_close()
404 tty_port_tty_set(&hp->port, NULL); hvc_close()
407 if (hp->ops->dtr_rts) hvc_close()
408 hp->ops->dtr_rts(hp, 0); hvc_close()
410 if (hp->ops->notifier_del) hvc_close()
411 hp->ops->notifier_del(hp, hp->data); hvc_close()
414 cancel_work_sync(&hp->tty_resize); hvc_close()
423 if (hp->port.count < 0) hvc_close()
425 hp->vtermno, hp->port.count); hvc_close()
426 spin_unlock_irqrestore(&hp->port.lock, flags); hvc_close()
432 struct hvc_struct *hp = tty->driver_data; hvc_cleanup() local
434 tty_port_put(&hp->port); hvc_cleanup()
439 struct hvc_struct *hp = tty->driver_data; hvc_hangup() local
442 if (!hp) hvc_hangup()
446 cancel_work_sync(&hp->tty_resize); hvc_hangup()
448 spin_lock_irqsave(&hp->port.lock, flags); hvc_hangup()
455 if (hp->port.count <= 0) { hvc_hangup()
456 spin_unlock_irqrestore(&hp->port.lock, flags); hvc_hangup()
460 hp->port.count = 0; hvc_hangup()
461 spin_unlock_irqrestore(&hp->port.lock, flags); hvc_hangup()
462 tty_port_tty_set(&hp->port, NULL); hvc_hangup()
464 hp->n_outbuf = 0; hvc_hangup()
466 if (hp->ops->notifier_hangup) hvc_hangup()
467 hp->ops->notifier_hangup(hp, hp->data); hvc_hangup()
472 * on a blocked hypervisor. Call this function with hp->lock held.
474 static int hvc_push(struct hvc_struct *hp) hvc_push() argument
478 n = hp->ops->put_chars(hp->vtermno, hp->outbuf, hp->n_outbuf); hvc_push()
481 hp->do_wakeup = 1; hvc_push()
486 hp->n_outbuf = 0; hvc_push()
488 hp->n_outbuf -= n; hvc_push()
489 if (hp->n_outbuf > 0) hvc_push()
490 memmove(hp->outbuf, hp->outbuf + n, hp->n_outbuf); hvc_push()
492 hp->do_wakeup = 1; hvc_push()
499 struct hvc_struct *hp = tty->driver_data; hvc_write() local
504 if (!hp) hvc_write()
508 if (hp->port.count <= 0) hvc_write()
511 spin_lock_irqsave(&hp->lock, flags); hvc_write()
514 if (hp->n_outbuf > 0) hvc_write()
515 hvc_push(hp); hvc_write()
517 while (count > 0 && (rsize = hp->outbuf_size - hp->n_outbuf) > 0) { hvc_write()
520 memcpy(hp->outbuf + hp->n_outbuf, buf, rsize); hvc_write()
523 hp->n_outbuf += rsize; hvc_write()
525 hvc_push(hp); hvc_write()
527 spin_unlock_irqrestore(&hp->lock, flags); hvc_write()
532 if (hp->n_outbuf) hvc_write()
545 * Locking: hp->lock
549 struct hvc_struct *hp; hvc_set_winsz() local
554 hp = container_of(work, struct hvc_struct, tty_resize); hvc_set_winsz()
556 tty = tty_port_tty_get(&hp->port); hvc_set_winsz()
560 spin_lock_irqsave(&hp->lock, hvc_flags); hvc_set_winsz()
561 ws = hp->ws; hvc_set_winsz()
562 spin_unlock_irqrestore(&hp->lock, hvc_flags); hvc_set_winsz()
575 struct hvc_struct *hp = tty->driver_data; hvc_write_room() local
577 if (!hp) hvc_write_room()
580 return hp->outbuf_size - hp->n_outbuf; hvc_write_room()
585 struct hvc_struct *hp = tty->driver_data; hvc_chars_in_buffer() local
587 if (!hp) hvc_chars_in_buffer()
589 return hp->n_outbuf; hvc_chars_in_buffer()
607 int hvc_poll(struct hvc_struct *hp) hvc_poll() argument
616 spin_lock_irqsave(&hp->lock, flags); hvc_poll()
619 if (hp->n_outbuf > 0) hvc_poll()
620 written_total = hvc_push(hp); hvc_poll()
623 if (hp->n_outbuf > 0) { hvc_poll()
630 tty = tty_port_tty_get(&hp->port); hvc_poll()
641 if (!hp->irq_requested) hvc_poll()
646 int count = tty_buffer_request_room(&hp->port, N_INBUF); hvc_poll()
654 n = hp->ops->get_chars(hp->vtermno, buf, count); hvc_poll()
658 spin_unlock_irqrestore(&hp->lock, flags); hvc_poll()
660 spin_lock_irqsave(&hp->lock, flags); hvc_poll()
673 if (hp->index == hvc_console.index) { hvc_poll()
689 tty_insert_flip_char(&hp->port, buf[i], 0); hvc_poll()
696 if (hp->do_wakeup) { hvc_poll()
697 hp->do_wakeup = 0; hvc_poll()
701 spin_unlock_irqrestore(&hp->lock, flags); hvc_poll()
708 tty_flip_buffer_push(&hp->port); hvc_poll()
718 * @hp: HVC console pointer
721 * Stores the specified window size information in the hvc structure of @hp.
724 * Locking: Locking free; the function MUST be called holding hp->lock
726 void __hvc_resize(struct hvc_struct *hp, struct winsize ws) __hvc_resize() argument
728 hp->ws = ws; __hvc_resize()
729 schedule_work(&hp->tty_resize); __hvc_resize()
741 struct hvc_struct *hp; khvcd() local
751 list_for_each_entry(hp, &hvc_structs, next) { khvcd()
752 poll_mask |= hvc_poll(hp); khvcd()
785 struct hvc_struct *hp = tty->driver_data; hvc_tiocmget() local
787 if (!hp || !hp->ops->tiocmget) hvc_tiocmget()
789 return hp->ops->tiocmget(hp); hvc_tiocmget()
795 struct hvc_struct *hp = tty->driver_data; hvc_tiocmset() local
797 if (!hp || !hp->ops->tiocmset) hvc_tiocmset()
799 return hp->ops->tiocmset(hp, set, clear); hvc_tiocmset()
811 struct hvc_struct *hp = tty->driver_data; hvc_poll_get_char() local
815 n = hp->ops->get_chars(hp->vtermno, &ch, 1); hvc_poll_get_char()
826 struct hvc_struct *hp = tty->driver_data; hvc_poll_put_char() local
830 n = hp->ops->put_chars(hp->vtermno, &ch, 1); hvc_poll_put_char()
862 struct hvc_struct *hp; hvc_alloc() local
872 hp = kzalloc(ALIGN(sizeof(*hp), sizeof(long)) + outbuf_size, hvc_alloc()
874 if (!hp) hvc_alloc()
877 hp->vtermno = vtermno; hvc_alloc()
878 hp->data = data; hvc_alloc()
879 hp->ops = ops; hvc_alloc()
880 hp->outbuf_size = outbuf_size; hvc_alloc()
881 hp->outbuf = &((char *)hp)[ALIGN(sizeof(*hp), sizeof(long))]; hvc_alloc()
883 tty_port_init(&hp->port); hvc_alloc()
884 hp->port.ops = &hvc_port_ops; hvc_alloc()
886 INIT_WORK(&hp->tty_resize, hvc_set_winsz); hvc_alloc()
887 spin_lock_init(&hp->lock); hvc_alloc()
895 if (vtermnos[i] == hp->vtermno && hvc_alloc()
896 cons_ops[i] == hp->ops) hvc_alloc()
903 hp->index = i; hvc_alloc()
907 list_add_tail(&(hp->next), &hvc_structs); hvc_alloc()
913 return hp; hvc_alloc()
917 int hvc_remove(struct hvc_struct *hp) hvc_remove() argument
922 tty = tty_port_tty_get(&hp->port); hvc_remove()
924 spin_lock_irqsave(&hp->lock, flags); hvc_remove()
925 if (hp->index < MAX_NR_HVC_CONSOLES) { hvc_remove()
927 vtermnos[hp->index] = -1; hvc_remove()
928 cons_ops[hp->index] = NULL; hvc_remove()
932 /* Don't whack hp->irq because tty_hangup() will need to free the irq. */ hvc_remove()
934 spin_unlock_irqrestore(&hp->lock, flags); hvc_remove()
942 tty_port_put(&hp->port); hvc_remove()
H A Dhvc_tile.c82 static int hvc_tile_notifier_add_irq(struct hvc_struct *hp, int irq) hvc_tile_notifier_add_irq() argument
88 rc = notifier_add_irq(hp, irq); hvc_tile_notifier_add_irq()
98 notifier_del_irq(hp, irq); hvc_tile_notifier_add_irq()
103 static void hvc_tile_notifier_del_irq(struct hvc_struct *hp, int irq) hvc_tile_notifier_del_irq() argument
110 notifier_del_irq(hp, irq); hvc_tile_notifier_del_irq()
113 static void hvc_tile_notifier_hangup_irq(struct hvc_struct *hp, int irq) hvc_tile_notifier_hangup_irq() argument
115 hvc_tile_notifier_del_irq(hp, irq); hvc_tile_notifier_hangup_irq()
133 struct hvc_struct *hp; hvc_tile_probe() local
142 hp = hvc_alloc(0, tile_hvc_irq, &hvc_tile_get_put_ops, 128); hvc_tile_probe()
143 if (IS_ERR(hp)) { hvc_tile_probe()
145 return PTR_ERR(hp); hvc_tile_probe()
147 dev_set_drvdata(&pdev->dev, hp); hvc_tile_probe()
155 struct hvc_struct *hp = dev_get_drvdata(&pdev->dev); hvc_tile_remove() local
157 rc = hvc_remove(hp); hvc_tile_remove()
159 irq_free_hwirq(hp->data); hvc_tile_remove()
166 struct hvc_struct *hp = dev_get_drvdata(&pdev->dev); hvc_tile_shutdown() local
168 hvc_tile_notifier_del_irq(hp, hp->data); hvc_tile_shutdown()
197 struct hvc_struct *hp; hvc_tile_init() local
198 hp = hvc_alloc(0, 0, &hvc_tile_get_put_ops, 128); hvc_tile_init()
199 return PTR_ERR_OR_ZERO(hp); hvc_tile_init()
H A Dhvc_console.h71 int (*notifier_add)(struct hvc_struct *hp, int irq);
72 void (*notifier_del)(struct hvc_struct *hp, int irq);
73 void (*notifier_hangup)(struct hvc_struct *hp, int irq);
76 int (*tiocmget)(struct hvc_struct *hp);
77 int (*tiocmset)(struct hvc_struct *hp, unsigned int set, unsigned int clear);
80 void (*dtr_rts)(struct hvc_struct *hp, int raise);
91 extern int hvc_remove(struct hvc_struct *hp);
94 int hvc_poll(struct hvc_struct *hp);
98 extern void __hvc_resize(struct hvc_struct *hp, struct winsize ws);
100 static inline void hvc_resize(struct hvc_struct *hp, struct winsize ws) hvc_resize() argument
104 spin_lock_irqsave(&hp->lock, flags); hvc_resize()
105 __hvc_resize(hp, ws); hvc_resize()
106 spin_unlock_irqrestore(&hp->lock, flags); hvc_resize()
110 extern int notifier_add_irq(struct hvc_struct *hp, int data);
111 extern void notifier_del_irq(struct hvc_struct *hp, int data);
112 extern void notifier_hangup_irq(struct hvc_struct *hp, int data);
H A Dhvc_opal.c94 static int hvc_opal_hvsi_open(struct hvc_struct *hp, int data) hvc_opal_hvsi_open() argument
96 struct hvc_opal_priv *pv = hvc_opal_privs[hp->vtermno]; hvc_opal_hvsi_open()
99 pr_devel("HVSI@%x: do open !\n", hp->vtermno); hvc_opal_hvsi_open()
101 rc = notifier_add_irq(hp, data); hvc_opal_hvsi_open()
105 return hvsilib_open(&pv->hvsi, hp); hvc_opal_hvsi_open()
108 static void hvc_opal_hvsi_close(struct hvc_struct *hp, int data) hvc_opal_hvsi_close() argument
110 struct hvc_opal_priv *pv = hvc_opal_privs[hp->vtermno]; hvc_opal_hvsi_close()
112 pr_devel("HVSI@%x: do close !\n", hp->vtermno); hvc_opal_hvsi_close()
114 hvsilib_close(&pv->hvsi, hp); hvc_opal_hvsi_close()
116 notifier_del_irq(hp, data); hvc_opal_hvsi_close()
119 void hvc_opal_hvsi_hangup(struct hvc_struct *hp, int data) hvc_opal_hvsi_hangup() argument
121 struct hvc_opal_priv *pv = hvc_opal_privs[hp->vtermno]; hvc_opal_hvsi_hangup()
123 pr_devel("HVSI@%x: do hangup !\n", hp->vtermno); hvc_opal_hvsi_hangup()
125 hvsilib_close(&pv->hvsi, hp); hvc_opal_hvsi_hangup()
127 notifier_hangup_irq(hp, data); hvc_opal_hvsi_hangup()
130 static int hvc_opal_hvsi_tiocmget(struct hvc_struct *hp) hvc_opal_hvsi_tiocmget() argument
132 struct hvc_opal_priv *pv = hvc_opal_privs[hp->vtermno]; hvc_opal_hvsi_tiocmget()
139 static int hvc_opal_hvsi_tiocmset(struct hvc_struct *hp, unsigned int set, hvc_opal_hvsi_tiocmset() argument
142 struct hvc_opal_priv *pv = hvc_opal_privs[hp->vtermno]; hvc_opal_hvsi_tiocmset()
145 hp->vtermno, set, clear); hvc_opal_hvsi_tiocmset()
168 struct hvc_struct *hp; hvc_opal_probe() local
224 hp = hvc_alloc(termno, irq, ops, MAX_VIO_PUT_CHARS); hvc_opal_probe()
225 if (IS_ERR(hp)) hvc_opal_probe()
226 return PTR_ERR(hp); hvc_opal_probe()
227 dev_set_drvdata(&dev->dev, hp); hvc_opal_probe()
234 struct hvc_struct *hp = dev_get_drvdata(&dev->dev); hvc_opal_remove() local
237 termno = hp->vtermno; hvc_opal_remove()
238 rc = hvc_remove(hp); hvc_opal_remove()
H A Dhvc_udbg.c68 struct hvc_struct *hp; hvc_udbg_init() local
75 hp = hvc_alloc(0, 0, &hvc_udbg_ops, 16); hvc_udbg_init()
76 if (IS_ERR(hp)) hvc_udbg_init()
77 return PTR_ERR(hp); hvc_udbg_init()
79 hvc_udbg_dev = hp; hvc_udbg_init()
H A Dhvc_vio.c163 static int hvterm_hvsi_open(struct hvc_struct *hp, int data) hvterm_hvsi_open() argument
165 struct hvterm_priv *pv = hvterm_privs[hp->vtermno]; hvterm_hvsi_open()
170 rc = notifier_add_irq(hp, data); hvterm_hvsi_open()
174 return hvsilib_open(&pv->hvsi, hp); hvterm_hvsi_open()
177 static void hvterm_hvsi_close(struct hvc_struct *hp, int data) hvterm_hvsi_close() argument
179 struct hvterm_priv *pv = hvterm_privs[hp->vtermno]; hvterm_hvsi_close()
183 hvsilib_close(&pv->hvsi, hp); hvterm_hvsi_close()
185 notifier_del_irq(hp, data); hvterm_hvsi_close()
188 void hvterm_hvsi_hangup(struct hvc_struct *hp, int data) hvterm_hvsi_hangup() argument
190 struct hvterm_priv *pv = hvterm_privs[hp->vtermno]; hvterm_hvsi_hangup()
194 hvsilib_close(&pv->hvsi, hp); hvterm_hvsi_hangup()
196 notifier_hangup_irq(hp, data); hvterm_hvsi_hangup()
199 static int hvterm_hvsi_tiocmget(struct hvc_struct *hp) hvterm_hvsi_tiocmget() argument
201 struct hvterm_priv *pv = hvterm_privs[hp->vtermno]; hvterm_hvsi_tiocmget()
208 static int hvterm_hvsi_tiocmset(struct hvc_struct *hp, unsigned int set, hvterm_hvsi_tiocmset() argument
211 struct hvterm_priv *pv = hvterm_privs[hp->vtermno]; hvterm_hvsi_tiocmset()
301 struct hvc_struct *hp; hvc_vio_probe() local
351 hp = hvc_alloc(termno, vdev->irq, ops, MAX_VIO_PUT_CHARS); hvc_vio_probe()
352 if (IS_ERR(hp)) hvc_vio_probe()
353 return PTR_ERR(hp); hvc_vio_probe()
354 dev_set_drvdata(&vdev->dev, hp); hvc_vio_probe()
357 if (hp->index == 0 && !udbg_putc) { hvc_vio_probe()
368 struct hvc_struct *hp = dev_get_drvdata(&vdev->dev); hvc_vio_remove() local
371 termno = hp->vtermno; hvc_vio_remove()
372 rc = hvc_remove(hp); hvc_vio_remove()
H A Dhvc_rtas.c81 struct hvc_struct *hp; hvc_rtas_init() local
96 * earlier. Save off hp so that we can return it on exit */ hvc_rtas_init()
97 hp = hvc_alloc(hvc_rtas_cookie, 0, &hvc_rtas_get_put_ops, 16); hvc_rtas_init()
98 if (IS_ERR(hp)) hvc_rtas_init()
99 return PTR_ERR(hp); hvc_rtas_init()
101 hvc_rtas_dev = hp; hvc_rtas_init()
H A Dhvsi_lib.c373 int hvsilib_open(struct hvsi_priv *pv, struct hvc_struct *hp) hvsilib_open() argument
378 pv->tty = tty_port_tty_get(&hp->port); hvsilib_open()
385 void hvsilib_close(struct hvsi_priv *pv, struct hvc_struct *hp) hvsilib_close() argument
396 spin_lock_irqsave(&hp->lock, flags); hvsilib_close()
398 spin_unlock_irqrestore(&hp->lock, flags); hvsilib_close()
/linux-4.4.14/drivers/net/ethernet/sun/
H A Dsunhme.c110 static __inline__ void tx_add_log(struct happy_meal *hp, unsigned int a, unsigned int s) tx_add_log() argument
118 tlp->tx_new = hp->tx_new; tx_add_log()
119 tlp->tx_old = hp->tx_old; tx_add_log()
138 static __inline__ void tx_dump_ring(struct happy_meal *hp) tx_dump_ring() argument
140 struct hmeal_init_block *hb = hp->happy_block; tx_dump_ring()
154 #define tx_add_log(hp, a, s) do { } while(0)
156 #define tx_dump_ring(hp) do { } while(0)
304 static inline u32 hme_read_desc32(struct happy_meal *hp, hme32 *p) hme_read_desc32() argument
321 static void BB_PUT_BIT(struct happy_meal *hp, void __iomem *tregs, int bit) BB_PUT_BIT() argument
323 hme_write32(hp, tregs + TCVR_BBDATA, bit); BB_PUT_BIT()
324 hme_write32(hp, tregs + TCVR_BBCLOCK, 0); BB_PUT_BIT()
325 hme_write32(hp, tregs + TCVR_BBCLOCK, 1); BB_PUT_BIT()
329 static u32 BB_GET_BIT(struct happy_meal *hp, void __iomem *tregs, int internal)
333 hme_write32(hp, tregs + TCVR_BBCLOCK, 0);
334 hme_write32(hp, tregs + TCVR_BBCLOCK, 1);
335 ret = hme_read32(hp, tregs + TCVR_CFG);
345 static u32 BB_GET_BIT2(struct happy_meal *hp, void __iomem *tregs, int internal) BB_GET_BIT2() argument
349 hme_write32(hp, tregs + TCVR_BBCLOCK, 0); BB_GET_BIT2()
351 retval = hme_read32(hp, tregs + TCVR_CFG); BB_GET_BIT2()
356 hme_write32(hp, tregs + TCVR_BBCLOCK, 1); BB_GET_BIT2()
363 static int happy_meal_bb_read(struct happy_meal *hp, happy_meal_bb_read() argument
373 hme_write32(hp, tregs + TCVR_BBOENAB, 1); happy_meal_bb_read()
377 BB_PUT_BIT(hp, tregs, 1); happy_meal_bb_read()
380 BB_PUT_BIT(hp, tregs, 0); happy_meal_bb_read()
381 BB_PUT_BIT(hp, tregs, 1); happy_meal_bb_read()
382 BB_PUT_BIT(hp, tregs, 1); happy_meal_bb_read()
383 BB_PUT_BIT(hp, tregs, 0); happy_meal_bb_read()
386 tmp = hp->paddr & 0xff; happy_meal_bb_read()
388 BB_PUT_BIT(hp, tregs, ((tmp >> i) & 1)); happy_meal_bb_read()
393 BB_PUT_BIT(hp, tregs, ((tmp >> i) & 1)); happy_meal_bb_read()
396 hme_write32(hp, tregs + TCVR_BBOENAB, 0); happy_meal_bb_read()
399 (void) BB_GET_BIT2(hp, tregs, (hp->tcvr_type == internal)); happy_meal_bb_read()
401 retval |= BB_GET_BIT2(hp, tregs, (hp->tcvr_type == internal)); happy_meal_bb_read()
402 (void) BB_GET_BIT2(hp, tregs, (hp->tcvr_type == internal)); happy_meal_bb_read()
403 (void) BB_GET_BIT2(hp, tregs, (hp->tcvr_type == internal)); happy_meal_bb_read()
404 (void) BB_GET_BIT2(hp, tregs, (hp->tcvr_type == internal)); happy_meal_bb_read()
409 static void happy_meal_bb_write(struct happy_meal *hp, happy_meal_bb_write() argument
419 hme_write32(hp, tregs + TCVR_BBOENAB, 1); happy_meal_bb_write()
423 BB_PUT_BIT(hp, tregs, 1); happy_meal_bb_write()
426 BB_PUT_BIT(hp, tregs, 0); happy_meal_bb_write()
427 BB_PUT_BIT(hp, tregs, 1); happy_meal_bb_write()
428 BB_PUT_BIT(hp, tregs, 0); happy_meal_bb_write()
429 BB_PUT_BIT(hp, tregs, 1); happy_meal_bb_write()
432 tmp = (hp->paddr & 0xff); happy_meal_bb_write()
434 BB_PUT_BIT(hp, tregs, ((tmp >> i) & 1)); happy_meal_bb_write()
439 BB_PUT_BIT(hp, tregs, ((tmp >> i) & 1)); happy_meal_bb_write()
442 BB_PUT_BIT(hp, tregs, 1); happy_meal_bb_write()
443 BB_PUT_BIT(hp, tregs, 0); happy_meal_bb_write()
446 BB_PUT_BIT(hp, tregs, ((value >> i) & 1)); happy_meal_bb_write()
449 hme_write32(hp, tregs + TCVR_BBOENAB, 0); happy_meal_bb_write()
454 static int happy_meal_tcvr_read(struct happy_meal *hp, happy_meal_tcvr_read() argument
461 if (hp->tcvr_type == none) { happy_meal_tcvr_read()
466 if (!(hp->happy_flags & HFLAG_FENABLE)) { happy_meal_tcvr_read()
468 return happy_meal_bb_read(hp, tregs, reg); happy_meal_tcvr_read()
471 hme_write32(hp, tregs + TCVR_FRAME, happy_meal_tcvr_read()
472 (FRAME_READ | (hp->paddr << 23) | ((reg & 0xff) << 18))); happy_meal_tcvr_read()
473 while (!(hme_read32(hp, tregs + TCVR_FRAME) & 0x10000) && --tries) happy_meal_tcvr_read()
479 retval = hme_read32(hp, tregs + TCVR_FRAME) & 0xffff; happy_meal_tcvr_read()
486 static void happy_meal_tcvr_write(struct happy_meal *hp, happy_meal_tcvr_write() argument
495 if (!(hp->happy_flags & HFLAG_FENABLE)) { happy_meal_tcvr_write()
496 happy_meal_bb_write(hp, tregs, reg, value); happy_meal_tcvr_write()
501 hme_write32(hp, tregs + TCVR_FRAME, happy_meal_tcvr_write()
502 (FRAME_WRITE | (hp->paddr << 23) | happy_meal_tcvr_write()
504 while (!(hme_read32(hp, tregs + TCVR_FRAME) & 0x10000) && --tries) happy_meal_tcvr_write()
546 static int try_next_permutation(struct happy_meal *hp, void __iomem *tregs) try_next_permutation() argument
548 hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, MII_BMCR); try_next_permutation()
553 if (hp->sw_bmcr & BMCR_FULLDPLX) { try_next_permutation()
554 hp->sw_bmcr &= ~(BMCR_FULLDPLX); try_next_permutation()
555 happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr); try_next_permutation()
560 if (hp->sw_bmcr & BMCR_SPEED100) { try_next_permutation()
561 hp->sw_bmcr &= ~(BMCR_SPEED100); try_next_permutation()
562 happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr); try_next_permutation()
570 static void display_link_mode(struct happy_meal *hp, void __iomem *tregs) display_link_mode() argument
572 printk(KERN_INFO "%s: Link is up using ", hp->dev->name); display_link_mode()
573 if (hp->tcvr_type == external) display_link_mode()
578 hp->sw_lpa = happy_meal_tcvr_read(hp, tregs, MII_LPA); display_link_mode()
579 if (hp->sw_lpa & (LPA_100HALF | LPA_100FULL)) { display_link_mode()
580 if (hp->sw_lpa & LPA_100FULL) display_link_mode()
585 if (hp->sw_lpa & LPA_10FULL) display_link_mode()
592 static void display_forced_link_mode(struct happy_meal *hp, void __iomem *tregs) display_forced_link_mode() argument
594 printk(KERN_INFO "%s: Link has been forced up using ", hp->dev->name); display_forced_link_mode()
595 if (hp->tcvr_type == external) display_forced_link_mode()
600 hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, MII_BMCR); display_forced_link_mode()
601 if (hp->sw_bmcr & BMCR_SPEED100) display_forced_link_mode()
605 if (hp->sw_bmcr & BMCR_FULLDPLX) display_forced_link_mode()
611 static int set_happy_link_modes(struct happy_meal *hp, void __iomem *tregs) set_happy_link_modes() argument
618 if (hp->timer_state == arbwait) { set_happy_link_modes()
619 hp->sw_lpa = happy_meal_tcvr_read(hp, tregs, MII_LPA); set_happy_link_modes()
620 if (!(hp->sw_lpa & (LPA_10HALF | LPA_10FULL | LPA_100HALF | LPA_100FULL))) set_happy_link_modes()
622 if (hp->sw_lpa & LPA_100FULL) set_happy_link_modes()
624 else if (hp->sw_lpa & LPA_100HALF) set_happy_link_modes()
626 else if (hp->sw_lpa & LPA_10FULL) set_happy_link_modes()
632 hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, MII_BMCR); set_happy_link_modes()
633 if (hp->sw_bmcr & BMCR_FULLDPLX) set_happy_link_modes()
647 hme_write32(hp, hp->bigmacregs + BMAC_TXCFG, set_happy_link_modes()
648 hme_read32(hp, hp->bigmacregs + BMAC_TXCFG) & set_happy_link_modes()
650 while (hme_read32(hp, hp->bigmacregs + BMAC_TXCFG) & BIGMAC_TXCFG_ENABLE) set_happy_link_modes()
653 hp->happy_flags |= HFLAG_FULL; set_happy_link_modes()
654 hme_write32(hp, hp->bigmacregs + BMAC_TXCFG, set_happy_link_modes()
655 hme_read32(hp, hp->bigmacregs + BMAC_TXCFG) | set_happy_link_modes()
658 hp->happy_flags &= ~(HFLAG_FULL); set_happy_link_modes()
659 hme_write32(hp, hp->bigmacregs + BMAC_TXCFG, set_happy_link_modes()
660 hme_read32(hp, hp->bigmacregs + BMAC_TXCFG) & set_happy_link_modes()
663 hme_write32(hp, hp->bigmacregs + BMAC_TXCFG, set_happy_link_modes()
664 hme_read32(hp, hp->bigmacregs + BMAC_TXCFG) | set_happy_link_modes()
671 static int happy_meal_init(struct happy_meal *hp);
673 static int is_lucent_phy(struct happy_meal *hp) is_lucent_phy() argument
675 void __iomem *tregs = hp->tcvregs; is_lucent_phy()
679 mr2 = happy_meal_tcvr_read(hp, tregs, 2); is_lucent_phy()
680 mr3 = happy_meal_tcvr_read(hp, tregs, 3); is_lucent_phy()
690 struct happy_meal *hp = (struct happy_meal *) data; happy_meal_timer() local
691 void __iomem *tregs = hp->tcvregs; happy_meal_timer()
694 spin_lock_irq(&hp->happy_lock); happy_meal_timer()
696 hp->timer_ticks++; happy_meal_timer()
697 switch(hp->timer_state) { happy_meal_timer()
702 if (hp->timer_ticks >= 10) { happy_meal_timer()
705 hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, MII_BMCR); happy_meal_timer()
707 hp->dev->name); happy_meal_timer()
708 hp->sw_bmcr = BMCR_SPEED100; happy_meal_timer()
709 happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr); happy_meal_timer()
711 if (!is_lucent_phy(hp)) { happy_meal_timer()
716 hp->sw_csconfig = happy_meal_tcvr_read(hp, tregs, DP83840_CSCONFIG); happy_meal_timer()
717 hp->sw_csconfig &= ~(CSCONFIG_TCVDISAB); happy_meal_timer()
718 happy_meal_tcvr_write(hp, tregs, DP83840_CSCONFIG, hp->sw_csconfig); happy_meal_timer()
720 hp->timer_state = ltrywait; happy_meal_timer()
721 hp->timer_ticks = 0; happy_meal_timer()
725 hp->sw_bmsr = happy_meal_tcvr_read(hp, tregs, MII_BMSR); happy_meal_timer()
726 if (hp->sw_bmsr & BMSR_ANEGCOMPLETE) { happy_meal_timer()
730 ret = set_happy_link_modes(hp, tregs); happy_meal_timer()
742 hp->timer_state = lupwait; happy_meal_timer()
756 hp->sw_bmsr = happy_meal_tcvr_read(hp, tregs, MII_BMSR); happy_meal_timer()
757 if (hp->sw_bmsr & BMSR_LSTATUS) { happy_meal_timer()
761 display_link_mode(hp, tregs); happy_meal_timer()
762 hp->timer_state = asleep; happy_meal_timer()
765 if (hp->timer_ticks >= 10) { happy_meal_timer()
767 "not completely up.\n", hp->dev->name); happy_meal_timer()
768 hp->timer_ticks = 0; happy_meal_timer()
782 hp->sw_bmsr = happy_meal_tcvr_read(hp, tregs, MII_BMSR); happy_meal_timer()
783 hp->sw_csconfig = happy_meal_tcvr_read(hp, tregs, DP83840_CSCONFIG); happy_meal_timer()
784 if (hp->timer_ticks == 1) { happy_meal_timer()
785 if (!is_lucent_phy(hp)) { happy_meal_timer()
789 hp->sw_csconfig |= CSCONFIG_TCVDISAB; happy_meal_timer()
790 happy_meal_tcvr_write(hp, tregs, happy_meal_timer()
791 DP83840_CSCONFIG, hp->sw_csconfig); happy_meal_timer()
796 if (hp->timer_ticks == 2) { happy_meal_timer()
797 if (!is_lucent_phy(hp)) { happy_meal_timer()
798 hp->sw_csconfig &= ~(CSCONFIG_TCVDISAB); happy_meal_timer()
799 happy_meal_tcvr_write(hp, tregs, happy_meal_timer()
800 DP83840_CSCONFIG, hp->sw_csconfig); happy_meal_timer()
805 if (hp->sw_bmsr & BMSR_LSTATUS) { happy_meal_timer()
807 display_forced_link_mode(hp, tregs); happy_meal_timer()
808 set_happy_link_modes(hp, tregs); /* XXX error? then what? */ happy_meal_timer()
809 hp->timer_state = asleep; happy_meal_timer()
812 if (hp->timer_ticks >= 4) { /* 6 seconds or so... */ happy_meal_timer()
815 ret = try_next_permutation(hp, tregs); happy_meal_timer()
823 hp->dev->name); happy_meal_timer()
825 ret = happy_meal_init(hp); happy_meal_timer()
829 "Happy Meal.\n", hp->dev->name); happy_meal_timer()
833 if (!is_lucent_phy(hp)) { happy_meal_timer()
834 hp->sw_csconfig = happy_meal_tcvr_read(hp, tregs, happy_meal_timer()
836 hp->sw_csconfig |= CSCONFIG_TCVDISAB; happy_meal_timer()
837 happy_meal_tcvr_write(hp, tregs, happy_meal_timer()
838 DP83840_CSCONFIG, hp->sw_csconfig); happy_meal_timer()
840 hp->timer_ticks = 0; happy_meal_timer()
852 hp->dev->name); happy_meal_timer()
854 hp->timer_ticks = 0; happy_meal_timer()
855 hp->timer_state = asleep; /* foo on you */ happy_meal_timer()
860 hp->happy_timer.expires = jiffies + ((12 * HZ)/10); /* 1.2 sec. */ happy_meal_timer()
861 add_timer(&hp->happy_timer); happy_meal_timer()
865 spin_unlock_irq(&hp->happy_lock); happy_meal_timer()
871 /* hp->happy_lock must be held */ happy_meal_tx_reset()
872 static void happy_meal_tx_reset(struct happy_meal *hp, void __iomem *bregs) happy_meal_tx_reset() argument
879 hme_write32(hp, bregs + BMAC_TXSWRESET, 0); happy_meal_tx_reset()
880 while ((hme_read32(hp, bregs + BMAC_TXSWRESET) & 1) && --tries) happy_meal_tx_reset()
891 /* hp->happy_lock must be held */ happy_meal_rx_reset()
892 static void happy_meal_rx_reset(struct happy_meal *hp, void __iomem *bregs) happy_meal_rx_reset() argument
899 hme_write32(hp, bregs + BMAC_RXSWRESET, 0); happy_meal_rx_reset()
900 while ((hme_read32(hp, bregs + BMAC_RXSWRESET) & 1) && --tries) happy_meal_rx_reset()
913 /* hp->happy_lock must be held */ happy_meal_stop()
914 static void happy_meal_stop(struct happy_meal *hp, void __iomem *gregs) happy_meal_stop() argument
921 hme_write32(hp, gregs + GREG_SWRESET, GREG_RESET_ALL); happy_meal_stop()
922 while (hme_read32(hp, gregs + GREG_SWRESET) && --tries) happy_meal_stop()
933 /* hp->happy_lock must be held */ happy_meal_get_counters()
934 static void happy_meal_get_counters(struct happy_meal *hp, void __iomem *bregs) happy_meal_get_counters() argument
936 struct net_device_stats *stats = &hp->net_stats; happy_meal_get_counters()
938 stats->rx_crc_errors += hme_read32(hp, bregs + BMAC_RCRCECTR); happy_meal_get_counters()
939 hme_write32(hp, bregs + BMAC_RCRCECTR, 0); happy_meal_get_counters()
941 stats->rx_frame_errors += hme_read32(hp, bregs + BMAC_UNALECTR); happy_meal_get_counters()
942 hme_write32(hp, bregs + BMAC_UNALECTR, 0); happy_meal_get_counters()
944 stats->rx_length_errors += hme_read32(hp, bregs + BMAC_GLECTR); happy_meal_get_counters()
945 hme_write32(hp, bregs + BMAC_GLECTR, 0); happy_meal_get_counters()
947 stats->tx_aborted_errors += hme_read32(hp, bregs + BMAC_EXCTR); happy_meal_get_counters()
950 (hme_read32(hp, bregs + BMAC_EXCTR) + happy_meal_get_counters()
951 hme_read32(hp, bregs + BMAC_LTCTR)); happy_meal_get_counters()
952 hme_write32(hp, bregs + BMAC_EXCTR, 0); happy_meal_get_counters()
953 hme_write32(hp, bregs + BMAC_LTCTR, 0); happy_meal_get_counters()
956 /* hp->happy_lock must be held */ happy_meal_poll_stop()
957 static void happy_meal_poll_stop(struct happy_meal *hp, void __iomem *tregs) happy_meal_poll_stop() argument
962 if ((hp->happy_flags & (HFLAG_POLLENABLE | HFLAG_POLL)) != happy_meal_poll_stop()
970 hme_write32(hp, tregs + TCVR_IMASK, 0xffff); happy_meal_poll_stop()
974 hme_write32(hp, tregs + TCVR_CFG, happy_meal_poll_stop()
975 hme_read32(hp, tregs + TCVR_CFG) & ~(TCV_CFG_PENABLE)); happy_meal_poll_stop()
978 hp->happy_flags &= ~(HFLAG_POLL); happy_meal_poll_stop()
991 /* hp->happy_lock must be held */ happy_meal_tcvr_reset()
992 static int happy_meal_tcvr_reset(struct happy_meal *hp, void __iomem *tregs) happy_meal_tcvr_reset() argument
997 tconfig = hme_read32(hp, tregs + TCVR_CFG); happy_meal_tcvr_reset()
999 if (hp->tcvr_type == external) { happy_meal_tcvr_reset()
1001 hme_write32(hp, tregs + TCVR_CFG, tconfig & ~(TCV_CFG_PSELECT)); happy_meal_tcvr_reset()
1002 hp->tcvr_type = internal; happy_meal_tcvr_reset()
1003 hp->paddr = TCV_PADDR_ITX; happy_meal_tcvr_reset()
1005 happy_meal_tcvr_write(hp, tregs, MII_BMCR, happy_meal_tcvr_reset()
1007 result = happy_meal_tcvr_read(hp, tregs, MII_BMCR); happy_meal_tcvr_reset()
1013 hme_write32(hp, tregs + TCVR_CFG, tconfig | TCV_CFG_PSELECT); happy_meal_tcvr_reset()
1014 hp->tcvr_type = external; happy_meal_tcvr_reset()
1015 hp->paddr = TCV_PADDR_ETX; happy_meal_tcvr_reset()
1019 hme_write32(hp, tregs + TCVR_CFG, (tconfig | TCV_CFG_PSELECT)); happy_meal_tcvr_reset()
1021 happy_meal_tcvr_write(hp, tregs, MII_BMCR, happy_meal_tcvr_reset()
1023 result = happy_meal_tcvr_read(hp, tregs, MII_BMCR); happy_meal_tcvr_reset()
1029 hme_write32(hp, tregs + TCVR_CFG, (tconfig & ~(TCV_CFG_PSELECT))); happy_meal_tcvr_reset()
1030 hp->tcvr_type = internal; happy_meal_tcvr_reset()
1031 hp->paddr = TCV_PADDR_ITX; happy_meal_tcvr_reset()
1036 happy_meal_tcvr_write(hp, tregs, MII_BMCR, BMCR_RESET); happy_meal_tcvr_reset()
1039 result = happy_meal_tcvr_read(hp, tregs, MII_BMCR); happy_meal_tcvr_reset()
1042 hp->sw_bmcr = result; happy_meal_tcvr_reset()
1054 hp->sw_bmsr = happy_meal_tcvr_read(hp, tregs, MII_BMSR); happy_meal_tcvr_reset()
1055 hp->sw_physid1 = happy_meal_tcvr_read(hp, tregs, MII_PHYSID1); happy_meal_tcvr_reset()
1056 hp->sw_physid2 = happy_meal_tcvr_read(hp, tregs, MII_PHYSID2); happy_meal_tcvr_reset()
1057 hp->sw_advertise = happy_meal_tcvr_read(hp, tregs, MII_ADVERTISE); happy_meal_tcvr_reset()
1060 hp->sw_bmcr &= ~(BMCR_ISOLATE); happy_meal_tcvr_reset()
1061 happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr); happy_meal_tcvr_reset()
1065 result = happy_meal_tcvr_read(hp, tregs, MII_BMCR); happy_meal_tcvr_reset()
1077 if (!is_lucent_phy(hp)) { happy_meal_tcvr_reset()
1078 result = happy_meal_tcvr_read(hp, tregs, happy_meal_tcvr_reset()
1080 happy_meal_tcvr_write(hp, tregs, happy_meal_tcvr_reset()
1088 * hp->happy_lock must be held
1090 static void happy_meal_transceiver_check(struct happy_meal *hp, void __iomem *tregs) happy_meal_transceiver_check() argument
1092 unsigned long tconfig = hme_read32(hp, tregs + TCVR_CFG); happy_meal_transceiver_check()
1095 if (hp->happy_flags & HFLAG_POLL) { happy_meal_transceiver_check()
1098 if (hp->tcvr_type == internal) { happy_meal_transceiver_check()
1101 happy_meal_poll_stop(hp, tregs); happy_meal_transceiver_check()
1102 hp->paddr = TCV_PADDR_ETX; happy_meal_transceiver_check()
1103 hp->tcvr_type = external; happy_meal_transceiver_check()
1107 hme_write32(hp, tregs + TCVR_CFG, tconfig); happy_meal_transceiver_check()
1110 if (hp->tcvr_type == external) { happy_meal_transceiver_check()
1112 if (!(hme_read32(hp, tregs + TCVR_STATUS) >> 16)) { happy_meal_transceiver_check()
1114 happy_meal_poll_stop(hp, tregs); happy_meal_transceiver_check()
1115 hp->paddr = TCV_PADDR_ITX; happy_meal_transceiver_check()
1116 hp->tcvr_type = internal; happy_meal_transceiver_check()
1118 hme_write32(hp, tregs + TCVR_CFG, happy_meal_transceiver_check()
1119 hme_read32(hp, tregs + TCVR_CFG) & happy_meal_transceiver_check()
1128 u32 reread = hme_read32(hp, tregs + TCVR_CFG); happy_meal_transceiver_check()
1133 hme_write32(hp, tregs + TCVR_CFG, tconfig | TCV_CFG_PSELECT); happy_meal_transceiver_check()
1134 hp->paddr = TCV_PADDR_ETX; happy_meal_transceiver_check()
1135 hp->tcvr_type = external; happy_meal_transceiver_check()
1139 hme_write32(hp, tregs + TCVR_CFG, happy_meal_transceiver_check()
1141 hp->paddr = TCV_PADDR_ITX; happy_meal_transceiver_check()
1142 hp->tcvr_type = internal; happy_meal_transceiver_check()
1146 hp->tcvr_type = none; /* Grrr... */ happy_meal_transceiver_check()
1197 static void happy_meal_clean_rings(struct happy_meal *hp) happy_meal_clean_rings() argument
1202 if (hp->rx_skbs[i] != NULL) { happy_meal_clean_rings()
1203 struct sk_buff *skb = hp->rx_skbs[i]; happy_meal_clean_rings()
1207 rxd = &hp->happy_block->happy_meal_rxd[i]; happy_meal_clean_rings()
1208 dma_addr = hme_read_desc32(hp, &rxd->rx_addr); happy_meal_clean_rings()
1209 dma_unmap_single(hp->dma_dev, dma_addr, happy_meal_clean_rings()
1212 hp->rx_skbs[i] = NULL; happy_meal_clean_rings()
1217 if (hp->tx_skbs[i] != NULL) { happy_meal_clean_rings()
1218 struct sk_buff *skb = hp->tx_skbs[i]; happy_meal_clean_rings()
1223 hp->tx_skbs[i] = NULL; happy_meal_clean_rings()
1226 txd = &hp->happy_block->happy_meal_txd[i]; happy_meal_clean_rings()
1227 dma_addr = hme_read_desc32(hp, &txd->tx_addr); happy_meal_clean_rings()
1229 dma_unmap_single(hp->dma_dev, dma_addr, happy_meal_clean_rings()
1230 (hme_read_desc32(hp, &txd->tx_flags) happy_meal_clean_rings()
1234 dma_unmap_page(hp->dma_dev, dma_addr, happy_meal_clean_rings()
1235 (hme_read_desc32(hp, &txd->tx_flags) happy_meal_clean_rings()
1248 /* hp->happy_lock must be held */ happy_meal_init_rings()
1249 static void happy_meal_init_rings(struct happy_meal *hp) happy_meal_init_rings() argument
1251 struct hmeal_init_block *hb = hp->happy_block; happy_meal_init_rings()
1255 hp->rx_new = hp->rx_old = hp->tx_new = hp->tx_old = 0; happy_meal_init_rings()
1259 happy_meal_clean_rings(hp); happy_meal_init_rings()
1269 hme_write_rxd(hp, &hb->happy_meal_rxd[i], 0, 0); happy_meal_init_rings()
1272 hp->rx_skbs[i] = skb; happy_meal_init_rings()
1276 mapping = dma_map_single(hp->dma_dev, skb->data, RX_BUF_ALLOC_SIZE, happy_meal_init_rings()
1278 if (dma_mapping_error(hp->dma_dev, mapping)) { happy_meal_init_rings()
1280 hme_write_rxd(hp, &hb->happy_meal_rxd[i], 0, 0); happy_meal_init_rings()
1283 hme_write_rxd(hp, &hb->happy_meal_rxd[i], happy_meal_init_rings()
1291 hme_write_txd(hp, &hb->happy_meal_txd[i], 0, 0); happy_meal_init_rings()
1296 /* hp->happy_lock must be held */ happy_meal_begin_auto_negotiation()
1297 static void happy_meal_begin_auto_negotiation(struct happy_meal *hp, happy_meal_begin_auto_negotiation() argument
1304 hp->sw_bmsr = happy_meal_tcvr_read(hp, tregs, MII_BMSR); happy_meal_begin_auto_negotiation()
1305 hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, MII_BMCR); happy_meal_begin_auto_negotiation()
1306 hp->sw_physid1 = happy_meal_tcvr_read(hp, tregs, MII_PHYSID1); happy_meal_begin_auto_negotiation()
1307 hp->sw_physid2 = happy_meal_tcvr_read(hp, tregs, MII_PHYSID2); happy_meal_begin_auto_negotiation()
1311 hp->sw_advertise = happy_meal_tcvr_read(hp, tregs, MII_ADVERTISE); happy_meal_begin_auto_negotiation()
1314 if (hp->sw_bmsr & BMSR_10HALF) happy_meal_begin_auto_negotiation()
1315 hp->sw_advertise |= (ADVERTISE_10HALF); happy_meal_begin_auto_negotiation()
1317 hp->sw_advertise &= ~(ADVERTISE_10HALF); happy_meal_begin_auto_negotiation()
1319 if (hp->sw_bmsr & BMSR_10FULL) happy_meal_begin_auto_negotiation()
1320 hp->sw_advertise |= (ADVERTISE_10FULL); happy_meal_begin_auto_negotiation()
1322 hp->sw_advertise &= ~(ADVERTISE_10FULL); happy_meal_begin_auto_negotiation()
1323 if (hp->sw_bmsr & BMSR_100HALF) happy_meal_begin_auto_negotiation()
1324 hp->sw_advertise |= (ADVERTISE_100HALF); happy_meal_begin_auto_negotiation()
1326 hp->sw_advertise &= ~(ADVERTISE_100HALF); happy_meal_begin_auto_negotiation()
1327 if (hp->sw_bmsr & BMSR_100FULL) happy_meal_begin_auto_negotiation()
1328 hp->sw_advertise |= (ADVERTISE_100FULL); happy_meal_begin_auto_negotiation()
1330 hp->sw_advertise &= ~(ADVERTISE_100FULL); happy_meal_begin_auto_negotiation()
1331 happy_meal_tcvr_write(hp, tregs, MII_ADVERTISE, hp->sw_advertise); happy_meal_begin_auto_negotiation()
1340 ASD(("%s: Advertising [ ", hp->dev->name)); happy_meal_begin_auto_negotiation()
1341 if (hp->sw_advertise & ADVERTISE_10HALF) happy_meal_begin_auto_negotiation()
1343 if (hp->sw_advertise & ADVERTISE_10FULL) happy_meal_begin_auto_negotiation()
1345 if (hp->sw_advertise & ADVERTISE_100HALF) happy_meal_begin_auto_negotiation()
1347 if (hp->sw_advertise & ADVERTISE_100FULL) happy_meal_begin_auto_negotiation()
1352 hp->sw_bmcr |= BMCR_ANENABLE; happy_meal_begin_auto_negotiation()
1353 happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr); happy_meal_begin_auto_negotiation()
1356 hp->sw_bmcr |= BMCR_ANRESTART; happy_meal_begin_auto_negotiation()
1357 happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr); happy_meal_begin_auto_negotiation()
1363 hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, MII_BMCR); happy_meal_begin_auto_negotiation()
1364 if (!(hp->sw_bmcr & BMCR_ANRESTART)) happy_meal_begin_auto_negotiation()
1370 "BMCR=0x%04x\n", hp->dev->name, hp->sw_bmcr); happy_meal_begin_auto_negotiation()
1372 hp->dev->name); happy_meal_begin_auto_negotiation()
1375 hp->timer_state = arbwait; happy_meal_begin_auto_negotiation()
1388 hp->sw_bmcr = BMCR_SPEED100; happy_meal_begin_auto_negotiation()
1391 hp->sw_bmcr = BMCR_SPEED100; happy_meal_begin_auto_negotiation()
1393 hp->sw_bmcr = 0; happy_meal_begin_auto_negotiation()
1395 hp->sw_bmcr |= BMCR_FULLDPLX; happy_meal_begin_auto_negotiation()
1397 happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr); happy_meal_begin_auto_negotiation()
1399 if (!is_lucent_phy(hp)) { happy_meal_begin_auto_negotiation()
1404 hp->sw_csconfig = happy_meal_tcvr_read(hp, tregs, happy_meal_begin_auto_negotiation()
1406 hp->sw_csconfig &= ~(CSCONFIG_TCVDISAB); happy_meal_begin_auto_negotiation()
1407 happy_meal_tcvr_write(hp, tregs, DP83840_CSCONFIG, happy_meal_begin_auto_negotiation()
1408 hp->sw_csconfig); happy_meal_begin_auto_negotiation()
1410 hp->timer_state = ltrywait; happy_meal_begin_auto_negotiation()
1413 hp->timer_ticks = 0; happy_meal_begin_auto_negotiation()
1414 hp->happy_timer.expires = jiffies + (12 * HZ)/10; /* 1.2 sec. */ happy_meal_begin_auto_negotiation()
1415 hp->happy_timer.data = (unsigned long) hp; happy_meal_begin_auto_negotiation()
1416 hp->happy_timer.function = happy_meal_timer; happy_meal_begin_auto_negotiation()
1417 add_timer(&hp->happy_timer); happy_meal_begin_auto_negotiation()
1420 /* hp->happy_lock must be held */ happy_meal_init()
1421 static int happy_meal_init(struct happy_meal *hp) happy_meal_init() argument
1423 void __iomem *gregs = hp->gregs; happy_meal_init()
1424 void __iomem *etxregs = hp->etxregs; happy_meal_init()
1425 void __iomem *erxregs = hp->erxregs; happy_meal_init()
1426 void __iomem *bregs = hp->bigmacregs; happy_meal_init()
1427 void __iomem *tregs = hp->tcvregs; happy_meal_init()
1429 unsigned char *e = &hp->dev->dev_addr[0]; happy_meal_init()
1432 del_timer(&hp->happy_timer); happy_meal_init()
1435 hp->happy_flags)); happy_meal_init()
1436 if (!(hp->happy_flags & HFLAG_INIT)) { happy_meal_init()
1438 hp->happy_flags |= HFLAG_INIT; happy_meal_init()
1439 happy_meal_get_counters(hp, bregs); happy_meal_init()
1444 happy_meal_poll_stop(hp, tregs); happy_meal_init()
1448 happy_meal_stop(hp, gregs); happy_meal_init()
1452 happy_meal_init_rings(hp); happy_meal_init()
1456 hme_read32(hp, tregs + TCVR_IMASK))); happy_meal_init()
1457 hme_write32(hp, tregs + TCVR_IMASK, 0xffff); happy_meal_init()
1460 if (hp->happy_flags & HFLAG_FENABLE) { happy_meal_init()
1462 hme_read32(hp, tregs + TCVR_CFG))); happy_meal_init()
1463 hme_write32(hp, tregs + TCVR_CFG, happy_meal_init()
1464 hme_read32(hp, tregs + TCVR_CFG) & ~(TCV_CFG_BENABLE)); happy_meal_init()
1467 hme_read32(hp, tregs + TCVR_CFG))); happy_meal_init()
1468 hme_write32(hp, tregs + TCVR_CFG, happy_meal_init()
1469 hme_read32(hp, tregs + TCVR_CFG) | TCV_CFG_BENABLE); happy_meal_init()
1474 happy_meal_transceiver_check(hp, tregs); happy_meal_init()
1478 switch(hp->tcvr_type) { happy_meal_init()
1487 hme_write32(hp, bregs + BMAC_XIFCFG, 0); happy_meal_init()
1493 hme_write32(hp, bregs + BMAC_XIFCFG, BIGMAC_XCFG_MIIDISAB); happy_meal_init()
1497 if (happy_meal_tcvr_reset(hp, tregs)) happy_meal_init()
1502 happy_meal_tx_reset(hp, bregs); happy_meal_init()
1503 happy_meal_rx_reset(hp, bregs); happy_meal_init()
1507 hme_write32(hp, bregs + BMAC_JSIZE, DEFAULT_JAMSIZE); happy_meal_init()
1508 hme_write32(hp, bregs + BMAC_IGAP1, DEFAULT_IPG1); happy_meal_init()
1509 hme_write32(hp, bregs + BMAC_IGAP2, DEFAULT_IPG2); happy_meal_init()
1515 hme_write32(hp, bregs + BMAC_RSEED, ((e[5] | e[4]<<8)&0x3ff)); happy_meal_init()
1517 hme_write32(hp, bregs + BMAC_MACADDR2, ((e[4] << 8) | e[5])); happy_meal_init()
1518 hme_write32(hp, bregs + BMAC_MACADDR1, ((e[2] << 8) | e[3])); happy_meal_init()
1519 hme_write32(hp, bregs + BMAC_MACADDR0, ((e[0] << 8) | e[1])); happy_meal_init()
1522 if ((hp->dev->flags & IFF_ALLMULTI) || happy_meal_init()
1523 (netdev_mc_count(hp->dev) > 64)) { happy_meal_init()
1524 hme_write32(hp, bregs + BMAC_HTABLE0, 0xffff); happy_meal_init()
1525 hme_write32(hp, bregs + BMAC_HTABLE1, 0xffff); happy_meal_init()
1526 hme_write32(hp, bregs + BMAC_HTABLE2, 0xffff); happy_meal_init()
1527 hme_write32(hp, bregs + BMAC_HTABLE3, 0xffff); happy_meal_init()
1528 } else if ((hp->dev->flags & IFF_PROMISC) == 0) { happy_meal_init()
1534 netdev_for_each_mc_addr(ha, hp->dev) { happy_meal_init()
1539 hme_write32(hp, bregs + BMAC_HTABLE0, hash_table[0]); happy_meal_init()
1540 hme_write32(hp, bregs + BMAC_HTABLE1, hash_table[1]); happy_meal_init()
1541 hme_write32(hp, bregs + BMAC_HTABLE2, hash_table[2]); happy_meal_init()
1542 hme_write32(hp, bregs + BMAC_HTABLE3, hash_table[3]); happy_meal_init()
1544 hme_write32(hp, bregs + BMAC_HTABLE3, 0); happy_meal_init()
1545 hme_write32(hp, bregs + BMAC_HTABLE2, 0); happy_meal_init()
1546 hme_write32(hp, bregs + BMAC_HTABLE1, 0); happy_meal_init()
1547 hme_write32(hp, bregs + BMAC_HTABLE0, 0); happy_meal_init()
1552 ((__u32)hp->hblock_dvma + hblock_offset(happy_meal_rxd, 0)), happy_meal_init()
1553 ((__u32)hp->hblock_dvma + hblock_offset(happy_meal_txd, 0)))); happy_meal_init()
1554 hme_write32(hp, erxregs + ERX_RING, happy_meal_init()
1555 ((__u32)hp->hblock_dvma + hblock_offset(happy_meal_rxd, 0))); happy_meal_init()
1556 hme_write32(hp, etxregs + ETX_RING, happy_meal_init()
1557 ((__u32)hp->hblock_dvma + hblock_offset(happy_meal_txd, 0))); happy_meal_init()
1564 if (hme_read32(hp, erxregs + ERX_RING) != happy_meal_init()
1565 ((__u32)hp->hblock_dvma + hblock_offset(happy_meal_rxd, 0))) happy_meal_init()
1566 hme_write32(hp, erxregs + ERX_RING, happy_meal_init()
1567 ((__u32)hp->hblock_dvma + hblock_offset(happy_meal_rxd, 0)) happy_meal_init()
1572 hme_read32(hp, gregs + GREG_CFG))); happy_meal_init()
1576 hme_write32(hp, gregs + GREG_CFG, GREG_CFG_BURST64); happy_meal_init()
1578 if ((hp->happy_bursts & DMA_BURST64) && happy_meal_init()
1579 ((hp->happy_flags & HFLAG_PCI) != 0 happy_meal_init()
1591 if ((hp->happy_flags & HFLAG_PCI) == 0) { happy_meal_init()
1592 struct platform_device *op = hp->happy_dev; happy_meal_init()
1595 hp->happy_bursts); happy_meal_init()
1602 hme_write32(hp, gregs + GREG_CFG, gcfg); happy_meal_init()
1603 } else if (hp->happy_bursts & DMA_BURST32) { happy_meal_init()
1605 hme_write32(hp, gregs + GREG_CFG, GREG_CFG_BURST32); happy_meal_init()
1606 } else if (hp->happy_bursts & DMA_BURST16) { happy_meal_init()
1608 hme_write32(hp, gregs + GREG_CFG, GREG_CFG_BURST16); happy_meal_init()
1611 hme_write32(hp, gregs + GREG_CFG, 0); happy_meal_init()
1617 hme_write32(hp, gregs + GREG_IMASK, happy_meal_init()
1623 hme_read32(hp, etxregs + ETX_RSIZE))); happy_meal_init()
1624 hme_write32(hp, etxregs + ETX_RSIZE, (TX_RING_SIZE >> ETX_RSIZE_SHIFT) - 1); happy_meal_init()
1628 hme_read32(hp, etxregs + ETX_CFG))); happy_meal_init()
1629 hme_write32(hp, etxregs + ETX_CFG, happy_meal_init()
1630 hme_read32(hp, etxregs + ETX_CFG) | ETX_CFG_DMAENABLE); happy_meal_init()
1638 hme_read32(hp, erxregs + ERX_CFG))); happy_meal_init()
1639 hme_write32(hp, erxregs + ERX_CFG, ERX_CFG_DEFAULT(RX_OFFSET)); happy_meal_init()
1640 regtmp = hme_read32(hp, erxregs + ERX_CFG); happy_meal_init()
1641 hme_write32(hp, erxregs + ERX_CFG, ERX_CFG_DEFAULT(RX_OFFSET)); happy_meal_init()
1642 if (hme_read32(hp, erxregs + ERX_CFG) != ERX_CFG_DEFAULT(RX_OFFSET)) { happy_meal_init()
1651 hme_read32(hp, bregs + BMAC_RXCFG))); happy_meal_init()
1653 if (hp->dev->flags & IFF_PROMISC) happy_meal_init()
1655 hme_write32(hp, bregs + BMAC_RXCFG, rxcfg); happy_meal_init()
1663 if (hp->happy_flags & HFLAG_FULL) happy_meal_init()
1669 hme_write32(hp, bregs + BMAC_TXCFG, regtmp /*| BIGMAC_TXCFG_DGIVEUP*/); happy_meal_init()
1672 hme_write32(hp, bregs + BMAC_ALIMIT, 16); happy_meal_init()
1678 if (hp->happy_flags & HFLAG_LANCE) happy_meal_init()
1682 if (hp->tcvr_type == external) happy_meal_init()
1686 hme_read32(hp, bregs + BMAC_XIFCFG))); happy_meal_init()
1687 hme_write32(hp, bregs + BMAC_XIFCFG, regtmp); happy_meal_init()
1691 hme_read32(hp, bregs + BMAC_TXCFG), happy_meal_init()
1692 hme_read32(hp, bregs + BMAC_RXCFG))); happy_meal_init()
1695 hme_write32(hp, bregs + BMAC_TXMAX, ETH_FRAME_LEN + 8); happy_meal_init()
1696 hme_write32(hp, bregs + BMAC_RXMAX, ETH_FRAME_LEN + 8); happy_meal_init()
1698 hme_write32(hp, bregs + BMAC_TXCFG, happy_meal_init()
1699 hme_read32(hp, bregs + BMAC_TXCFG) | BIGMAC_TXCFG_ENABLE); happy_meal_init()
1700 hme_write32(hp, bregs + BMAC_RXCFG, happy_meal_init()
1701 hme_read32(hp, bregs + BMAC_RXCFG) | BIGMAC_RXCFG_ENABLE); happy_meal_init()
1704 happy_meal_begin_auto_negotiation(hp, tregs, NULL); happy_meal_init()
1710 /* hp->happy_lock must be held */ happy_meal_set_initial_advertisement()
1711 static void happy_meal_set_initial_advertisement(struct happy_meal *hp) happy_meal_set_initial_advertisement() argument
1713 void __iomem *tregs = hp->tcvregs; happy_meal_set_initial_advertisement()
1714 void __iomem *bregs = hp->bigmacregs; happy_meal_set_initial_advertisement()
1715 void __iomem *gregs = hp->gregs; happy_meal_set_initial_advertisement()
1717 happy_meal_stop(hp, gregs); happy_meal_set_initial_advertisement()
1718 hme_write32(hp, tregs + TCVR_IMASK, 0xffff); happy_meal_set_initial_advertisement()
1719 if (hp->happy_flags & HFLAG_FENABLE) happy_meal_set_initial_advertisement()
1720 hme_write32(hp, tregs + TCVR_CFG, happy_meal_set_initial_advertisement()
1721 hme_read32(hp, tregs + TCVR_CFG) & ~(TCV_CFG_BENABLE)); happy_meal_set_initial_advertisement()
1723 hme_write32(hp, tregs + TCVR_CFG, happy_meal_set_initial_advertisement()
1724 hme_read32(hp, tregs + TCVR_CFG) | TCV_CFG_BENABLE); happy_meal_set_initial_advertisement()
1725 happy_meal_transceiver_check(hp, tregs); happy_meal_set_initial_advertisement()
1726 switch(hp->tcvr_type) { happy_meal_set_initial_advertisement()
1730 hme_write32(hp, bregs + BMAC_XIFCFG, 0); happy_meal_set_initial_advertisement()
1733 hme_write32(hp, bregs + BMAC_XIFCFG, BIGMAC_XCFG_MIIDISAB); happy_meal_set_initial_advertisement()
1736 if (happy_meal_tcvr_reset(hp, tregs)) happy_meal_set_initial_advertisement()
1740 hp->sw_bmsr = happy_meal_tcvr_read(hp, tregs, MII_BMSR); happy_meal_set_initial_advertisement()
1741 hp->sw_advertise = happy_meal_tcvr_read(hp, tregs, MII_ADVERTISE); happy_meal_set_initial_advertisement()
1744 if (hp->sw_bmsr & BMSR_10HALF) happy_meal_set_initial_advertisement()
1745 hp->sw_advertise |= (ADVERTISE_10HALF); happy_meal_set_initial_advertisement()
1747 hp->sw_advertise &= ~(ADVERTISE_10HALF); happy_meal_set_initial_advertisement()
1749 if (hp->sw_bmsr & BMSR_10FULL) happy_meal_set_initial_advertisement()
1750 hp->sw_advertise |= (ADVERTISE_10FULL); happy_meal_set_initial_advertisement()
1752 hp->sw_advertise &= ~(ADVERTISE_10FULL); happy_meal_set_initial_advertisement()
1753 if (hp->sw_bmsr & BMSR_100HALF) happy_meal_set_initial_advertisement()
1754 hp->sw_advertise |= (ADVERTISE_100HALF); happy_meal_set_initial_advertisement()
1756 hp->sw_advertise &= ~(ADVERTISE_100HALF); happy_meal_set_initial_advertisement()
1757 if (hp->sw_bmsr & BMSR_100FULL) happy_meal_set_initial_advertisement()
1758 hp->sw_advertise |= (ADVERTISE_100FULL); happy_meal_set_initial_advertisement()
1760 hp->sw_advertise &= ~(ADVERTISE_100FULL); happy_meal_set_initial_advertisement()
1763 happy_meal_tcvr_write(hp, tregs, MII_ADVERTISE, hp->sw_advertise); happy_meal_set_initial_advertisement()
1769 * hp->happy_lock must be held
1771 static int happy_meal_is_not_so_happy(struct happy_meal *hp, u32 status) happy_meal_is_not_so_happy() argument
1783 hp->dev->name, status); happy_meal_is_not_so_happy()
1788 printk(KERN_DEBUG "%s: Happy Meal receive FIFO overflow.\n", hp->dev->name); happy_meal_is_not_so_happy()
1793 printk(KERN_ERR "%s: Happy Meal BigMAC SQE test failed.\n", hp->dev->name); happy_meal_is_not_so_happy()
1800 hp->dev->name); happy_meal_is_not_so_happy()
1808 printk(KERN_ERR "%s: Happy Meal MAX Packet size error.\n", hp->dev->name); happy_meal_is_not_so_happy()
1820 hp->dev->name); happy_meal_is_not_so_happy()
1825 printk(KERN_ERR "%s: Happy Meal rx DMA errors [ ", hp->dev->name); happy_meal_is_not_so_happy()
1841 hp->dev->name); happy_meal_is_not_so_happy()
1847 printk(KERN_ERR "%s: Happy Meal MIF interrupt.\n", hp->dev->name); happy_meal_is_not_so_happy()
1853 printk(KERN_ERR "%s: Happy Meal tx DMA errors [ ", hp->dev->name); happy_meal_is_not_so_happy()
1871 hp->dev->name, happy_meal_is_not_so_happy()
1877 printk(KERN_NOTICE "%s: Resetting...\n", hp->dev->name); happy_meal_is_not_so_happy()
1878 happy_meal_init(hp); happy_meal_is_not_so_happy()
1884 /* hp->happy_lock must be held */ happy_meal_mif_interrupt()
1885 static void happy_meal_mif_interrupt(struct happy_meal *hp) happy_meal_mif_interrupt() argument
1887 void __iomem *tregs = hp->tcvregs; happy_meal_mif_interrupt()
1889 printk(KERN_INFO "%s: Link status change.\n", hp->dev->name); happy_meal_mif_interrupt()
1890 hp->sw_bmcr = happy_meal_tcvr_read(hp, tregs, MII_BMCR); happy_meal_mif_interrupt()
1891 hp->sw_lpa = happy_meal_tcvr_read(hp, tregs, MII_LPA); happy_meal_mif_interrupt()
1894 if (hp->sw_lpa & LPA_100FULL) { happy_meal_mif_interrupt()
1895 printk(KERN_INFO "%s: Switching to 100Mbps at full duplex.", hp->dev->name); happy_meal_mif_interrupt()
1896 hp->sw_bmcr |= (BMCR_FULLDPLX | BMCR_SPEED100); happy_meal_mif_interrupt()
1897 } else if (hp->sw_lpa & LPA_100HALF) { happy_meal_mif_interrupt()
1898 printk(KERN_INFO "%s: Switching to 100MBps at half duplex.", hp->dev->name); happy_meal_mif_interrupt()
1899 hp->sw_bmcr |= BMCR_SPEED100; happy_meal_mif_interrupt()
1900 } else if (hp->sw_lpa & LPA_10FULL) { happy_meal_mif_interrupt()
1901 printk(KERN_INFO "%s: Switching to 10MBps at full duplex.", hp->dev->name); happy_meal_mif_interrupt()
1902 hp->sw_bmcr |= BMCR_FULLDPLX; happy_meal_mif_interrupt()
1904 printk(KERN_INFO "%s: Using 10Mbps at half duplex.", hp->dev->name); happy_meal_mif_interrupt()
1906 happy_meal_tcvr_write(hp, tregs, MII_BMCR, hp->sw_bmcr); happy_meal_mif_interrupt()
1909 happy_meal_poll_stop(hp, tregs); happy_meal_mif_interrupt()
1918 /* hp->happy_lock must be held */ happy_meal_tx()
1919 static void happy_meal_tx(struct happy_meal *hp) happy_meal_tx() argument
1921 struct happy_meal_txd *txbase = &hp->happy_block->happy_meal_txd[0]; happy_meal_tx()
1923 struct net_device *dev = hp->dev; happy_meal_tx()
1926 elem = hp->tx_old; happy_meal_tx()
1928 while (elem != hp->tx_new) { happy_meal_tx()
1935 flags = hme_read_desc32(hp, &this->tx_flags); happy_meal_tx()
1938 skb = hp->tx_skbs[elem]; happy_meal_tx()
1944 flags = hme_read_desc32(hp, &txbase[last].tx_flags); happy_meal_tx()
1948 hp->tx_skbs[elem] = NULL; happy_meal_tx()
1949 hp->net_stats.tx_bytes += skb->len; happy_meal_tx()
1952 dma_addr = hme_read_desc32(hp, &this->tx_addr); happy_meal_tx()
1953 dma_len = hme_read_desc32(hp, &this->tx_flags); happy_meal_tx()
1957 dma_unmap_single(hp->dma_dev, dma_addr, dma_len, DMA_TO_DEVICE); happy_meal_tx()
1959 dma_unmap_page(hp->dma_dev, dma_addr, dma_len, DMA_TO_DEVICE); happy_meal_tx()
1966 hp->net_stats.tx_packets++; happy_meal_tx()
1968 hp->tx_old = elem; happy_meal_tx()
1972 TX_BUFFS_AVAIL(hp) > (MAX_SKB_FRAGS + 1)) happy_meal_tx()
1989 * hp->happy_lock must be held
1991 static void happy_meal_rx(struct happy_meal *hp, struct net_device *dev) happy_meal_rx() argument
1993 struct happy_meal_rxd *rxbase = &hp->happy_block->happy_meal_rxd[0]; happy_meal_rx()
1995 int elem = hp->rx_new, drops = 0; happy_meal_rx()
2000 while (!((flags = hme_read_desc32(hp, &this->rx_flags)) & RXFLAG_OWN)) { happy_meal_rx()
2004 u32 dma_addr = hme_read_desc32(hp, &this->rx_addr); happy_meal_rx()
2011 hp->net_stats.rx_errors++; happy_meal_rx()
2013 hp->net_stats.rx_length_errors++; happy_meal_rx()
2015 hp->net_stats.rx_over_errors++; happy_meal_rx()
2016 hp->net_stats.rx_fifo_errors++; happy_meal_rx()
2021 hp->net_stats.rx_dropped++; happy_meal_rx()
2022 hme_write_rxd(hp, this, happy_meal_rx()
2027 skb = hp->rx_skbs[elem]; happy_meal_rx()
2039 mapping = dma_map_single(hp->dma_dev, new_skb->data, happy_meal_rx()
2042 if (unlikely(dma_mapping_error(hp->dma_dev, mapping))) { happy_meal_rx()
2048 dma_unmap_single(hp->dma_dev, dma_addr, RX_BUF_ALLOC_SIZE, DMA_FROM_DEVICE); happy_meal_rx()
2049 hp->rx_skbs[elem] = new_skb; happy_meal_rx()
2050 hme_write_rxd(hp, this, happy_meal_rx()
2067 dma_sync_single_for_cpu(hp->dma_dev, dma_addr, len, DMA_FROM_DEVICE); happy_meal_rx()
2069 dma_sync_single_for_device(hp->dma_dev, dma_addr, len, DMA_FROM_DEVICE); happy_meal_rx()
2071 hme_write_rxd(hp, this, happy_meal_rx()
2086 hp->net_stats.rx_packets++; happy_meal_rx()
2087 hp->net_stats.rx_bytes += len; happy_meal_rx()
2092 hp->rx_new = elem; happy_meal_rx()
2094 printk(KERN_INFO "%s: Memory squeeze, deferring packet.\n", hp->dev->name); happy_meal_rx()
2101 struct happy_meal *hp = netdev_priv(dev); happy_meal_interrupt() local
2102 u32 happy_status = hme_read32(hp, hp->gregs + GREG_STAT); happy_meal_interrupt()
2106 spin_lock(&hp->happy_lock); happy_meal_interrupt()
2110 if (happy_meal_is_not_so_happy(hp, /* un- */ happy_status)) happy_meal_interrupt()
2116 happy_meal_mif_interrupt(hp); happy_meal_interrupt()
2121 happy_meal_tx(hp); happy_meal_interrupt()
2126 happy_meal_rx(hp, dev); happy_meal_interrupt()
2131 spin_unlock(&hp->happy_lock); happy_meal_interrupt()
2144 struct happy_meal *hp = netdev_priv(dev); quattro_sbus_interrupt() local
2145 u32 happy_status = hme_read32(hp, hp->gregs + GREG_STAT); quattro_sbus_interrupt()
2155 spin_lock(&hp->happy_lock); quattro_sbus_interrupt()
2159 if (happy_meal_is_not_so_happy(hp, happy_status)) quattro_sbus_interrupt()
2165 happy_meal_mif_interrupt(hp); quattro_sbus_interrupt()
2170 happy_meal_tx(hp); quattro_sbus_interrupt()
2175 happy_meal_rx(hp, dev); quattro_sbus_interrupt()
2179 spin_unlock(&hp->happy_lock); quattro_sbus_interrupt()
2189 struct happy_meal *hp = netdev_priv(dev); happy_meal_open() local
2197 if ((hp->happy_flags & (HFLAG_QUATTRO|HFLAG_PCI)) != HFLAG_QUATTRO) { happy_meal_open()
2198 res = request_irq(hp->irq, happy_meal_interrupt, IRQF_SHARED, happy_meal_open()
2203 hp->irq); happy_meal_open()
2211 spin_lock_irq(&hp->happy_lock); happy_meal_open()
2212 res = happy_meal_init(hp); happy_meal_open()
2213 spin_unlock_irq(&hp->happy_lock); happy_meal_open()
2215 if (res && ((hp->happy_flags & (HFLAG_QUATTRO|HFLAG_PCI)) != HFLAG_QUATTRO)) happy_meal_open()
2216 free_irq(hp->irq, dev); happy_meal_open()
2222 struct happy_meal *hp = netdev_priv(dev); happy_meal_close() local
2224 spin_lock_irq(&hp->happy_lock); happy_meal_close()
2225 happy_meal_stop(hp, hp->gregs); happy_meal_close()
2226 happy_meal_clean_rings(hp); happy_meal_close()
2229 del_timer(&hp->happy_timer); happy_meal_close()
2231 spin_unlock_irq(&hp->happy_lock); happy_meal_close()
2237 if ((hp->happy_flags & (HFLAG_QUATTRO|HFLAG_PCI)) != HFLAG_QUATTRO) happy_meal_close()
2238 free_irq(hp->irq, dev); happy_meal_close()
2251 struct happy_meal *hp = netdev_priv(dev); happy_meal_tx_timeout() local
2256 hme_read32(hp, hp->gregs + GREG_STAT), happy_meal_tx_timeout()
2257 hme_read32(hp, hp->etxregs + ETX_CFG), happy_meal_tx_timeout()
2258 hme_read32(hp, hp->bigmacregs + BMAC_TXCFG)); happy_meal_tx_timeout()
2260 spin_lock_irq(&hp->happy_lock); happy_meal_tx_timeout()
2261 happy_meal_init(hp); happy_meal_tx_timeout()
2262 spin_unlock_irq(&hp->happy_lock); happy_meal_tx_timeout()
2267 static void unmap_partial_tx_skb(struct happy_meal *hp, u32 first_mapping, unmap_partial_tx_skb() argument
2270 struct happy_meal_txd *txbase = &hp->happy_block->happy_meal_txd[0]; unmap_partial_tx_skb()
2272 dma_unmap_single(hp->dma_dev, first_mapping, first_len, DMA_TO_DEVICE); unmap_partial_tx_skb()
2279 addr = hme_read_desc32(hp, &this->tx_addr); unmap_partial_tx_skb()
2280 len = hme_read_desc32(hp, &this->tx_flags); unmap_partial_tx_skb()
2282 dma_unmap_page(hp->dma_dev, addr, len, DMA_TO_DEVICE); unmap_partial_tx_skb()
2289 struct happy_meal *hp = netdev_priv(dev); happy_meal_start_xmit() local
2303 spin_lock_irq(&hp->happy_lock); happy_meal_start_xmit()
2305 if (TX_BUFFS_AVAIL(hp) <= (skb_shinfo(skb)->nr_frags + 1)) { happy_meal_start_xmit()
2307 spin_unlock_irq(&hp->happy_lock); happy_meal_start_xmit()
2313 entry = hp->tx_new; happy_meal_start_xmit()
2315 hp->tx_skbs[entry] = skb; happy_meal_start_xmit()
2321 mapping = dma_map_single(hp->dma_dev, skb->data, len, DMA_TO_DEVICE); happy_meal_start_xmit()
2322 if (unlikely(dma_mapping_error(hp->dma_dev, mapping))) happy_meal_start_xmit()
2325 hme_write_txd(hp, &hp->happy_block->happy_meal_txd[entry], happy_meal_start_xmit()
2337 first_mapping = dma_map_single(hp->dma_dev, skb->data, first_len, happy_meal_start_xmit()
2339 if (unlikely(dma_mapping_error(hp->dma_dev, first_mapping))) happy_meal_start_xmit()
2348 mapping = skb_frag_dma_map(hp->dma_dev, this_frag, happy_meal_start_xmit()
2350 if (unlikely(dma_mapping_error(hp->dma_dev, mapping))) { happy_meal_start_xmit()
2351 unmap_partial_tx_skb(hp, first_mapping, first_len, happy_meal_start_xmit()
2358 hme_write_txd(hp, &hp->happy_block->happy_meal_txd[entry], happy_meal_start_xmit()
2363 hme_write_txd(hp, &hp->happy_block->happy_meal_txd[first_entry], happy_meal_start_xmit()
2368 hp->tx_new = entry; happy_meal_start_xmit()
2370 if (TX_BUFFS_AVAIL(hp) <= (MAX_SKB_FRAGS + 1)) happy_meal_start_xmit()
2374 hme_write32(hp, hp->etxregs + ETX_PENDING, ETX_TP_DMAWAKEUP); happy_meal_start_xmit()
2376 spin_unlock_irq(&hp->happy_lock); happy_meal_start_xmit()
2378 tx_add_log(hp, TXLOG_ACTION_TXMIT, 0); happy_meal_start_xmit()
2382 hp->tx_skbs[hp->tx_new] = NULL; happy_meal_start_xmit()
2383 spin_unlock_irq(&hp->happy_lock); happy_meal_start_xmit()
2392 struct happy_meal *hp = netdev_priv(dev); happy_meal_get_stats() local
2394 spin_lock_irq(&hp->happy_lock); happy_meal_get_stats()
2395 happy_meal_get_counters(hp, hp->bigmacregs); happy_meal_get_stats()
2396 spin_unlock_irq(&hp->happy_lock); happy_meal_get_stats()
2398 return &hp->net_stats; happy_meal_get_stats()
2403 struct happy_meal *hp = netdev_priv(dev); happy_meal_set_multicast() local
2404 void __iomem *bregs = hp->bigmacregs; happy_meal_set_multicast()
2408 spin_lock_irq(&hp->happy_lock); happy_meal_set_multicast()
2411 hme_write32(hp, bregs + BMAC_HTABLE0, 0xffff); happy_meal_set_multicast()
2412 hme_write32(hp, bregs + BMAC_HTABLE1, 0xffff); happy_meal_set_multicast()
2413 hme_write32(hp, bregs + BMAC_HTABLE2, 0xffff); happy_meal_set_multicast()
2414 hme_write32(hp, bregs + BMAC_HTABLE3, 0xffff); happy_meal_set_multicast()
2416 hme_write32(hp, bregs + BMAC_RXCFG, happy_meal_set_multicast()
2417 hme_read32(hp, bregs + BMAC_RXCFG) | BIGMAC_RXCFG_PMISC); happy_meal_set_multicast()
2427 hme_write32(hp, bregs + BMAC_HTABLE0, hash_table[0]);
2428 hme_write32(hp, bregs + BMAC_HTABLE1, hash_table[1]);
2429 hme_write32(hp, bregs + BMAC_HTABLE2, hash_table[2]);
2430 hme_write32(hp, bregs + BMAC_HTABLE3, hash_table[3]);
2433 spin_unlock_irq(&hp->happy_lock);
2439 struct happy_meal *hp = netdev_priv(dev); hme_get_settings() local
2453 spin_lock_irq(&hp->happy_lock); hme_get_settings()
2454 hp->sw_bmcr = happy_meal_tcvr_read(hp, hp->tcvregs, MII_BMCR); hme_get_settings()
2455 hp->sw_lpa = happy_meal_tcvr_read(hp, hp->tcvregs, MII_LPA); hme_get_settings()
2456 spin_unlock_irq(&hp->happy_lock); hme_get_settings()
2458 if (hp->sw_bmcr & BMCR_ANENABLE) { hme_get_settings()
2460 speed = ((hp->sw_lpa & (LPA_100HALF | LPA_100FULL)) ? hme_get_settings()
2464 (hp->sw_lpa & (LPA_100FULL)) ? hme_get_settings()
2468 (hp->sw_lpa & (LPA_10FULL)) ? hme_get_settings()
2472 speed = (hp->sw_bmcr & BMCR_SPEED100) ? SPEED_100 : SPEED_10; hme_get_settings()
2474 (hp->sw_bmcr & BMCR_FULLDPLX) ? hme_get_settings()
2483 struct happy_meal *hp = netdev_priv(dev); hme_set_settings() local
2497 spin_lock_irq(&hp->happy_lock); hme_set_settings()
2498 del_timer(&hp->happy_timer); hme_set_settings()
2499 happy_meal_begin_auto_negotiation(hp, hp->tcvregs, cmd); hme_set_settings()
2500 spin_unlock_irq(&hp->happy_lock); hme_set_settings()
2507 struct happy_meal *hp = netdev_priv(dev); hme_get_drvinfo() local
2511 if (hp->happy_flags & HFLAG_PCI) { hme_get_drvinfo()
2512 struct pci_dev *pdev = hp->happy_dev; hme_get_drvinfo()
2518 struct platform_device *op = hp->happy_dev; hme_get_drvinfo()
2530 struct happy_meal *hp = netdev_priv(dev); hme_get_link() local
2532 spin_lock_irq(&hp->happy_lock); hme_get_link()
2533 hp->sw_bmcr = happy_meal_tcvr_read(hp, hp->tcvregs, MII_BMCR); hme_get_link()
2534 spin_unlock_irq(&hp->happy_lock); hme_get_link()
2536 return hp->sw_bmsr & BMSR_LSTATUS; hme_get_link()
2682 struct happy_meal *hp; happy_meal_sbus_probe_one() local
2736 hp = netdev_priv(dev); happy_meal_sbus_probe_one()
2738 hp->happy_dev = op; happy_meal_sbus_probe_one()
2739 hp->dma_dev = &op->dev; happy_meal_sbus_probe_one()
2741 spin_lock_init(&hp->happy_lock); happy_meal_sbus_probe_one()
2745 hp->qfe_parent = qp; happy_meal_sbus_probe_one()
2746 hp->qfe_ent = qfe_slot; happy_meal_sbus_probe_one()
2750 hp->gregs = of_ioremap(&op->resource[0], 0, happy_meal_sbus_probe_one()
2752 if (!hp->gregs) { happy_meal_sbus_probe_one()
2757 hp->etxregs = of_ioremap(&op->resource[1], 0, happy_meal_sbus_probe_one()
2759 if (!hp->etxregs) { happy_meal_sbus_probe_one()
2764 hp->erxregs = of_ioremap(&op->resource[2], 0, happy_meal_sbus_probe_one()
2766 if (!hp->erxregs) { happy_meal_sbus_probe_one()
2771 hp->bigmacregs = of_ioremap(&op->resource[3], 0, happy_meal_sbus_probe_one()
2773 if (!hp->bigmacregs) { happy_meal_sbus_probe_one()
2778 hp->tcvregs = of_ioremap(&op->resource[4], 0, happy_meal_sbus_probe_one()
2780 if (!hp->tcvregs) { happy_meal_sbus_probe_one()
2785 hp->hm_revision = of_getintprop_default(dp, "hm-rev", 0xff); happy_meal_sbus_probe_one()
2786 if (hp->hm_revision == 0xff) happy_meal_sbus_probe_one()
2787 hp->hm_revision = 0xa0; happy_meal_sbus_probe_one()
2790 if (hp->hm_revision == 0x20 || hp->hm_revision == 0x21) happy_meal_sbus_probe_one()
2791 hp->happy_flags = HFLAG_20_21; happy_meal_sbus_probe_one()
2792 else if (hp->hm_revision != 0xa0) happy_meal_sbus_probe_one()
2793 hp->happy_flags = HFLAG_NOT_A0; happy_meal_sbus_probe_one()
2796 hp->happy_flags |= HFLAG_QUATTRO; happy_meal_sbus_probe_one()
2799 hp->happy_bursts = of_getintprop_default(sbus_dp, happy_meal_sbus_probe_one()
2802 hp->happy_block = dma_alloc_coherent(hp->dma_dev, happy_meal_sbus_probe_one()
2804 &hp->hblock_dvma, happy_meal_sbus_probe_one()
2807 if (!hp->happy_block) happy_meal_sbus_probe_one()
2811 hp->linkcheck = 0; happy_meal_sbus_probe_one()
2814 hp->timer_state = asleep; happy_meal_sbus_probe_one()
2815 hp->timer_ticks = 0; happy_meal_sbus_probe_one()
2817 init_timer(&hp->happy_timer); happy_meal_sbus_probe_one()
2819 hp->dev = dev; happy_meal_sbus_probe_one()
2828 hp->irq = op->archdata.irqs[0]; happy_meal_sbus_probe_one()
2832 hp->read_desc32 = sbus_hme_read_desc32; happy_meal_sbus_probe_one()
2833 hp->write_txd = sbus_hme_write_txd; happy_meal_sbus_probe_one()
2834 hp->write_rxd = sbus_hme_write_rxd; happy_meal_sbus_probe_one()
2835 hp->read32 = sbus_hme_read32; happy_meal_sbus_probe_one()
2836 hp->write32 = sbus_hme_write32; happy_meal_sbus_probe_one()
2842 spin_lock_irq(&hp->happy_lock); happy_meal_sbus_probe_one()
2843 happy_meal_set_initial_advertisement(hp); happy_meal_sbus_probe_one()
2844 spin_unlock_irq(&hp->happy_lock); happy_meal_sbus_probe_one()
2846 err = register_netdev(hp->dev); happy_meal_sbus_probe_one()
2853 platform_set_drvdata(op, hp); happy_meal_sbus_probe_one()
2867 dma_free_coherent(hp->dma_dev, happy_meal_sbus_probe_one()
2869 hp->happy_block, happy_meal_sbus_probe_one()
2870 hp->hblock_dvma); happy_meal_sbus_probe_one()
2873 if (hp->gregs) happy_meal_sbus_probe_one()
2874 of_iounmap(&op->resource[0], hp->gregs, GREG_REG_SIZE); happy_meal_sbus_probe_one()
2875 if (hp->etxregs) happy_meal_sbus_probe_one()
2876 of_iounmap(&op->resource[1], hp->etxregs, ETX_REG_SIZE); happy_meal_sbus_probe_one()
2877 if (hp->erxregs) happy_meal_sbus_probe_one()
2878 of_iounmap(&op->resource[2], hp->erxregs, ERX_REG_SIZE); happy_meal_sbus_probe_one()
2879 if (hp->bigmacregs) happy_meal_sbus_probe_one()
2880 of_iounmap(&op->resource[3], hp->bigmacregs, BMAC_REG_SIZE); happy_meal_sbus_probe_one()
2881 if (hp->tcvregs) happy_meal_sbus_probe_one()
2882 of_iounmap(&op->resource[4], hp->tcvregs, TCVR_REG_SIZE); happy_meal_sbus_probe_one()
2987 struct happy_meal *hp; happy_meal_pci_probe() local
3032 hp = netdev_priv(dev); happy_meal_pci_probe()
3034 hp->happy_dev = pdev; happy_meal_pci_probe()
3035 hp->dma_dev = &pdev->dev; happy_meal_pci_probe()
3037 spin_lock_init(&hp->happy_lock); happy_meal_pci_probe()
3040 hp->qfe_parent = qp; happy_meal_pci_probe()
3041 hp->qfe_ent = qfe_slot; happy_meal_pci_probe()
3089 hp->gregs = (hpreg_base + 0x0000UL); happy_meal_pci_probe()
3090 hp->etxregs = (hpreg_base + 0x2000UL); happy_meal_pci_probe()
3091 hp->erxregs = (hpreg_base + 0x4000UL); happy_meal_pci_probe()
3092 hp->bigmacregs = (hpreg_base + 0x6000UL); happy_meal_pci_probe()
3093 hp->tcvregs = (hpreg_base + 0x7000UL); happy_meal_pci_probe()
3096 hp->hm_revision = of_getintprop_default(dp, "hm-rev", 0xff); happy_meal_pci_probe()
3097 if (hp->hm_revision == 0xff) happy_meal_pci_probe()
3098 hp->hm_revision = 0xc0 | (pdev->revision & 0x0f); happy_meal_pci_probe()
3101 hp->hm_revision = 0x20; happy_meal_pci_probe()
3105 if (hp->hm_revision == 0x20 || hp->hm_revision == 0x21) happy_meal_pci_probe()
3106 hp->happy_flags = HFLAG_20_21; happy_meal_pci_probe()
3107 else if (hp->hm_revision != 0xa0 && hp->hm_revision != 0xc0) happy_meal_pci_probe()
3108 hp->happy_flags = HFLAG_NOT_A0; happy_meal_pci_probe()
3111 hp->happy_flags |= HFLAG_QUATTRO; happy_meal_pci_probe()
3114 hp->happy_flags |= HFLAG_PCI; happy_meal_pci_probe()
3118 hp->happy_bursts = DMA_BURSTBITS; happy_meal_pci_probe()
3121 hp->happy_block = dma_alloc_coherent(&pdev->dev, PAGE_SIZE, happy_meal_pci_probe()
3122 &hp->hblock_dvma, GFP_KERNEL); happy_meal_pci_probe()
3124 if (!hp->happy_block) happy_meal_pci_probe()
3127 hp->linkcheck = 0; happy_meal_pci_probe()
3128 hp->timer_state = asleep; happy_meal_pci_probe()
3129 hp->timer_ticks = 0; happy_meal_pci_probe()
3131 init_timer(&hp->happy_timer); happy_meal_pci_probe()
3133 hp->irq = pdev->irq; happy_meal_pci_probe()
3134 hp->dev = dev; happy_meal_pci_probe()
3145 hp->read_desc32 = pci_hme_read_desc32; happy_meal_pci_probe()
3146 hp->write_txd = pci_hme_write_txd; happy_meal_pci_probe()
3147 hp->write_rxd = pci_hme_write_rxd; happy_meal_pci_probe()
3148 hp->read32 = pci_hme_read32; happy_meal_pci_probe()
3149 hp->write32 = pci_hme_write32; happy_meal_pci_probe()
3155 spin_lock_irq(&hp->happy_lock); happy_meal_pci_probe()
3156 happy_meal_set_initial_advertisement(hp); happy_meal_pci_probe()
3157 spin_unlock_irq(&hp->happy_lock); happy_meal_pci_probe()
3159 err = register_netdev(hp->dev); happy_meal_pci_probe()
3166 pci_set_drvdata(pdev, hp); happy_meal_pci_probe()
3197 iounmap(hp->gregs); happy_meal_pci_probe()
3214 struct happy_meal *hp = pci_get_drvdata(pdev); happy_meal_pci_remove() local
3215 struct net_device *net_dev = hp->dev; happy_meal_pci_remove()
3219 dma_free_coherent(hp->dma_dev, PAGE_SIZE, happy_meal_pci_remove()
3220 hp->happy_block, hp->hblock_dvma); happy_meal_pci_remove()
3221 iounmap(hp->gregs); happy_meal_pci_remove()
3222 pci_release_regions(hp->happy_dev); happy_meal_pci_remove()
3284 struct happy_meal *hp = platform_get_drvdata(op); hme_sbus_remove() local
3285 struct net_device *net_dev = hp->dev; hme_sbus_remove()
3291 of_iounmap(&op->resource[0], hp->gregs, GREG_REG_SIZE); hme_sbus_remove()
3292 of_iounmap(&op->resource[1], hp->etxregs, ETX_REG_SIZE); hme_sbus_remove()
3293 of_iounmap(&op->resource[2], hp->erxregs, ERX_REG_SIZE); hme_sbus_remove()
3294 of_iounmap(&op->resource[3], hp->bigmacregs, BMAC_REG_SIZE); hme_sbus_remove()
3295 of_iounmap(&op->resource[4], hp->tcvregs, TCVR_REG_SIZE); hme_sbus_remove()
3296 dma_free_coherent(hp->dma_dev, hme_sbus_remove()
3298 hp->happy_block, hme_sbus_remove()
3299 hp->hblock_dvma); hme_sbus_remove()
H A Dsunhme.h364 #define TX_BUFFS_AVAIL(hp) \
365 (((hp)->tx_old <= (hp)->tx_new) ? \
366 (hp)->tx_old + (TX_RING_SIZE - 1) - (hp)->tx_new : \
367 (hp)->tx_old - (hp)->tx_new - 1)
/linux-4.4.14/drivers/char/agp/
H A Dhp-agp.c5 * Bjorn Helgaas <bjorn.helgaas@hp.com>
79 struct _hp_private *hp = &hp_private; hp_zx1_ioc_shared() local
89 hp->io_tlb_ps = readq(hp->ioc_regs+HP_ZX1_TCNFG); hp_zx1_ioc_shared()
90 switch (hp->io_tlb_ps) { hp_zx1_ioc_shared()
91 case 0: hp->io_tlb_shift = 12; break; hp_zx1_ioc_shared()
92 case 1: hp->io_tlb_shift = 13; break; hp_zx1_ioc_shared()
93 case 2: hp->io_tlb_shift = 14; break; hp_zx1_ioc_shared()
94 case 3: hp->io_tlb_shift = 16; break; hp_zx1_ioc_shared()
97 "configuration 0x%x\n", hp->io_tlb_ps); hp_zx1_ioc_shared()
98 hp->gatt = NULL; hp_zx1_ioc_shared()
99 hp->gatt_entries = 0; hp_zx1_ioc_shared()
102 hp->io_page_size = 1 << hp->io_tlb_shift; hp_zx1_ioc_shared()
103 hp->io_pages_per_kpage = PAGE_SIZE / hp->io_page_size; hp_zx1_ioc_shared()
105 hp->iova_base = readq(hp->ioc_regs+HP_ZX1_IBASE) & ~0x1; hp_zx1_ioc_shared()
106 hp->gart_base = hp->iova_base + HP_ZX1_IOVA_SIZE - HP_ZX1_GART_SIZE; hp_zx1_ioc_shared()
108 hp->gart_size = HP_ZX1_GART_SIZE; hp_zx1_ioc_shared()
109 hp->gatt_entries = hp->gart_size / hp->io_page_size; hp_zx1_ioc_shared()
111 hp->io_pdir = phys_to_virt(readq(hp->ioc_regs+HP_ZX1_PDIR_BASE)); hp_zx1_ioc_shared()
112 hp->gatt = &hp->io_pdir[HP_ZX1_IOVA_TO_PDIR(hp->gart_base)]; hp_zx1_ioc_shared()
114 if (hp->gatt[0] != HP_ZX1_SBA_IOMMU_COOKIE) { hp_zx1_ioc_shared()
116 hp->gatt = NULL; hp_zx1_ioc_shared()
117 hp->gatt_entries = 0; hp_zx1_ioc_shared()
129 struct _hp_private *hp = &hp_private; hp_zx1_ioc_owner() local
137 hp->io_tlb_shift = 16; hp_zx1_ioc_owner()
138 hp->io_tlb_ps = 3; hp_zx1_ioc_owner()
140 hp->io_tlb_shift = 14; hp_zx1_ioc_owner()
141 hp->io_tlb_ps = 2; hp_zx1_ioc_owner()
143 hp->io_tlb_shift = 13; hp_zx1_ioc_owner()
144 hp->io_tlb_ps = 1; hp_zx1_ioc_owner()
146 hp->io_tlb_shift = 12; hp_zx1_ioc_owner()
147 hp->io_tlb_ps = 0; hp_zx1_ioc_owner()
149 hp->io_page_size = 1 << hp->io_tlb_shift; hp_zx1_ioc_owner()
150 hp->io_pages_per_kpage = PAGE_SIZE / hp->io_page_size; hp_zx1_ioc_owner()
152 hp->iova_base = HP_ZX1_IOVA_BASE; hp_zx1_ioc_owner()
153 hp->gart_size = HP_ZX1_GART_SIZE; hp_zx1_ioc_owner()
154 hp->gart_base = hp->iova_base + HP_ZX1_IOVA_SIZE - hp->gart_size; hp_zx1_ioc_owner()
156 hp->gatt_entries = hp->gart_size / hp->io_page_size; hp_zx1_ioc_owner()
157 hp->io_pdir_size = (HP_ZX1_IOVA_SIZE / hp->io_page_size) * sizeof(u64); hp_zx1_ioc_owner()
165 struct _hp_private *hp = &hp_private; hp_zx1_ioc_init() local
167 hp->ioc_regs = ioremap(hpa, 1024); hp_zx1_ioc_init()
168 if (!hp->ioc_regs) hp_zx1_ioc_init()
175 hp->io_pdir_owner = (readq(hp->ioc_regs+HP_ZX1_IBASE) & 0x1) == 0; hp_zx1_ioc_init()
177 if (hp->io_pdir_owner) hp_zx1_ioc_init()
209 struct _hp_private *hp = &hp_private; hp_zx1_lba_init() local
212 hp->lba_regs = ioremap(hpa, 256); hp_zx1_lba_init()
213 if (!hp->lba_regs) hp_zx1_lba_init()
216 hp->lba_cap_offset = hp_zx1_lba_find_capability(hp->lba_regs, PCI_CAP_ID_AGP); hp_zx1_lba_init()
218 cap = readl(hp->lba_regs+hp->lba_cap_offset) & 0xff; hp_zx1_lba_init()
221 cap, hp->lba_cap_offset); hp_zx1_lba_init()
222 iounmap(hp->lba_regs); hp_zx1_lba_init()
243 struct _hp_private *hp = &hp_private; hp_zx1_configure() local
245 agp_bridge->gart_bus_addr = hp->gart_base; hp_zx1_configure()
246 agp_bridge->capndx = hp->lba_cap_offset; hp_zx1_configure()
247 agp_bridge->mode = readl(hp->lba_regs+hp->lba_cap_offset+PCI_AGP_STATUS); hp_zx1_configure()
249 if (hp->io_pdir_owner) { hp_zx1_configure()
250 writel(virt_to_phys(hp->io_pdir), hp->ioc_regs+HP_ZX1_PDIR_BASE); hp_zx1_configure()
251 readl(hp->ioc_regs+HP_ZX1_PDIR_BASE); hp_zx1_configure()
252 writel(hp->io_tlb_ps, hp->ioc_regs+HP_ZX1_TCNFG); hp_zx1_configure()
253 readl(hp->ioc_regs+HP_ZX1_TCNFG); hp_zx1_configure()
254 writel((unsigned int)(~(HP_ZX1_IOVA_SIZE-1)), hp->ioc_regs+HP_ZX1_IMASK); hp_zx1_configure()
255 readl(hp->ioc_regs+HP_ZX1_IMASK); hp_zx1_configure()
256 writel(hp->iova_base|1, hp->ioc_regs+HP_ZX1_IBASE); hp_zx1_configure()
257 readl(hp->ioc_regs+HP_ZX1_IBASE); hp_zx1_configure()
258 writel(hp->iova_base|ilog2(HP_ZX1_IOVA_SIZE), hp->ioc_regs+HP_ZX1_PCOM); hp_zx1_configure()
259 readl(hp->ioc_regs+HP_ZX1_PCOM); hp_zx1_configure()
268 struct _hp_private *hp = &hp_private; hp_zx1_cleanup() local
270 if (hp->ioc_regs) { hp_zx1_cleanup()
271 if (hp->io_pdir_owner) { hp_zx1_cleanup()
272 writeq(0, hp->ioc_regs+HP_ZX1_IBASE); hp_zx1_cleanup()
273 readq(hp->ioc_regs+HP_ZX1_IBASE); hp_zx1_cleanup()
275 iounmap(hp->ioc_regs); hp_zx1_cleanup()
277 if (hp->lba_regs) hp_zx1_cleanup()
278 iounmap(hp->lba_regs); hp_zx1_cleanup()
284 struct _hp_private *hp = &hp_private; hp_zx1_tlbflush() local
286 writeq(hp->gart_base | ilog2(hp->gart_size), hp->ioc_regs+HP_ZX1_PCOM); hp_zx1_tlbflush()
287 readq(hp->ioc_regs+HP_ZX1_PCOM); hp_zx1_tlbflush()
293 struct _hp_private *hp = &hp_private; hp_zx1_create_gatt_table() local
296 if (hp->io_pdir_owner) { hp_zx1_create_gatt_table()
297 hp->io_pdir = (u64 *) __get_free_pages(GFP_KERNEL, hp_zx1_create_gatt_table()
298 get_order(hp->io_pdir_size)); hp_zx1_create_gatt_table()
299 if (!hp->io_pdir) { hp_zx1_create_gatt_table()
302 hp->gatt = NULL; hp_zx1_create_gatt_table()
303 hp->gatt_entries = 0; hp_zx1_create_gatt_table()
306 memset(hp->io_pdir, 0, hp->io_pdir_size); hp_zx1_create_gatt_table()
308 hp->gatt = &hp->io_pdir[HP_ZX1_IOVA_TO_PDIR(hp->gart_base)]; hp_zx1_create_gatt_table()
311 for (i = 0; i < hp->gatt_entries; i++) { hp_zx1_create_gatt_table()
312 hp->gatt[i] = (unsigned long) agp_bridge->scratch_page; hp_zx1_create_gatt_table()
321 struct _hp_private *hp = &hp_private; hp_zx1_free_gatt_table() local
323 if (hp->io_pdir_owner) hp_zx1_free_gatt_table()
324 free_pages((unsigned long) hp->io_pdir, hp_zx1_free_gatt_table()
325 get_order(hp->io_pdir_size)); hp_zx1_free_gatt_table()
327 hp->gatt[0] = HP_ZX1_SBA_IOMMU_COOKIE; hp_zx1_free_gatt_table()
334 struct _hp_private *hp = &hp_private; hp_zx1_insert_memory() local
344 io_pg_start = hp->io_pages_per_kpage * pg_start; hp_zx1_insert_memory()
345 io_pg_count = hp->io_pages_per_kpage * mem->page_count; hp_zx1_insert_memory()
346 if ((io_pg_start + io_pg_count) > hp->gatt_entries) { hp_zx1_insert_memory()
352 if (hp->gatt[j]) { hp_zx1_insert_memory()
368 k < hp->io_pages_per_kpage; hp_zx1_insert_memory()
369 k++, j++, paddr += hp->io_page_size) { hp_zx1_insert_memory()
370 hp->gatt[j] = HP_ZX1_PDIR_VALID_BIT | paddr; hp_zx1_insert_memory()
381 struct _hp_private *hp = &hp_private; hp_zx1_remove_memory() local
389 io_pg_start = hp->io_pages_per_kpage * pg_start; hp_zx1_remove_memory()
390 io_pg_count = hp->io_pages_per_kpage * mem->page_count; hp_zx1_remove_memory()
392 hp->gatt[i] = agp_bridge->scratch_page; hp_zx1_remove_memory()
408 struct _hp_private *hp = &hp_private; hp_zx1_enable() local
411 command = readl(hp->lba_regs+hp->lba_cap_offset+PCI_AGP_STATUS); hp_zx1_enable()
415 writel(command, hp->lba_regs+hp->lba_cap_offset+PCI_AGP_COMMAND); hp_zx1_enable()
H A DMakefile12 obj-$(CONFIG_AGP_HP_ZX1) += hp-agp.o
H A Dparisc-agp.c6 * Based on drivers/char/agpgart/hp-agp.c which is
8 * Bjorn Helgaas <bjorn.helgaas@hp.com>
/linux-4.4.14/arch/ia64/hp/common/
H A DMakefile2 # ia64/platform/hp/common/Makefile
5 # Copyright (C) Alex Williamson (alex_williamson@hp.com)
H A Dhwsw_iommu.c3 * Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
H A Daml_nfw.c5 * Bjorn Helgaas <bjorn.helgaas@hp.com>
29 MODULE_AUTHOR("Bjorn Helgaas <bjorn.helgaas@hp.com>");
/linux-4.4.14/arch/sparc/kernel/
H A Dmdesc.c78 static void mdesc_handle_init(struct mdesc_handle *hp, mdesc_handle_init() argument
82 BUG_ON(((unsigned long)&hp->mdesc) & (16UL - 1)); mdesc_handle_init()
84 memset(hp, 0, handle_size); mdesc_handle_init()
85 INIT_LIST_HEAD(&hp->list); mdesc_handle_init()
86 hp->self_base = base; mdesc_handle_init()
87 atomic_set(&hp->refcnt, 1); mdesc_handle_init()
88 hp->handle_size = handle_size; mdesc_handle_init()
94 struct mdesc_handle *hp; mdesc_memblock_alloc() local
104 hp = NULL; mdesc_memblock_alloc()
106 hp = __va(paddr); mdesc_memblock_alloc()
107 mdesc_handle_init(hp, handle_size, hp); mdesc_memblock_alloc()
109 return hp; mdesc_memblock_alloc()
112 static void __init mdesc_memblock_free(struct mdesc_handle *hp) mdesc_memblock_free() argument
117 BUG_ON(atomic_read(&hp->refcnt) != 0); mdesc_memblock_free()
118 BUG_ON(!list_empty(&hp->list)); mdesc_memblock_free()
120 alloc_size = PAGE_ALIGN(hp->handle_size); mdesc_memblock_free()
121 start = __pa(hp); mdesc_memblock_free()
133 struct mdesc_handle *hp; mdesc_kmalloc() local
148 hp = (struct mdesc_handle *) addr; mdesc_kmalloc()
150 mdesc_handle_init(hp, handle_size, base); mdesc_kmalloc()
152 return hp; mdesc_kmalloc()
155 static void mdesc_kfree(struct mdesc_handle *hp) mdesc_kfree() argument
157 BUG_ON(atomic_read(&hp->refcnt) != 0); mdesc_kfree()
158 BUG_ON(!list_empty(&hp->list)); mdesc_kfree()
160 kfree(hp->self_base); mdesc_kfree()
171 struct mdesc_handle *hp = mops->alloc(mdesc_size); mdesc_alloc() local
173 if (hp) mdesc_alloc()
174 hp->mops = mops; mdesc_alloc()
176 return hp; mdesc_alloc()
179 static void mdesc_free(struct mdesc_handle *hp) mdesc_free() argument
181 hp->mops->free(hp); mdesc_free()
190 struct mdesc_handle *hp; mdesc_grab() local
194 hp = cur_mdesc; mdesc_grab()
195 if (hp) mdesc_grab()
196 atomic_inc(&hp->refcnt); mdesc_grab()
199 return hp; mdesc_grab()
203 void mdesc_release(struct mdesc_handle *hp) mdesc_release() argument
208 if (atomic_dec_and_test(&hp->refcnt)) { mdesc_release()
209 list_del_init(&hp->list); mdesc_release()
210 hp->mops->free(hp); mdesc_release()
233 static const u64 *parent_cfg_handle(struct mdesc_handle *hp, u64 node) parent_cfg_handle() argument
239 mdesc_for_each_arc(a, hp, node, MDESC_ARC_TYPE_BACK) { mdesc_for_each_arc()
242 target = mdesc_arc_target(hp, a); mdesc_for_each_arc()
243 id = mdesc_get_property(hp, target, mdesc_for_each_arc()
330 struct mdesc_handle *hp, *orig_hp; mdesc_update() local
337 hp = mdesc_alloc(len, &kmalloc_mdesc_memops); mdesc_update()
338 if (!hp) { mdesc_update()
343 status = sun4v_mach_desc(__pa(&hp->mdesc), len, &real_len); mdesc_update()
347 atomic_dec(&hp->refcnt); mdesc_update()
348 mdesc_free(hp); mdesc_update()
354 cur_mdesc = hp; mdesc_update()
357 mdesc_notify_clients(orig_hp, hp); mdesc_update()
385 u64 mdesc_node_by_name(struct mdesc_handle *hp, mdesc_node_by_name() argument
388 struct mdesc_elem *ep = node_block(&hp->mdesc); mdesc_node_by_name()
389 const char *names = name_block(&hp->mdesc); mdesc_node_by_name()
390 u64 last_node = hp->mdesc.node_sz / 16; mdesc_node_by_name()
414 const void *mdesc_get_property(struct mdesc_handle *hp, u64 node, mdesc_get_property() argument
417 const char *names = name_block(&hp->mdesc); mdesc_get_property()
418 u64 last_node = hp->mdesc.node_sz / 16; mdesc_get_property()
419 void *data = data_block(&hp->mdesc); mdesc_get_property()
425 ep = node_block(&hp->mdesc) + node; mdesc_get_property()
460 u64 mdesc_next_arc(struct mdesc_handle *hp, u64 from, const char *arc_type) mdesc_next_arc() argument
462 struct mdesc_elem *ep, *base = node_block(&hp->mdesc); mdesc_next_arc()
463 const char *names = name_block(&hp->mdesc); mdesc_next_arc()
464 u64 last_node = hp->mdesc.node_sz / 16; mdesc_next_arc()
486 u64 mdesc_arc_target(struct mdesc_handle *hp, u64 arc) mdesc_arc_target() argument
488 struct mdesc_elem *ep, *base = node_block(&hp->mdesc); mdesc_arc_target()
496 const char *mdesc_node_name(struct mdesc_handle *hp, u64 node) mdesc_node_name() argument
498 struct mdesc_elem *ep, *base = node_block(&hp->mdesc); mdesc_node_name()
499 const char *names = name_block(&hp->mdesc); mdesc_node_name()
500 u64 last_node = hp->mdesc.node_sz / 16; mdesc_node_name()
517 struct mdesc_handle *hp = mdesc_grab(); report_platform_properties() local
518 u64 pn = mdesc_node_by_name(hp, MDESC_NODE_NULL, "platform"); report_platform_properties()
527 s = mdesc_get_property(hp, pn, "banner-name", NULL); report_platform_properties()
529 s = mdesc_get_property(hp, pn, "name", NULL); report_platform_properties()
532 v = mdesc_get_property(hp, pn, "hostid", NULL); report_platform_properties()
535 v = mdesc_get_property(hp, pn, "serial#", NULL); report_platform_properties()
538 v = mdesc_get_property(hp, pn, "stick-frequency", NULL); report_platform_properties()
540 v = mdesc_get_property(hp, pn, "mac-address", NULL); report_platform_properties()
543 v = mdesc_get_property(hp, pn, "watchdog-resolution", NULL); report_platform_properties()
546 v = mdesc_get_property(hp, pn, "watchdog-max-timeout", NULL); report_platform_properties()
549 v = mdesc_get_property(hp, pn, "max-cpus", NULL); report_platform_properties()
571 mdesc_release(hp); report_platform_properties()
574 static void fill_in_one_cache(cpuinfo_sparc *c, struct mdesc_handle *hp, u64 mp) fill_in_one_cache() argument
576 const u64 *level = mdesc_get_property(hp, mp, "level", NULL); fill_in_one_cache()
577 const u64 *size = mdesc_get_property(hp, mp, "size", NULL); fill_in_one_cache()
578 const u64 *line_size = mdesc_get_property(hp, mp, "line-size", NULL); fill_in_one_cache()
582 type = mdesc_get_property(hp, mp, "type", &type_len); fill_in_one_cache()
607 mdesc_for_each_arc(a, hp, mp, MDESC_ARC_TYPE_FWD) { mdesc_for_each_arc()
608 u64 target = mdesc_arc_target(hp, a); mdesc_for_each_arc()
609 const char *name = mdesc_node_name(hp, target); mdesc_for_each_arc()
612 fill_in_one_cache(c, hp, target); mdesc_for_each_arc()
617 static void find_back_node_value(struct mdesc_handle *hp, u64 node, find_back_node_value() argument
628 mdesc_for_each_arc(arc, hp, node, MDESC_ARC_TYPE_BACK) { mdesc_for_each_arc()
629 u64 n = mdesc_arc_target(hp, arc); mdesc_for_each_arc()
630 const char *name = mdesc_node_name(hp, n); mdesc_for_each_arc()
633 (*func)(hp, n, val); mdesc_for_each_arc()
635 find_back_node_value(hp, n, srch_val, func, val, depth-1); mdesc_for_each_arc()
639 static void __mark_core_id(struct mdesc_handle *hp, u64 node, __mark_core_id() argument
642 const u64 *id = mdesc_get_property(hp, node, "id", NULL); __mark_core_id()
648 static void __mark_sock_id(struct mdesc_handle *hp, u64 node, __mark_sock_id() argument
651 const u64 *id = mdesc_get_property(hp, node, "id", NULL); __mark_sock_id()
657 static void mark_core_ids(struct mdesc_handle *hp, u64 mp, mark_core_ids() argument
660 find_back_node_value(hp, mp, "cpu", __mark_core_id, core_id, 10); mark_core_ids()
663 static void mark_sock_ids(struct mdesc_handle *hp, u64 mp, mark_sock_ids() argument
666 find_back_node_value(hp, mp, "cpu", __mark_sock_id, sock_id, 10); mark_sock_ids()
669 static void set_core_ids(struct mdesc_handle *hp) set_core_ids() argument
679 mdesc_for_each_node_by_name(hp, mp, "cache") { set_core_ids()
684 level = mdesc_get_property(hp, mp, "level", NULL); set_core_ids()
688 type = mdesc_get_property(hp, mp, "type", &len); set_core_ids()
692 mark_core_ids(hp, mp, idx); set_core_ids()
697 static int set_sock_ids_by_cache(struct mdesc_handle *hp, int level) set_sock_ids_by_cache() argument
706 mdesc_for_each_node_by_name(hp, mp, "cache") { set_sock_ids_by_cache()
709 cur_lvl = mdesc_get_property(hp, mp, "level", NULL); set_sock_ids_by_cache()
713 mark_sock_ids(hp, mp, idx); set_sock_ids_by_cache()
720 static void set_sock_ids_by_socket(struct mdesc_handle *hp, u64 mp) set_sock_ids_by_socket() argument
724 mdesc_for_each_node_by_name(hp, mp, "socket") { set_sock_ids_by_socket()
727 mdesc_for_each_arc(a, hp, mp, MDESC_ARC_TYPE_FWD) { mdesc_for_each_arc()
728 u64 t = mdesc_arc_target(hp, a); mdesc_for_each_arc()
732 name = mdesc_node_name(hp, t); mdesc_for_each_arc()
736 id = mdesc_get_property(hp, t, "id", NULL); mdesc_for_each_arc()
744 static void set_sock_ids(struct mdesc_handle *hp) set_sock_ids() argument
751 mp = mdesc_node_by_name(hp, MDESC_NODE_NULL, "sockets"); set_sock_ids()
753 return set_sock_ids_by_socket(hp, mp); set_sock_ids()
755 if (!set_sock_ids_by_cache(hp, 3)) set_sock_ids()
756 set_sock_ids_by_cache(hp, 2); set_sock_ids()
759 static void mark_proc_ids(struct mdesc_handle *hp, u64 mp, int proc_id) mark_proc_ids() argument
763 mdesc_for_each_arc(a, hp, mp, MDESC_ARC_TYPE_BACK) { mdesc_for_each_arc()
764 u64 t = mdesc_arc_target(hp, a); mdesc_for_each_arc()
768 name = mdesc_node_name(hp, t); mdesc_for_each_arc()
772 id = mdesc_get_property(hp, t, "id", NULL); mdesc_for_each_arc()
778 static void __set_proc_ids(struct mdesc_handle *hp, const char *exec_unit_name) __set_proc_ids() argument
784 mdesc_for_each_node_by_name(hp, mp, exec_unit_name) { mdesc_for_each_node_by_name()
788 type = mdesc_get_property(hp, mp, "type", &len); mdesc_for_each_node_by_name()
793 mark_proc_ids(hp, mp, idx); mdesc_for_each_node_by_name()
798 static void set_proc_ids(struct mdesc_handle *hp) set_proc_ids() argument
800 __set_proc_ids(hp, "exec_unit"); set_proc_ids()
801 __set_proc_ids(hp, "exec-unit"); set_proc_ids()
826 static void get_mondo_data(struct mdesc_handle *hp, u64 mp, get_mondo_data() argument
832 val = mdesc_get_property(hp, mp, "q-cpu-mondo-#bits", NULL); get_mondo_data()
835 val = mdesc_get_property(hp, mp, "q-dev-mondo-#bits", NULL); get_mondo_data()
838 val = mdesc_get_property(hp, mp, "q-resumable-#bits", NULL); get_mondo_data()
841 val = mdesc_get_property(hp, mp, "q-nonresumable-#bits", NULL); get_mondo_data()
855 struct mdesc_handle *hp = mdesc_grab(); mdesc_iterate_over_cpus() local
859 mdesc_for_each_node_by_name(hp, mp, "cpu") { mdesc_iterate_over_cpus()
860 const u64 *id = mdesc_get_property(hp, mp, "id", NULL); mdesc_iterate_over_cpus()
874 ret = func(hp, mp, cpuid, arg); mdesc_iterate_over_cpus()
879 mdesc_release(hp); mdesc_iterate_over_cpus()
883 static void *record_one_cpu(struct mdesc_handle *hp, u64 mp, int cpuid, record_one_cpu() argument
902 static void * __init check_one_pgsz(struct mdesc_handle *hp, u64 mp, int cpuid, void *arg) check_one_pgsz() argument
904 const u64 *pgsz_prop = mdesc_get_property(hp, mp, "mmu-page-size-list", NULL); check_one_pgsz()
926 static void *fill_in_one_cpu(struct mdesc_handle *hp, u64 mp, int cpuid, fill_in_one_cpu() argument
929 const u64 *cfreq = mdesc_get_property(hp, mp, "clock-frequency", NULL); fill_in_one_cpu()
948 get_mondo_data(hp, mp, tb); fill_in_one_cpu()
950 mdesc_for_each_arc(a, hp, mp, MDESC_ARC_TYPE_FWD) { mdesc_for_each_arc()
951 u64 j, t = mdesc_arc_target(hp, a); mdesc_for_each_arc()
954 t_name = mdesc_node_name(hp, t); mdesc_for_each_arc()
956 fill_in_one_cache(c, hp, t); mdesc_for_each_arc()
960 mdesc_for_each_arc(j, hp, t, MDESC_ARC_TYPE_FWD) { mdesc_for_each_arc()
961 u64 n = mdesc_arc_target(hp, j); mdesc_for_each_arc()
964 n_name = mdesc_node_name(hp, n); mdesc_for_each_arc()
966 fill_in_one_cache(c, hp, n); mdesc_for_each_arc()
978 struct mdesc_handle *hp; mdesc_fill_in_cpu_data() local
982 hp = mdesc_grab(); mdesc_fill_in_cpu_data()
984 set_core_ids(hp); mdesc_fill_in_cpu_data()
985 set_proc_ids(hp); mdesc_fill_in_cpu_data()
986 set_sock_ids(hp); mdesc_fill_in_cpu_data()
988 mdesc_release(hp); mdesc_fill_in_cpu_data()
1000 struct mdesc_handle *hp = mdesc_grab(); mdesc_open() local
1002 if (!hp) mdesc_open()
1005 file->private_data = hp; mdesc_open()
1013 struct mdesc_handle *hp = file->private_data; mdesc_read() local
1017 if (*offp >= hp->handle_size) mdesc_read()
1020 bytes_left = hp->handle_size - *offp; mdesc_read()
1024 mdesc = (unsigned char *)&hp->mdesc; mdesc_read()
1036 struct mdesc_handle *hp; mdesc_llseek() local
1048 hp = file->private_data; mdesc_llseek()
1049 if (offset > hp->handle_size) mdesc_llseek()
1089 struct mdesc_handle *hp; sun4v_mdesc_init() local
1096 hp = mdesc_alloc(len, &memblock_mdesc_ops); sun4v_mdesc_init()
1097 if (hp == NULL) { sun4v_mdesc_init()
1102 status = sun4v_mach_desc(__pa(&hp->mdesc), len, &real_len); sun4v_mdesc_init()
1107 mdesc_free(hp); sun4v_mdesc_init()
1111 cur_mdesc = hp; sun4v_mdesc_init()
H A Dvio.c166 static void vio_fill_channel_info(struct mdesc_handle *hp, u64 mp, vio_fill_channel_info() argument
171 mdesc_for_each_arc(a, hp, mp, MDESC_ARC_TYPE_FWD) { mdesc_for_each_arc()
176 target = mdesc_arc_target(hp, a); mdesc_for_each_arc()
178 irq = mdesc_get_property(hp, target, "tx-ino", NULL); mdesc_for_each_arc()
182 irq = mdesc_get_property(hp, target, "rx-ino", NULL); mdesc_for_each_arc()
188 chan_id = mdesc_get_property(hp, target, "id", NULL); mdesc_for_each_arc()
203 static struct vio_dev *vio_create_one(struct mdesc_handle *hp, u64 mp, vio_create_one() argument
213 type = mdesc_get_property(hp, mp, "device-type", &tlen); vio_create_one()
215 type = mdesc_get_property(hp, mp, "name", &tlen); vio_create_one()
217 type = mdesc_node_name(hp, mp); vio_create_one()
227 id = mdesc_get_property(hp, mp, "id", NULL); vio_create_one()
230 mdesc_for_each_arc(a, hp, mp, MDESC_ARC_TYPE_BACK) { mdesc_for_each_arc()
233 target = mdesc_arc_target(hp, a); mdesc_for_each_arc()
234 cfg_handle = mdesc_get_property(hp, target, mdesc_for_each_arc()
255 compat = mdesc_get_property(hp, mp, "device-type", &clen);
282 vio_fill_channel_info(hp, mp, vdev);
331 static void vio_add(struct mdesc_handle *hp, u64 node) vio_add() argument
333 (void) vio_create_one(hp, node, &root_vdev->dev); vio_add()
346 static void vio_remove(struct mdesc_handle *hp, u64 node) vio_remove() argument
371 static void vio_add_ds(struct mdesc_handle *hp, u64 node) vio_add_ds() argument
377 mdesc_for_each_arc(a, hp, node, MDESC_ARC_TYPE_BACK) { mdesc_for_each_arc()
378 u64 target = mdesc_arc_target(hp, a); mdesc_for_each_arc()
379 const char *name = mdesc_node_name(hp, target); mdesc_for_each_arc()
388 (void) vio_create_one(hp, node, &root_vdev->dev);
403 struct mdesc_handle *hp; vio_init() local
416 hp = mdesc_grab(); vio_init()
417 if (!hp) vio_init()
420 root = mdesc_node_by_name(hp, MDESC_NODE_NULL, channel_devices_node); vio_init()
423 mdesc_release(hp); vio_init()
434 compat = mdesc_get_property(hp, root, "compatible", &len); vio_init()
446 cfg_handle = mdesc_get_property(hp, root, cfg_handle_prop, NULL); vio_init()
455 root_vdev = vio_create_one(hp, root, NULL); vio_init()
465 mdesc_release(hp); vio_init()
470 mdesc_release(hp); vio_init()
H A Dsetup_64.c465 struct mdesc_handle *hp; mdesc_cpu_hwcap_list() local
471 hp = mdesc_grab(); mdesc_cpu_hwcap_list()
472 if (!hp) mdesc_cpu_hwcap_list()
475 pn = mdesc_node_by_name(hp, MDESC_NODE_NULL, "cpu"); mdesc_cpu_hwcap_list()
479 prop = mdesc_get_property(hp, pn, "hwcap-list", &len); mdesc_cpu_hwcap_list()
505 mdesc_release(hp); mdesc_cpu_hwcap_list()
/linux-4.4.14/arch/ia64/include/asm/
H A Dintrinsics.h5 * David Mosberger-Tang <davidm@hpl.hp.com>
H A Dacpi-ext.h3 * Alex Williamson <alex.williamson@hp.com>
4 * Bjorn Helgaas <bjorn.helgaas@hp.com>
H A Dirq.h6 * David Mosberger-Tang <davidm@hpl.hp.com>
7 * Stephane Eranian <eranian@hpl.hp.com>
H A Dbugs.h10 * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co.
H A Dcurrent.h6 * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
H A Ddma.h6 * David Mosberger-Tang <davidm@hpl.hp.com>
H A Dhardirq.h6 * David Mosberger-Tang <davidm@hpl.hp.com>
H A Dmman.h5 * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
H A Dparam.h7 * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
H A Dsiginfo.h5 * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
H A Dcache.h7 * David Mosberger-Tang <davidm@hpl.hp.com>
H A Dsignal.h3 * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
H A Dstring.h9 * David Mosberger-Tang <davidm@hpl.hp.com>
H A Dagp.h8 * David Mosberger-Tang <davidm@hpl.hp.com>
H A Desi.h5 * Alex Williamson <alex.williamson@hp.com>
H A Dmodule.h10 * David Mosberger-Tang <davidm@hpl.hp.com>
H A Dsections.h6 * David Mosberger-Tang <davidm@hpl.hp.com>
H A Dtypes.h11 * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
H A Ddma-mapping.h6 * David Mosberger-Tang <davidm@hpl.hp.com>
H A Dpatch.h6 * David Mosberger-Tang <davidm@hpl.hp.com>
H A Dpercpu.h6 * David Mosberger-Tang <davidm@hpl.hp.com>
H A Dtermios.h3 * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
H A Dunistd.h5 * David Mosberger-Tang <davidm@hpl.hp.com>
H A Dsmp.h7 * David Mosberger-Tang <davidm@hpl.hp.com>
8 * Bjorn Helgaas <bjorn.helgaas@hp.com>
H A Dcacheflush.h6 * David Mosberger-Tang <davidm@hpl.hp.com>
H A Ddelay.h8 * David Mosberger-Tang <davidm@hpl.hp.com>
H A Dirqflags.h5 * David Mosberger-Tang <davidm@hpl.hp.com>
H A Dtimex.h6 * David Mosberger-Tang <davidm@hpl.hp.com>
H A Dptrace.h3 * David Mosberger-Tang <davidm@hpl.hp.com>
4 * Stephane Eranian <eranian@hpl.hp.com>
H A Dbarrier.h7 * David Mosberger-Tang <davidm@hpl.hp.com>
H A Dchecksum.h6 * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
H A Dnuma.h55 * http://devresource.hp.com/devresource/Docs/TechPapers/IA64/slit.pdf
H A Dpgalloc.h12 * David Mosberger-Tang <davidm@hpl.hp.com>
H A Dswitch_to.h7 * David Mosberger-Tang <davidm@hpl.hp.com>
H A Dtlbflush.h6 * David Mosberger-Tang <davidm@hpl.hp.com>
H A Duser.h28 * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
H A Dasmmacro.h6 * David Mosberger-Tang <davidm@hpl.hp.com>
H A Datomic.h13 * David Mosberger-Tang <davidm@hpl.hp.com>
/linux-4.4.14/arch/ia64/hp/sim/
H A DMakefile2 # ia64/platform/hp/sim/Makefile
5 # David Mosberger-Tang <davidm@hpl.hp.com>
H A Dhpsim_ssc.h5 * Copyright (C) 1998, 1999 David Mosberger-Tang <davidm@hpl.hp.com>
H A Dhpsim_setup.c5 * David Mosberger-Tang <davidm@hpl.hp.com>
H A Dhpsim_irq.c5 * Copyright (C) 1998-2001 David Mosberger-Tang <davidm@hpl.hp.com>
H A Dhpsim_console.c5 * David Mosberger-Tang <davidm@hpl.hp.com>
H A Dsimscsi.c5 * David Mosberger-Tang <davidm@hpl.hp.com>
6 * Stephane Eranian <eranian@hpl.hp.com>
/linux-4.4.14/arch/ia64/include/uapi/asm/
H A Dfcntl.h5 * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co.
H A Dmman.h5 * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
H A Dbreak.h8 * Copyright (C) 1999 David Mosberger-Tang <davidm@hpl.hp.com>
H A Dsockios.h10 * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
H A Dstatfs.h8 * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
H A Dswab.h6 * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co.
H A Dparam.h7 * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
H A Dtypes.h11 * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
H A Dstat.h6 * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
H A Dtermios.h3 * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
H A Dfpu.h6 * David Mosberger-Tang <davidm@hpl.hp.com>
H A Drse.h6 * Copyright (C) 1998, 1999 David Mosberger-Tang <davidm@hpl.hp.com>
H A Dsocket.h10 * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
H A Dintrinsics.h5 * David Mosberger-Tang <davidm@hpl.hp.com>
H A Dsiginfo.h5 * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
H A Dcmpxchg.h9 * David Mosberger-Tang <davidm@hpl.hp.com>
H A Dperfmon_default_smpl.h3 * Stephane Eranian <eranian@hpl.hp.com>
H A Dsigcontext.h6 * Copyright (C) 1998, 1999, 2001 David Mosberger-Tang <davidm@hpl.hp.com>
H A Dsignal.h3 * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co
H A Dptrace.h3 * David Mosberger-Tang <davidm@hpl.hp.com>
4 * Stephane Eranian <eranian@hpl.hp.com>
/linux-4.4.14/arch/ia64/
H A DMakefile11 # Copyright (C) 1998-2004 by David Mosberger-Tang <davidm@hpl.hp.com>
41 ftp://ftp.hpl.hp.com/pub/linux-ia64/gas-030124.tar.gz)
58 drivers-$(CONFIG_IA64_HP_SIM) += arch/ia64/hp/sim/
59 drivers-$(CONFIG_IA64_HP_ZX1) += arch/ia64/hp/common/ arch/ia64/hp/zx1/
60 drivers-$(CONFIG_IA64_HP_ZX1_SWIOTLB) += arch/ia64/hp/common/ arch/ia64/hp/zx1/
61 drivers-$(CONFIG_IA64_GENERIC) += arch/ia64/hp/common/ arch/ia64/hp/zx1/ arch/ia64/hp/sim/ arch/ia64/sn/ arch/ia64/uv/
64 boot := arch/ia64/hp/sim/boot
/linux-4.4.14/arch/ia64/hp/sim/boot/
H A Dssc.h3 * David Mosberger-Tang <davidm@hpl.hp.com>
4 * Stephane Eranian <eranian@hpl.hp.com>
H A Dbootloader.c2 * arch/ia64/hp/sim/boot/bootloader.c
7 * David Mosberger-Tang <davidm@hpl.hp.com>
8 * Stephane Eranian <eranian@hpl.hp.com>
H A DMakefile8 # Copyright (C) 1998, 2003 by David Mosberger-Tang <davidm@hpl.hp.com>
/linux-4.4.14/drivers/rtc/
H A Drtc-efi-platform.c5 * Stephane Eranian <eranian@hpl.hp.com>
6 * David Mosberger <davidm@hpl.hp.com>
/linux-4.4.14/lib/
H A Dint_sqrt.c2 * Copyright (C) 2013 Davidlohr Bueso <davidlohr.bueso@hp.com>
H A Ddiv64.c6 * Copyright (C) 1999 David Mosberger-Tang <davidm@hpl.hp.com>
/linux-4.4.14/arch/s390/include/asm/
H A Dcpu.h3 * Author(s): Hartmut Penner <hp@de.ibm.com>,
H A Dpage.h4 * Author(s): Hartmut Penner (hp@de.ibm.com)
H A Dpgalloc.h4 * Author(s): Hartmut Penner (hp@de.ibm.com)
/linux-4.4.14/arch/ia64/kernel/
H A Dfsyscall_gtod_data.h3 * Contributed by Peter Keilty <peter.keilty@hp.com>
H A Dirq_lsapic.c11 * Copyright (C) 2000 David Mosberger-Tang <davidm@hpl.hp.com>
H A Dinit_task.c6 * David Mosberger-Tang <davidm@hpl.hp.com>
H A Dacpi-ext.c3 * Alex Williamson <alex.williamson@hp.com>
4 * Bjorn Helgaas <bjorn.helgaas@hp.com>
H A Desi.c5 * Alex Williamson <alex.williamson@hp.com>
15 MODULE_AUTHOR("Alex Williamson <alex.williamson@hp.com>");
H A Dperfmon_generic.h6 * Stephane Eranian <eranian@hpl.hp.com>
H A Defi_stub.S5 * David Mosberger <davidm@hpl.hp.com>
H A Desi_stub.S5 * Alex Williamson <alex.williamson@hp.com>
H A Dmachine_kexec.c6 * Copyright (C) 2005 Khalid Aziz <khalid.aziz@hp.com>
/linux-4.4.14/drivers/pci/hotplug/
H A Dacpiphp.h10 * Copyright (C) 2003-2005 Matthew Wilcox (matthew.wilcox@hp.com)
119 struct acpi_hotplug_context hp; member in struct:acpiphp_context
125 static inline struct acpiphp_context *to_acpiphp_context(struct acpi_hotplug_context *hp) to_acpiphp_context() argument
127 return container_of(hp, struct acpiphp_context, hp); to_acpiphp_context()
137 return func_to_context(func)->hp.self; func_to_acpi_device()
146 struct acpi_hotplug_context hp; member in struct:acpiphp_root_context
150 static inline struct acpiphp_root_context *to_acpiphp_root_context(struct acpi_hotplug_context *hp) to_acpiphp_root_context() argument
152 return container_of(hp, struct acpiphp_root_context, hp); to_acpiphp_root_context()
H A Dacpiphp_glue.c7 * Copyright (C) 2003-2005 Matthew Wilcox (matthew.wilcox@hp.com)
82 context->hp.notify = acpiphp_hotplug_notify; acpiphp_init_context()
83 context->hp.fixup = acpiphp_post_dock_fixup; acpiphp_init_context()
84 acpi_set_hp_context(adev, &context->hp); acpiphp_init_context()
98 if (!adev->hp) acpiphp_get_context()
101 context = to_acpiphp_context(adev->hp); acpiphp_get_context()
120 context->hp.self->hp = NULL; acpiphp_put_context()
382 adev->hp->notify = NULL; cleanup_bridge()
383 adev->hp->fixup = NULL; cleanup_bridge()
732 if (adev->hp) { acpiphp_check_host_bridge()
733 bridge = to_acpiphp_root_context(adev->hp)->root_bridge; acpiphp_check_host_bridge()
752 acpi_handle handle = context->hp.self->handle; hotplug_event()
866 acpi_set_hp_context(adev, &root_context->hp); acpiphp_enumerate_slots()
917 root_context = to_acpiphp_root_context(adev->hp); acpiphp_drop_bridge()
918 adev->hp = NULL; acpiphp_drop_bridge()
/linux-4.4.14/net/ipv6/
H A Dexthdrs_core.c79 struct ipv6_opt_hdr _hdr, *hp; ipv6_skip_exthdr() local
84 hp = skb_header_pointer(skb, start, sizeof(_hdr), &_hdr); ipv6_skip_exthdr()
85 if (!hp) ipv6_skip_exthdr()
102 hdrlen = (hp->hdrlen+2)<<2; ipv6_skip_exthdr()
104 hdrlen = ipv6_optlen(hp); ipv6_skip_exthdr()
106 nexthdr = hp->nexthdr; ipv6_skip_exthdr()
210 struct ipv6_opt_hdr _hdr, *hp; ipv6_find_hdr() local
220 hp = skb_header_pointer(skb, start, sizeof(_hdr), &_hdr); ipv6_find_hdr()
221 if (!hp) ipv6_find_hdr()
254 ((!ipv6_ext_hdr(hp->nexthdr)) || ipv6_find_hdr()
255 hp->nexthdr == NEXTHDR_NONE)) { ipv6_find_hdr()
258 return hp->nexthdr; ipv6_find_hdr()
270 hdrlen = (hp->hdrlen + 2) << 2; ipv6_find_hdr()
272 hdrlen = ipv6_optlen(hp); ipv6_find_hdr()
275 nexthdr = hp->nexthdr; ipv6_find_hdr()
H A Dtcp_ipv6.c530 static int tcp_v6_md5_hash_pseudoheader(struct tcp_md5sig_pool *hp, tcp_v6_md5_hash_pseudoheader() argument
537 bp = &hp->md5_blk.ip6; tcp_v6_md5_hash_pseudoheader()
545 return crypto_hash_update(&hp->md5_desc, &sg, sizeof(*bp)); tcp_v6_md5_hash_pseudoheader()
552 struct tcp_md5sig_pool *hp; tcp_v6_md5_hash_hdr() local
555 hp = tcp_get_md5sig_pool(); tcp_v6_md5_hash_hdr()
556 if (!hp) tcp_v6_md5_hash_hdr()
558 desc = &hp->md5_desc; tcp_v6_md5_hash_hdr()
562 if (tcp_v6_md5_hash_pseudoheader(hp, daddr, saddr, th->doff << 2)) tcp_v6_md5_hash_hdr()
564 if (tcp_md5_hash_header(hp, th)) tcp_v6_md5_hash_hdr()
566 if (tcp_md5_hash_key(hp, key)) tcp_v6_md5_hash_hdr()
587 struct tcp_md5sig_pool *hp; tcp_v6_md5_hash_skb() local
600 hp = tcp_get_md5sig_pool(); tcp_v6_md5_hash_skb()
601 if (!hp) tcp_v6_md5_hash_skb()
603 desc = &hp->md5_desc; tcp_v6_md5_hash_skb()
608 if (tcp_v6_md5_hash_pseudoheader(hp, daddr, saddr, skb->len)) tcp_v6_md5_hash_skb()
610 if (tcp_md5_hash_header(hp, th)) tcp_v6_md5_hash_skb()
612 if (tcp_md5_hash_skb_data(hp, skb, th->doff << 2)) tcp_v6_md5_hash_skb()
614 if (tcp_md5_hash_key(hp, key)) tcp_v6_md5_hash_skb()
/linux-4.4.14/net/netfilter/
H A Dxt_TPROXY.c257 struct tcphdr _hdr, *hp; tproxy_handle_time_wait4() local
259 hp = skb_header_pointer(skb, ip_hdrlen(skb), sizeof(_hdr), &_hdr); tproxy_handle_time_wait4()
260 if (hp == NULL) { tproxy_handle_time_wait4()
265 if (hp->syn && !hp->rst && !hp->ack && !hp->fin) { tproxy_handle_time_wait4()
272 hp->source, lport ? lport : hp->dest, tproxy_handle_time_wait4()
297 struct udphdr _hdr, *hp; tproxy_tg4() local
300 hp = skb_header_pointer(skb, ip_hdrlen(skb), sizeof(_hdr), &_hdr); tproxy_tg4()
301 if (hp == NULL) tproxy_tg4()
310 hp->source, hp->dest, tproxy_tg4()
315 lport = hp->dest; tproxy_tg4()
326 hp->source, lport, tproxy_tg4()
336 iph->protocol, &iph->daddr, ntohs(hp->dest), tproxy_tg4()
344 iph->protocol, &iph->saddr, ntohs(hp->source), tproxy_tg4()
345 &iph->daddr, ntohs(hp->dest), skb->mark); tproxy_tg4()
418 struct tcphdr _hdr, *hp; tproxy_handle_time_wait6() local
421 hp = skb_header_pointer(skb, thoff, sizeof(_hdr), &_hdr); tproxy_handle_time_wait6()
422 if (hp == NULL) { tproxy_handle_time_wait6()
427 if (hp->syn && !hp->rst && !hp->ack && !hp->fin) { tproxy_handle_time_wait6()
435 hp->source, tproxy_handle_time_wait6()
436 tgi->lport ? tgi->lport : hp->dest, tproxy_handle_time_wait6()
452 struct udphdr _hdr, *hp; tproxy_tg6_v1() local
465 hp = skb_header_pointer(skb, thoff, sizeof(_hdr), &_hdr); tproxy_tg6_v1()
466 if (hp == NULL) { tproxy_tg6_v1()
477 hp->source, hp->dest, tproxy_tg6_v1()
481 lport = tgi->lport ? tgi->lport : hp->dest; tproxy_tg6_v1()
492 hp->source, lport, tproxy_tg6_v1()
502 tproto, &iph->saddr, ntohs(hp->source), tproxy_tg6_v1()
510 tproto, &iph->saddr, ntohs(hp->source), tproxy_tg6_v1()
511 &iph->daddr, ntohs(hp->dest), skb->mark); tproxy_tg6_v1()
H A Dxt_socket.c160 struct udphdr _hdr, *hp; xt_socket_lookup_slow_v4() local
162 hp = skb_header_pointer(skb, ip_hdrlen(skb), xt_socket_lookup_slow_v4()
164 if (hp == NULL) xt_socket_lookup_slow_v4()
169 sport = hp->source; xt_socket_lookup_slow_v4()
171 dport = hp->dest; xt_socket_lookup_slow_v4()
355 struct udphdr _hdr, *hp; xt_socket_lookup_slow_v6() local
357 hp = skb_header_pointer(skb, thoff, sizeof(_hdr), &_hdr); xt_socket_lookup_slow_v6()
358 if (hp == NULL) xt_socket_lookup_slow_v6()
362 sport = hp->source; xt_socket_lookup_slow_v6()
364 dport = hp->dest; xt_socket_lookup_slow_v6()
H A Dnf_conntrack_proto_udp.c44 const struct udphdr *hp; udp_pkt_to_tuple() local
48 hp = skb_header_pointer(skb, dataoff, sizeof(_hdr), &_hdr); udp_pkt_to_tuple()
49 if (hp == NULL) udp_pkt_to_tuple()
52 tuple->src.u.udp.port = hp->source; udp_pkt_to_tuple()
53 tuple->dst.u.udp.port = hp->dest; udp_pkt_to_tuple()
H A Dnf_conntrack_proto_udplite.c54 const struct udphdr *hp; udplite_pkt_to_tuple() local
57 hp = skb_header_pointer(skb, dataoff, sizeof(_hdr), &_hdr); udplite_pkt_to_tuple()
58 if (hp == NULL) udplite_pkt_to_tuple()
61 tuple->src.u.udp.port = hp->source; udplite_pkt_to_tuple()
62 tuple->dst.u.udp.port = hp->dest; udplite_pkt_to_tuple()
H A Dxt_HMARK.c64 union hmark_ports hp; hmark_swap_ports() local
67 hp.b32 = (uports->b32 & info->port_mask.b32) | info->port_set.b32; hmark_swap_ports()
68 src = ntohs(hp.b16.src); hmark_swap_ports()
69 dst = ntohs(hp.b16.dst); hmark_swap_ports()
/linux-4.4.14/net/ipv6/netfilter/
H A Dip6t_ipv6header.c49 const struct ipv6_opt_hdr *hp; ipv6header_mt6() local
67 hp = skb_header_pointer(skb, ptr, sizeof(_hdr), &_hdr); ipv6header_mt6()
68 BUG_ON(hp == NULL); ipv6header_mt6()
74 hdrlen = (hp->hdrlen + 2) << 2; ipv6header_mt6()
76 hdrlen = ipv6_optlen(hp); ipv6header_mt6()
99 nexthdr = hp->nexthdr; ipv6header_mt6()
H A Dnf_log_ipv6.c78 const struct ipv6_opt_hdr *hp; dump_ipv6_packet() local
80 hp = skb_header_pointer(skb, ptr, sizeof(_hdr), &_hdr); dump_ipv6_packet()
81 if (hp == NULL) { dump_ipv6_packet()
128 hdrlen = ipv6_optlen(hp); dump_ipv6_packet()
161 hdrlen = (hp->hdrlen+2)<<2; dump_ipv6_packet()
200 currenthdr = hp->nexthdr; dump_ipv6_packet()
H A Dnf_conntrack_proto_icmpv6.c42 const struct icmp6hdr *hp; icmpv6_pkt_to_tuple() local
45 hp = skb_header_pointer(skb, dataoff, sizeof(_hdr), &_hdr); icmpv6_pkt_to_tuple()
46 if (hp == NULL) icmpv6_pkt_to_tuple()
48 tuple->dst.u.icmp.type = hp->icmp6_type; icmpv6_pkt_to_tuple()
49 tuple->src.u.icmp.id = hp->icmp6_identifier; icmpv6_pkt_to_tuple()
50 tuple->dst.u.icmp.code = hp->icmp6_code; icmpv6_pkt_to_tuple()
/linux-4.4.14/drivers/clk/pxa/
H A Dclk-pxa.c32 struct clk_fixed_factor hp; member in struct:pxa_clk
48 fix = &pclk->hp; cken_recalc_rate()
90 pxa_clk->hp = clks[i].hp; clk_pxa_cken_init()
H A Dclk-pxa.h77 struct clk_fixed_factor hp; member in struct:desc_clk_cken
88 .hp = { .mult = _mult_hp, .div = _div_hp }, \
/linux-4.4.14/net/sunrpc/
H A Dsvcauth.c141 struct auth_domain *hp; auth_domain_lookup() local
148 hlist_for_each_entry(hp, head, hash) { hlist_for_each_entry()
149 if (strcmp(hp->name, name)==0) { hlist_for_each_entry()
150 kref_get(&hp->ref); hlist_for_each_entry()
152 return hp; hlist_for_each_entry()
/linux-4.4.14/drivers/scsi/
H A Dsg.c405 sg_io_hdr_t *hp; sg_read() local
471 hp = &srp->header; sg_read()
480 old_hdr->reply_len = (int) hp->timeout; sg_read()
482 old_hdr->pack_id = hp->pack_id; sg_read()
484 ((srp->data.cmd_opcode >= 0xc0) && (12 == hp->cmd_len)) ? 1 : 0; sg_read()
485 old_hdr->target_status = hp->masked_status; sg_read()
486 old_hdr->host_status = hp->host_status; sg_read()
487 old_hdr->driver_status = hp->driver_status; sg_read()
488 if ((CHECK_CONDITION & hp->masked_status) || sg_read()
489 (DRIVER_SENSE & hp->driver_status)) sg_read()
492 switch (hp->host_status) { sg_read()
514 hp->masked_status == GOOD) ? 0 : EIO; sg_read()
548 sg_io_hdr_t *hp = &srp->header; sg_new_read() local
556 hp->sb_len_wr = 0; sg_new_read()
557 if ((hp->mx_sb_len > 0) && hp->sbp) { sg_new_read()
558 if ((CHECK_CONDITION & hp->masked_status) || sg_new_read()
559 (DRIVER_SENSE & hp->driver_status)) { sg_new_read()
561 sb_len = (hp->mx_sb_len > sb_len) ? sb_len : hp->mx_sb_len; sg_new_read()
564 if (copy_to_user(hp->sbp, srp->sense_b, len)) { sg_new_read()
568 hp->sb_len_wr = len; sg_new_read()
571 if (hp->masked_status || hp->host_status || hp->driver_status) sg_new_read()
572 hp->info |= SG_INFO_CHECK; sg_new_read()
573 if (copy_to_user(buf, hp, SZ_SG_IO_HDR)) { sg_new_read()
592 sg_io_hdr_t *hp; sg_write() local
644 hp = &srp->header; sg_write()
645 hp->interface_id = '\0'; /* indicator of old interface tunnelled */ sg_write()
646 hp->cmd_len = (unsigned char) cmd_size; sg_write()
647 hp->iovec_count = 0; sg_write()
648 hp->mx_sb_len = 0; sg_write()
650 hp->dxfer_direction = (old_hdr.reply_len > SZ_SG_HEADER) ? sg_write()
653 hp->dxfer_direction = (mxsize > 0) ? SG_DXFER_FROM_DEV : SG_DXFER_NONE; sg_write()
654 hp->dxfer_len = mxsize; sg_write()
655 if ((hp->dxfer_direction == SG_DXFER_TO_DEV) || sg_write()
656 (hp->dxfer_direction == SG_DXFER_TO_FROM_DEV)) sg_write()
657 hp->dxferp = (char __user *)buf + cmd_size; sg_write()
659 hp->dxferp = NULL; sg_write()
660 hp->sbp = NULL; sg_write()
661 hp->timeout = old_hdr.reply_len; /* structure abuse ... */ sg_write()
662 hp->flags = input_size; /* structure abuse ... */ sg_write()
663 hp->pack_id = old_hdr.pack_id; sg_write()
664 hp->usr_ptr = NULL; sg_write()
672 if (hp->dxfer_direction == SG_DXFER_TO_FROM_DEV) { sg_write()
697 sg_io_hdr_t *hp; sg_new_write() local
714 hp = &srp->header; sg_new_write()
715 if (__copy_from_user(hp, buf, SZ_SG_IO_HDR)) { sg_new_write()
719 if (hp->interface_id != 'S') { sg_new_write()
723 if (hp->flags & SG_FLAG_MMAP_IO) { sg_new_write()
724 if (hp->dxfer_len > sfp->reserve.bufflen) { sg_new_write()
728 if (hp->flags & SG_FLAG_DIRECT_IO) { sg_new_write()
739 if ((!hp->cmdp) || (hp->cmd_len < 6) || (hp->cmd_len > sizeof (cmnd))) { sg_new_write()
743 if (!access_ok(VERIFY_READ, hp->cmdp, hp->cmd_len)) { sg_new_write()
747 if (__copy_from_user(cmnd, hp->cmdp, hp->cmd_len)) { sg_new_write()
769 sg_io_hdr_t *hp = &srp->header; sg_common_write() local
772 hp->status = 0; sg_common_write()
773 hp->masked_status = 0; sg_common_write()
774 hp->msg_status = 0; sg_common_write()
775 hp->info = 0; sg_common_write()
776 hp->host_status = 0; sg_common_write()
777 hp->driver_status = 0; sg_common_write()
778 hp->resid = 0; sg_common_write()
781 (int) cmnd[0], (int) hp->cmd_len)); sg_common_write()
803 hp->duration = jiffies_to_msecs(jiffies); sg_common_write()
804 if (hp->interface_id != '\0' && /* v3 (or later) interface */ sg_common_write()
805 (SG_FLAG_Q_AT_TAIL & hp->flags)) sg_common_write()
1669 sg_io_hdr_t *hp = &srp->header; sg_start_req() local
1670 int dxfer_len = (int) hp->dxfer_len; sg_start_req()
1671 int dxfer_dir = hp->dxfer_direction; sg_start_req()
1672 unsigned int iov_count = hp->iovec_count; sg_start_req()
1677 int rw = hp->dxfer_direction == SG_DXFER_TO_DEV ? WRITE : READ; sg_start_req()
1684 if (hp->cmd_len > BLK_MAX_CDB) { sg_start_req()
1685 long_cmdp = kzalloc(hp->cmd_len, GFP_KERNEL); sg_start_req()
1713 if (hp->cmd_len > BLK_MAX_CDB) sg_start_req()
1715 memcpy(rq->cmd, cmd, hp->cmd_len); sg_start_req()
1716 rq->cmd_len = hp->cmd_len; sg_start_req()
1726 if (sg_allow_dio && hp->flags & SG_FLAG_DIRECT_IO && sg_start_req()
1729 blk_rq_aligned(q, (unsigned long)hp->dxferp, dxfer_len)) sg_start_req()
1747 md->null_mapped = hp->dxferp ? 0 : 1; sg_start_req()
1758 res = import_iovec(rw, hp->dxferp, iov_count, 0, &iov, &i); sg_start_req()
1762 iov_iter_truncate(&i, hp->dxfer_len); sg_start_req()
1767 res = blk_rq_map_user(q, rq, md, hp->dxferp, sg_start_req()
1768 hp->dxfer_len, GFP_ATOMIC); sg_start_req()
1775 hp->info |= SG_INFO_DIRECT_IO; sg_start_req()
2600 const sg_io_hdr_t *hp; sg_proc_debug_helper() local
2620 hp = &srp->header; sg_proc_debug_helper()
2621 new_interface = (hp->interface_id == '\0') ? 0 : 1; sg_proc_debug_helper()
2624 (SG_FLAG_MMAP_IO & hp->flags)) sg_proc_debug_helper()
2629 if (SG_INFO_DIRECT_IO_MASK & hp->info) sg_proc_debug_helper()
2643 seq_printf(s, " dur=%d", hp->duration); sg_proc_debug_helper()
2647 (new_interface ? hp->timeout : sg_proc_debug_helper()
2649 (ms > hp->duration ? ms - hp->duration : 0)); sg_proc_debug_helper()
/linux-4.4.14/drivers/platform/x86/
H A Dhp-wireless.c2 * hp-wireless button for Windows 8
89 pr_err("Failed to setup hp wireless hotkeys\n"); hpwl_add()
101 .name = "hp-wireless",
H A Dhp-wmi.c727 wifi_rfkill = rfkill_alloc("hp-wifi", &device->dev, hp_wmi_rfkill_setup()
743 bluetooth_rfkill = rfkill_alloc("hp-bluetooth", &device->dev, hp_wmi_rfkill_setup()
761 wwan_rfkill = rfkill_alloc("hp-wwan", &device->dev, hp_wmi_rfkill_setup()
779 gps_rfkill = rfkill_alloc("hp-gps", &device->dev, hp_wmi_rfkill_setup()
839 name = "hp-wifi"; hp_wmi_rfkill2_setup()
843 name = "hp-bluetooth"; hp_wmi_rfkill2_setup()
847 name = "hp-wwan"; hp_wmi_rfkill2_setup()
851 name = "hp-gps"; hp_wmi_rfkill2_setup()
1017 .name = "hp-wmi",
1040 platform_device_register_simple("hp-wmi", -1, NULL, 0); hp_wmi_init()
/linux-4.4.14/drivers/staging/lustre/lustre/ptlrpc/
H A Dptlrpc_internal.h123 struct ptlrpc_request *req, bool hp);
127 struct ptlrpc_request *req, bool hp);
130 ptlrpc_nrs_req_get_nolock0(struct ptlrpc_service_part *svcpt, bool hp,
134 ptlrpc_nrs_req_get_nolock(struct ptlrpc_service_part *svcpt, bool hp, ptlrpc_nrs_req_get_nolock() argument
137 return ptlrpc_nrs_req_get_nolock0(svcpt, hp, false, force); ptlrpc_nrs_req_get_nolock()
140 bool ptlrpc_nrs_req_pending_nolock(struct ptlrpc_service_part *svcpt, bool hp);
164 struct ptlrpc_nrs *nrs_svcpt2nrs(struct ptlrpc_service_part *svcpt, bool hp) nrs_svcpt2nrs() argument
166 LASSERT(ergo(hp, nrs_svcpt_has_hp(svcpt))); nrs_svcpt2nrs()
167 return hp ? svcpt->scp_nrs_hp : &svcpt->scp_nrs_reg; nrs_svcpt2nrs()
H A Dnrs.c993 bool hp = false; nrs_svcpt_cleanup_locked() local
998 nrs = nrs_svcpt2nrs(svcpt, hp); nrs_svcpt_cleanup_locked()
1010 if (!hp && nrs_svcpt_has_hp(svcpt)) { nrs_svcpt_cleanup_locked()
1011 hp = true; nrs_svcpt_cleanup_locked()
1015 if (hp) nrs_svcpt_cleanup_locked()
1068 bool hp = false; ptlrpc_service_for_each_part() local
1071 nrs = nrs_svcpt2nrs(svcpt, hp); ptlrpc_service_for_each_part()
1086 if (!hp && nrs_svc_has_hp(svc)) { ptlrpc_service_for_each_part()
1087 hp = true; ptlrpc_service_for_each_part()
1198 bool hp = false; ptlrpc_service_for_each_part() local
1200 nrs = nrs_svcpt2nrs(svcpt, hp); ptlrpc_service_for_each_part()
1217 if (!hp && nrs_svc_has_hp(svc)) { ptlrpc_service_for_each_part()
1218 hp = true; ptlrpc_service_for_each_part()
1348 * \param[in] hp which NRS head of \a svcpt to use
1351 struct ptlrpc_request *req, bool hp) ptlrpc_nrs_req_initialize()
1353 struct ptlrpc_nrs *nrs = nrs_svcpt2nrs(svcpt, hp); ptlrpc_nrs_req_initialize()
1396 * \param[in] hp whether to enqueue the request on the regular or
1400 struct ptlrpc_request *req, bool hp) ptlrpc_nrs_req_add()
1404 if (hp) ptlrpc_nrs_req_add()
1446 * \param[in] hp whether to obtain a request from the regular or
1458 ptlrpc_nrs_req_get_nolock0(struct ptlrpc_service_part *svcpt, bool hp, ptlrpc_nrs_req_get_nolock0() argument
1461 struct ptlrpc_nrs *nrs = nrs_svcpt2nrs(svcpt, hp); ptlrpc_nrs_req_get_nolock0()
1491 * policies of service partition's \a svcpt NRS head specified by \a hp. Should
1496 * \param[in] hp whether the regular or high-priority NRS head is to be
1502 bool ptlrpc_nrs_req_pending_nolock(struct ptlrpc_service_part *svcpt, bool hp) ptlrpc_nrs_req_pending_nolock() argument
1504 struct ptlrpc_nrs *nrs = nrs_svcpt2nrs(svcpt, hp); ptlrpc_nrs_req_pending_nolock()
1350 ptlrpc_nrs_req_initialize(struct ptlrpc_service_part *svcpt, struct ptlrpc_request *req, bool hp) ptlrpc_nrs_req_initialize() argument
1399 ptlrpc_nrs_req_add(struct ptlrpc_service_part *svcpt, struct ptlrpc_request *req, bool hp) ptlrpc_nrs_req_add() argument
H A Dlproc_ptlrpc.c489 bool hp = false; ptlrpc_lprocfs_nrs_seq_show() local
518 nrs = nrs_svcpt2nrs(svcpt, hp); ptlrpc_service_for_each_part()
595 !hp ? "\nregular_requests:" : "high_priority_requests:");
610 if (!hp && nrs_svc_has_hp(svc)) {
616 hp = true;
636 * Commands consist of the policy name, followed by an optional [reg|hp] token;
677 * No [reg|hp] token has been specified ptlrpc_lprocfs_nrs_seq_write()
683 * The second token is either NULL, or an optional [reg|hp] string ptlrpc_lprocfs_nrs_seq_write()
687 else if (strcmp(cmd, "hp") == 0) ptlrpc_lprocfs_nrs_seq_write()
/linux-4.4.14/include/scsi/fc/
H A Dfc_fcoe.h57 #define FC_FCOE_DECAPS_VER(hp) ((hp)->fcoe_ver >> 4)
58 #define FC_FCOE_ENCAPS_VER(hp, ver) ((hp)->fcoe_ver = (ver) << 4)
/linux-4.4.14/include/linux/
H A Dpoison.h54 /********** arch/ia64/hp/common/sba_iommu.c **********/
56 * arch/ia64/hp/common/sba_iommu.c uses a 16-byte poison string with a
H A Dwireless.h6 * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com>
/linux-4.4.14/arch/ia64/lib/
H A Dclear_page.S3 * Stephane Eranian <eranian@hpl.hp.com>
4 * David Mosberger-Tang <davidm@hpl.hp.com>
H A Dcarta_random.S8 * David Mosberger-Tang <davidm@hpl.hp.com>
H A Dcopy_page.S12 * Stephane Eranian <eranian@hpl.hp.com>
13 * David Mosberger <davidm@hpl.hp.com>
H A Didiv32.S3 * Copyright (C) 2000 David Mosberger-Tang <davidm@hpl.hp.com>
14 * (http://www.hp.com/go/retailbooks/)
H A Didiv64.S3 * Copyright (C) 1999-2000 David Mosberger-Tang <davidm@hpl.hp.com>
14 * (http://www.hp.com/go/retailbooks/)
H A Dchecksum.c5 * Stephane Eranian <eranian@hpl.hp.com>
H A Dcsum_partial_copy.c5 * Stephane Eranian <eranian@hpl.hp.com>
/linux-4.4.14/arch/arm/mach-sa1100/include/mach/
H A Dbadge4.h4 * Tim Connors <connors@hpl.hp.com>
5 * Christopher Hoover <ch@hpl.hp.com>
/linux-4.4.14/drivers/firmware/
H A Dpcdp.c5 * Khalid Aziz <khalid.aziz@hp.com>
6 * Alex Williamson <alex.williamson@hp.com>
7 * Bjorn Helgaas <bjorn.helgaas@hp.com>
H A Dpcdp.h8 * Khalid Aziz <khalid.aziz@hp.com>
9 * Bjorn Helgaas <bjorn.helgaas@hp.com>
/linux-4.4.14/sound/soc/codecs/
H A Dsirf-audio-codec.c195 SND_SOC_DAPM_SWITCH("Left dac to hp left amp", SND_SOC_NOPM, 0, 0,
197 SND_SOC_DAPM_SWITCH("Left dac to hp right amp", SND_SOC_NOPM, 0, 0,
199 SND_SOC_DAPM_SWITCH("Right dac to hp left amp", SND_SOC_NOPM, 0, 0,
201 SND_SOC_DAPM_SWITCH("Right dac to hp right amp", SND_SOC_NOPM, 0, 0,
253 {"HP amp left driver", NULL, "Right dac to hp left amp"},
254 {"HP amp right driver", NULL , "Right dac to hp right amp"},
255 {"HP amp left driver", NULL, "Left dac to hp left amp"},
256 {"HP amp right driver", NULL , "Right dac to hp right amp"},
257 {"Right dac to hp left amp", "Switch", "DAC left"},
258 {"Right dac to hp right amp", "Switch", "DAC right"},
259 {"Left dac to hp left amp", "Switch", "DAC left"},
260 {"Left dac to hp right amp", "Switch", "DAC right"},
H A Drt298.c221 static int rt298_jack_detect(struct rt298_priv *rt298, bool *hp, bool *mic) rt298_jack_detect() argument
226 *hp = false; rt298_jack_detect()
236 *hp = buf & 0x80000000; rt298_jack_detect()
237 if (*hp == rt298->is_hp_in) rt298_jack_detect()
239 rt298->is_hp_in = *hp; rt298_jack_detect()
240 if (*hp) { rt298_jack_detect()
281 *hp = buf & 0x80000000; rt298_jack_detect()
288 if (!*hp) rt298_jack_detect()
292 pr_debug("*hp = %d *mic = %d\n", *hp, *mic); rt298_jack_detect()
302 bool hp = false; rt298_jack_detect_work() local
305 if (rt298_jack_detect(rt298, &hp, &mic) < 0) rt298_jack_detect_work()
308 if (hp == true) rt298_jack_detect_work()
962 bool hp = false; rt298_irq() local
966 ret = rt298_jack_detect(rt298, &hp, &mic); rt298_irq()
972 if (hp == true) rt298_irq()
H A Drt286.c215 static int rt286_jack_detect(struct rt286_priv *rt286, bool *hp, bool *mic) rt286_jack_detect() argument
220 *hp = false; rt286_jack_detect()
230 *hp = buf & 0x80000000; rt286_jack_detect()
231 if (*hp) { rt286_jack_detect()
272 *hp = buf & 0x80000000; rt286_jack_detect()
279 if (!*hp) rt286_jack_detect()
291 bool hp = false; rt286_jack_detect_work() local
294 rt286_jack_detect(rt286, &hp, &mic); rt286_jack_detect_work()
296 if (hp == true) rt286_jack_detect_work()
937 bool hp = false; rt286_irq() local
941 rt286_jack_detect(rt286, &hp, &mic); rt286_irq()
946 if (hp == true) rt286_irq()
/linux-4.4.14/drivers/net/ethernet/broadcom/bnx2x/
H A Dbnx2x_fw_file_hdr.h13 * Based on the original idea of John Wright <john.wright@hp.com>.
/linux-4.4.14/arch/ia64/sn/kernel/sn2/
H A Dtimer.c6 * David Mosberger <davidm@hpl.hp.com>: updated for new timer-interpolation infrastructure
/linux-4.4.14/arch/x86/platform/efi/
H A Defi_32.c9 * David Mosberger-Tang <davidm@hpl.hp.com>
10 * Stephane Eranian <eranian@hpl.hp.com>
/linux-4.4.14/kernel/
H A Dconfigs.c5 * Copyright (C) 2002 Khalid Aziz <khalid_aziz@hp.com>
7 * Copyright (C) 2002 Al Stone <ahs3@fc.hp.com>
/linux-4.4.14/arch/powerpc/include/asm/
H A Dhvsi.h86 extern int hvsilib_open(struct hvsi_priv *pv, struct hvc_struct *hp);
87 extern void hvsilib_close(struct hvsi_priv *pv, struct hvc_struct *hp);
/linux-4.4.14/arch/sparc/include/asm/
H A Dmdesc.h39 const char *mdesc_node_name(struct mdesc_handle *hp, u64 node);
60 u64 mdesc_arc_target(struct mdesc_handle *hp, u64 arc);
/linux-4.4.14/arch/sparc/mm/
H A Dtsb.c229 struct hv_tsb_descr *hp = &mm->context.tsb_descr[tsb_idx]; setup_tsb_params() local
233 hp->pgsz_idx = HV_PGSZ_IDX_BASE; setup_tsb_params()
237 hp->pgsz_idx = HV_PGSZ_IDX_HUGE; setup_tsb_params()
243 hp->assoc = 1; setup_tsb_params()
244 hp->num_ttes = tsb_bytes / 16; setup_tsb_params()
245 hp->ctx_idx = 0; setup_tsb_params()
248 hp->pgsz_mask = HV_PGSZ_MASK_BASE; setup_tsb_params()
252 hp->pgsz_mask = HV_PGSZ_MASK_HUGE; setup_tsb_params()
258 hp->tsb_base = tsb_paddr; setup_tsb_params()
259 hp->resv = 0; setup_tsb_params()
/linux-4.4.14/arch/mips/sgi-ip22/
H A Dip28-berr.c415 struct hpc3_stat *hp = (struct hpc3_stat *)&hpc3 + i; ip28_be_interrupt() local
417 (cpu_err_addr == hp->ndptr || cpu_err_addr == hp->cbp)) ip28_be_interrupt()
420 (gio_err_addr == hp->ndptr || gio_err_addr == hp->cbp)) ip28_be_interrupt()
424 struct hpc3_stat *hp = (struct hpc3_stat *)&hpc3 + i; ip28_be_interrupt() local
427 CPHYSADDR(hp->addr), hp->ctrl, hp->ndptr, hp->cbp); ip28_be_interrupt()
/linux-4.4.14/drivers/sh/intc/
H A Dchip.c117 static struct intc_handle_int *intc_find_irq(struct intc_handle_int *hp, intc_find_irq() argument
126 return bsearch(&key, hp, nr_hp, sizeof(*hp), intc_handle_int_cmp); intc_find_irq()
H A Dcore.c78 struct intc_handle_int *hp; intc_register_irq() local
132 hp = d->prio + d->nr_prio; intc_register_irq()
133 hp->irq = irq; intc_register_irq()
134 hp->handle = data[1]; intc_register_irq()
141 hp->handle &= ~_INTC_MK(0x0f, 0, 0, 0, 0, 0); intc_register_irq()
142 hp->handle |= _INTC_MK(REG_FN_ERR, 0, 0, 0, 0, 0); intc_register_irq()
/linux-4.4.14/net/ipv4/netfilter/
H A Dnf_conntrack_proto_icmp.c35 const struct icmphdr *hp; icmp_pkt_to_tuple() local
38 hp = skb_header_pointer(skb, dataoff, sizeof(_hdr), &_hdr); icmp_pkt_to_tuple()
39 if (hp == NULL) icmp_pkt_to_tuple()
42 tuple->dst.u.icmp.type = hp->type; icmp_pkt_to_tuple()
43 tuple->src.u.icmp.id = hp->un.echo.id; icmp_pkt_to_tuple()
44 tuple->dst.u.icmp.code = hp->code; icmp_pkt_to_tuple()
/linux-4.4.14/tools/laptop/freefall/
H A Dfreefall.c78 write_int("/sys/class/leds/hp::hddprotect/brightness", on); set_led()
132 if (stat("/sys/class/leds/hp::hddprotect/brightness", &st)) main()
/linux-4.4.14/include/asm-generic/
H A Dqspinlock_types.h16 * Authors: Waiman Long <waiman.long@hp.com>
/linux-4.4.14/arch/parisc/lib/
H A Dbitops.c6 * Copyright 2000 Grant Grundler (grundler@cup.hp.com)
/linux-4.4.14/arch/ia64/dig/
H A Dsetup.c6 * Copyright (C) 1999, 2001, 2003 David Mosberger-Tang <davidm@hpl.hp.com>
/linux-4.4.14/arch/arm/mach-pxa/include/mach/
H A Dpalmz72.h5 * Jan Herman <2hp@seznam.cz>
H A Dpalmtx.h8 * Jan Herman <2hp@seznam.cz>
/linux-4.4.14/sound/soc/pxa/
H A Dspitz.c59 /* enable and unmute hp jack, disable mic bias */ spitz_ext_control()
68 /* enable mic jack and bias, mute hp */ spitz_ext_control()
77 /* enable line jack, disable mic bias and mute hp */ spitz_ext_control()
86 /* enable and unmute headset jack enable mic bias, mute L hp */ spitz_ext_control()
H A Dhx4700.c42 /* disable speaker when hp jack is inserted */
52 .name = "hp-gpio",
H A Dpalm27x.c47 .name = "hp-gpio",
/linux-4.4.14/tools/arch/ia64/include/asm/
H A Dbarrier.h9 * David Mosberger-Tang <davidm@hpl.hp.com>
/linux-4.4.14/arch/powerpc/kvm/
H A Dbook3s_hv_rm_mmu.c494 __be64 *hp, *hptes[4]; kvmppc_h_bulk_remove() local
524 hp = (__be64 *) (kvm->arch.hpt_virt + (pte_index << 4)); kvmppc_h_bulk_remove()
526 if (!try_lock_hpte(hp, HPTE_V_HVLOCK)) { kvmppc_h_bulk_remove()
529 while (!try_lock_hpte(hp, HPTE_V_HVLOCK)) kvmppc_h_bulk_remove()
533 hp0 = be64_to_cpu(hp[0]); kvmppc_h_bulk_remove()
550 hp[0] &= ~cpu_to_be64(HPTE_V_HVLOCK); kvmppc_h_bulk_remove()
563 hp[0] = 0; kvmppc_h_bulk_remove()
568 hp[0] &= ~cpu_to_be64(HPTE_V_VALID); kvmppc_h_bulk_remove()
569 tlbrb[n] = compute_tlbie_rb(be64_to_cpu(hp[0]), kvmppc_h_bulk_remove()
570 be64_to_cpu(hp[1]), pte_index); kvmppc_h_bulk_remove()
572 hptes[n] = hp; kvmppc_h_bulk_remove()
587 hp = hptes[k]; kvmppc_h_bulk_remove()
590 be64_to_cpu(hp[0]), be64_to_cpu(hp[1])); kvmppc_h_bulk_remove()
593 __unlock_hpte(hp, 0); kvmppc_h_bulk_remove()
/linux-4.4.14/include/acpi/
H A Dacpi_bus.h370 struct acpi_hotplug_context *hp; member in struct:acpi_device
440 struct acpi_hotplug_context *hp) acpi_set_hp_context()
442 hp->self = adev; acpi_set_hp_context()
443 adev->hp = hp; acpi_set_hp_context()
447 struct acpi_hotplug_context *hp,
439 acpi_set_hp_context(struct acpi_device *adev, struct acpi_hotplug_context *hp) acpi_set_hp_context() argument
/linux-4.4.14/drivers/net/irda/
H A Dold_belkin-sir.c7 * Author: Jean Tourrilhes <jt@hpl.hp.com>
140 MODULE_AUTHOR("Jean Tourrilhes <jt@hpl.hp.com>");
H A Dactisys-sir.c9 * Jean Tourrilhes <jt@hpl.hp.com> (new version)
238 MODULE_AUTHOR("Dag Brattli <dagb@cs.uit.no> - Jean Tourrilhes <jt@hpl.hp.com>");
/linux-4.4.14/net/irda/
H A Dirmod.c13 * Copyright (c) 2000-2004 Jean Tourrilhes <jt@hpl.hp.com>
196 MODULE_AUTHOR("Dag Brattli <dagb@cs.uit.no> & Jean Tourrilhes <jt@hpl.hp.com>");
/linux-4.4.14/drivers/pnp/
H A Dsystem.c7 * Bjorn Helgaas <bjorn.helgaas@hp.com>
/linux-4.4.14/drivers/block/
H A Dida_ioctl.h19 * Questions/Comments/Bugfixes to iss_storagedev@hp.com
H A Dcciss_scsi.h19 * Questions/Comments/Bugfixes to iss_storagedev@hp.com
H A Dcpqarray.h19 * Questions/Comments/Bugfixes to iss_storagedev@hp.com
/linux-4.4.14/include/net/irda/
H A Daf_irda.h13 * Copyright (c) 2000-2002 Jean Tourrilhes <jt@hpl.hp.com>
H A Dirlap_event.h15 * Copyright (c) 2000-2002 Jean Tourrilhes <jt@hpl.hp.com>
H A Dirlmp_event.h14 * Copyright (c) 2000-2002 Jean Tourrilhes <jt@hpl.hp.com>
H A Ddiscovery.h13 * Copyright (c) 2000-2002 Jean Tourrilhes <jt@hpl.hp.com>
H A Dirda.h13 * Copyright (c) 2000-2002 Jean Tourrilhes <jt@hpl.hp.com>
H A Dirmod.h13 * Copyright (c) 2000-2002 Jean Tourrilhes <jt@hpl.hp.com>
H A Dtimer.h14 * Copyright (c) 2000-2002 Jean Tourrilhes <jt@hpl.hp.com>
/linux-4.4.14/include/net/sctp/
H A Dchecksum.h35 * Vlad Yasevich <vladislav.yasevich@hp.com>
H A Dauth.h27 * Vlad Yasevich <vladislav.yasevich@hp.com>
/linux-4.4.14/arch/parisc/include/asm/
H A Dldcw.h23 /* From: "Jim Hull" <jim.hull of hp.com>
/linux-4.4.14/arch/ia64/mm/
H A Dextable.c5 * David Mosberger-Tang <davidm@hpl.hp.com>
H A Dioremap.c3 * Bjorn Helgaas <bjorn.helgaas@hp.com>
/linux-4.4.14/net/irda/irnet/
H A Dirnet_ppp.h4 * Jean II - HPL `00 - <jt@hpl.hp.com>
H A Dirnet_irda.h4 * Jean II - HPL `00 - <jt@hpl.hp.com>
/linux-4.4.14/sound/soc/omap/
H A Drx51.c64 int hp = 0, hs = 0, tvout = 0; rx51_ext_control() local
69 hp = 1; rx51_ext_control()
74 hp = 1; rx51_ext_control()
88 if (hp) rx51_ext_control()
H A Dn810.c58 int hp = 0, line1l = 0; n810_ext_control() local
64 hp = 1; n810_ext_control()
78 if (hp) n810_ext_control()
/linux-4.4.14/sound/pci/hda/
H A Dpatch_analog.c89 hda_nid_t hp) ad198x_power_eapd_write()
94 if (snd_hda_query_pin_caps(codec, hp) & AC_PINCAP_EAPD) ad198x_power_eapd_write()
95 snd_hda_codec_write(codec, hp, 0, AC_VERB_SET_EAPD_BTLENABLE, ad198x_power_eapd_write()
662 * port-A 0x11 (mute/hp) <- 0x22 <- 0x37 <- 03/04/06
663 * port-B 0x14 (mute/hp) <- 0x2b <- 0x30 <- 03/04/06
665 * port-D 0x12 (mute/hp) <- 0x29 <- 04
666 * port-E 0x17 (mute/hp) <- 0x26 <- 0x32 <- 05/0a
892 { 0x11, 0x02214130 }, /* front-hp */
953 * port-D - rear line/hp-out
954 * port-A - front line/hp-out
965 * port-A (0x11) - front hp-out
1128 * port-A - front hp-out
88 ad198x_power_eapd_write(struct hda_codec *codec, hda_nid_t front, hda_nid_t hp) ad198x_power_eapd_write() argument
/linux-4.4.14/net/ipv4/
H A Dtcp_ipv4.c1018 static int tcp_v4_md5_hash_pseudoheader(struct tcp_md5sig_pool *hp, tcp_v4_md5_hash_pseudoheader() argument
1024 bp = &hp->md5_blk.ip4; tcp_v4_md5_hash_pseudoheader()
1038 return crypto_hash_update(&hp->md5_desc, &sg, sizeof(*bp)); tcp_v4_md5_hash_pseudoheader()
1044 struct tcp_md5sig_pool *hp; tcp_v4_md5_hash_hdr() local
1047 hp = tcp_get_md5sig_pool(); tcp_v4_md5_hash_hdr()
1048 if (!hp) tcp_v4_md5_hash_hdr()
1050 desc = &hp->md5_desc; tcp_v4_md5_hash_hdr()
1054 if (tcp_v4_md5_hash_pseudoheader(hp, daddr, saddr, th->doff << 2)) tcp_v4_md5_hash_hdr()
1056 if (tcp_md5_hash_header(hp, th)) tcp_v4_md5_hash_hdr()
1058 if (tcp_md5_hash_key(hp, key)) tcp_v4_md5_hash_hdr()
1077 struct tcp_md5sig_pool *hp; tcp_v4_md5_hash_skb() local
1091 hp = tcp_get_md5sig_pool(); tcp_v4_md5_hash_skb()
1092 if (!hp) tcp_v4_md5_hash_skb()
1094 desc = &hp->md5_desc; tcp_v4_md5_hash_skb()
1099 if (tcp_v4_md5_hash_pseudoheader(hp, daddr, saddr, skb->len)) tcp_v4_md5_hash_skb()
1101 if (tcp_md5_hash_header(hp, th)) tcp_v4_md5_hash_skb()
1103 if (tcp_md5_hash_skb_data(hp, skb, th->doff << 2)) tcp_v4_md5_hash_skb()
1105 if (tcp_md5_hash_key(hp, key)) tcp_v4_md5_hash_skb()
/linux-4.4.14/drivers/ata/
H A Dlibata-acpi.c42 struct acpi_hotplug_context hp; member in struct:ata_acpi_hotplug_context
49 #define ata_hotplug_data(context) (container_of((context), struct ata_acpi_hotplug_context, hp)->data)
136 struct ata_device *dev = ata_hotplug_data(adev->hp).dev; ata_acpi_dev_notify_dock()
143 ata_acpi_handle_hotplug(ata_hotplug_data(adev->hp).ap, NULL, event); ata_acpi_ap_notify_dock()
168 ata_acpi_uevent(ata_hotplug_data(adev->hp).ap, NULL, event); ata_acpi_ap_uevent()
173 struct ata_device *dev = ata_hotplug_data(adev->hp).dev; ata_acpi_dev_uevent()
193 if (!adev || adev->hp) ata_acpi_bind_port()
201 acpi_initialize_hp_context(adev, &context->hp, ata_acpi_ap_notify_dock, ata_acpi_bind_port()
235 if (!adev || adev->hp) ata_acpi_bind_dev()
243 acpi_initialize_hp_context(adev, &context->hp, ata_acpi_dev_notify_dock, ata_acpi_bind_dev()
/linux-4.4.14/drivers/ide/
H A Dtriflex.c7 * Author: Torben Mathiasen <torben.mathiasen@hp.com>
/linux-4.4.14/drivers/pci/pcie/aer/
H A Decrc.c5 * Andrew Patterson <andrew.patterson@hp.com>
/linux-4.4.14/drivers/pcmcia/
H A Dsa1111_badge4.c6 * Christopher Hoover <ch@hpl.hp.com>
/linux-4.4.14/net/wireless/
H A Dwext-proc.c4 * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com>
/linux-4.4.14/arch/s390/kernel/
H A Dhead64.S4 * Author(s): Hartmut Penner <hp@de.ibm.com>
/linux-4.4.14/arch/m68k/68360/
H A Dints.c87 /* irl = 4, hp = 1f - see MC68360UM p 7-377 */ trap_init()
/linux-4.4.14/arch/arm/mach-pxa/
H A Dh5000.c5 * Copyright 2002 Jamey Hicks <jamey.hicks@hp.com>
/linux-4.4.14/sound/soc/sirf/
H A Dsirf-audio.c103 "hp-pa-gpios", 0); sirf_audio_probe()
/linux-4.4.14/drivers/net/wireless/orinoco/
H A Dorinoco_pci.c18 * Copyright (C) 2001 Jean Tourrilhes <jt AT hpl.hp.com>
240 " Jean Tourrilhes <jt@hpl.hp.com>)";
/linux-4.4.14/drivers/acpi/
H A Dpci_slot.c10 * Alex Chiang <achiang@hp.com>
40 #define DRIVER_AUTHOR "Alex Chiang <achiang@hp.com>"

Completed in 2962 milliseconds

123