st_gdata 28 drivers/misc/ti-st/st_core.c static void add_channel_to_table(struct st_data_s *st_gdata, st_gdata 33 drivers/misc/ti-st/st_core.c st_gdata->list[new_proto->chnl_id] = new_proto; st_gdata 34 drivers/misc/ti-st/st_core.c st_gdata->is_registered[new_proto->chnl_id] = true; st_gdata 37 drivers/misc/ti-st/st_core.c static void remove_channel_from_table(struct st_data_s *st_gdata, st_gdata 42 drivers/misc/ti-st/st_core.c st_gdata->is_registered[proto->chnl_id] = false; st_gdata 52 drivers/misc/ti-st/st_core.c int st_get_uart_wr_room(struct st_data_s *st_gdata) st_gdata 55 drivers/misc/ti-st/st_core.c if (unlikely(st_gdata == NULL || st_gdata->tty == NULL)) { st_gdata 59 drivers/misc/ti-st/st_core.c tty = st_gdata->tty; st_gdata 70 drivers/misc/ti-st/st_core.c int st_int_write(struct st_data_s *st_gdata, st_gdata 74 drivers/misc/ti-st/st_core.c if (unlikely(st_gdata == NULL || st_gdata->tty == NULL)) { st_gdata 78 drivers/misc/ti-st/st_core.c tty = st_gdata->tty; st_gdata 91 drivers/misc/ti-st/st_core.c static void st_send_frame(unsigned char chnl_id, struct st_data_s *st_gdata) st_gdata 96 drivers/misc/ti-st/st_core.c (st_gdata == NULL || st_gdata->rx_skb == NULL st_gdata 97 drivers/misc/ti-st/st_core.c || st_gdata->is_registered[chnl_id] == false)) { st_gdata 100 drivers/misc/ti-st/st_core.c kfree_skb(st_gdata->rx_skb); st_gdata 108 drivers/misc/ti-st/st_core.c if (likely(st_gdata->list[chnl_id]->recv != NULL)) { st_gdata 110 drivers/misc/ti-st/st_core.c (st_gdata->list[chnl_id]->recv st_gdata 111 drivers/misc/ti-st/st_core.c (st_gdata->list[chnl_id]->priv_data, st_gdata->rx_skb) st_gdata 114 drivers/misc/ti-st/st_core.c kfree_skb(st_gdata->rx_skb); st_gdata 119 drivers/misc/ti-st/st_core.c kfree_skb(st_gdata->rx_skb); st_gdata 131 drivers/misc/ti-st/st_core.c static void st_reg_complete(struct st_data_s *st_gdata, int err) st_gdata 136 drivers/misc/ti-st/st_core.c if (likely(st_gdata != NULL && st_gdata 137 drivers/misc/ti-st/st_core.c st_gdata->is_registered[i] == true && st_gdata 138 drivers/misc/ti-st/st_core.c st_gdata->list[i]->reg_complete_cb != NULL)) { st_gdata 139 drivers/misc/ti-st/st_core.c st_gdata->list[i]->reg_complete_cb st_gdata 140 drivers/misc/ti-st/st_core.c (st_gdata->list[i]->priv_data, err); st_gdata 143 drivers/misc/ti-st/st_core.c st_gdata->is_registered[i] = false; st_gdata 144 drivers/misc/ti-st/st_core.c if (st_gdata->protos_registered) st_gdata 145 drivers/misc/ti-st/st_core.c st_gdata->protos_registered--; st_gdata 151 drivers/misc/ti-st/st_core.c static inline int st_check_data_len(struct st_data_s *st_gdata, st_gdata 154 drivers/misc/ti-st/st_core.c int room = skb_tailroom(st_gdata->rx_skb); st_gdata 163 drivers/misc/ti-st/st_core.c st_send_frame(chnl_id, st_gdata); st_gdata 171 drivers/misc/ti-st/st_core.c kfree_skb(st_gdata->rx_skb); st_gdata 176 drivers/misc/ti-st/st_core.c st_gdata->rx_state = ST_W4_DATA; st_gdata 177 drivers/misc/ti-st/st_core.c st_gdata->rx_count = len; st_gdata 183 drivers/misc/ti-st/st_core.c st_gdata->rx_state = ST_W4_PACKET_TYPE; st_gdata 184 drivers/misc/ti-st/st_core.c st_gdata->rx_skb = NULL; st_gdata 185 drivers/misc/ti-st/st_core.c st_gdata->rx_count = 0; st_gdata 186 drivers/misc/ti-st/st_core.c st_gdata->rx_chnl = 0; st_gdata 195 drivers/misc/ti-st/st_core.c static inline void st_wakeup_ack(struct st_data_s *st_gdata, st_gdata 201 drivers/misc/ti-st/st_core.c spin_lock_irqsave(&st_gdata->lock, flags); st_gdata 205 drivers/misc/ti-st/st_core.c while ((waiting_skb = skb_dequeue(&st_gdata->tx_waitq))) st_gdata 206 drivers/misc/ti-st/st_core.c skb_queue_tail(&st_gdata->txq, waiting_skb); st_gdata 209 drivers/misc/ti-st/st_core.c st_ll_sleep_state(st_gdata, (unsigned long)cmd); st_gdata 210 drivers/misc/ti-st/st_core.c spin_unlock_irqrestore(&st_gdata->lock, flags); st_gdata 213 drivers/misc/ti-st/st_core.c st_tx_wakeup(st_gdata); st_gdata 233 drivers/misc/ti-st/st_core.c struct st_data_s *st_gdata = (struct st_data_s *)disc_data; st_gdata 238 drivers/misc/ti-st/st_core.c if (unlikely(ptr == NULL) || (st_gdata == NULL)) { st_gdata 244 drivers/misc/ti-st/st_core.c "rx_count %ld", count, st_gdata->rx_state, st_gdata 245 drivers/misc/ti-st/st_core.c st_gdata->rx_count); st_gdata 247 drivers/misc/ti-st/st_core.c spin_lock_irqsave(&st_gdata->lock, flags); st_gdata 250 drivers/misc/ti-st/st_core.c if (st_gdata->rx_count) { st_gdata 251 drivers/misc/ti-st/st_core.c len = min_t(unsigned int, st_gdata->rx_count, count); st_gdata 252 drivers/misc/ti-st/st_core.c skb_put_data(st_gdata->rx_skb, ptr, len); st_gdata 253 drivers/misc/ti-st/st_core.c st_gdata->rx_count -= len; st_gdata 257 drivers/misc/ti-st/st_core.c if (st_gdata->rx_count) st_gdata 261 drivers/misc/ti-st/st_core.c switch (st_gdata->rx_state) { st_gdata 267 drivers/misc/ti-st/st_core.c st_send_frame(st_gdata->rx_chnl, st_gdata); st_gdata 269 drivers/misc/ti-st/st_core.c st_gdata->rx_state = ST_W4_PACKET_TYPE; st_gdata 270 drivers/misc/ti-st/st_core.c st_gdata->rx_skb = NULL; st_gdata 274 drivers/misc/ti-st/st_core.c proto = st_gdata->list[st_gdata->rx_chnl]; st_gdata 276 drivers/misc/ti-st/st_core.c &st_gdata->rx_skb->data st_gdata 288 drivers/misc/ti-st/st_core.c st_check_data_len(st_gdata, proto->chnl_id, st_gdata 307 drivers/misc/ti-st/st_core.c st_ll_sleep_state(st_gdata, *ptr); st_gdata 311 drivers/misc/ti-st/st_core.c spin_unlock_irqrestore(&st_gdata->lock, flags); st_gdata 312 drivers/misc/ti-st/st_core.c if (st_ll_getstate(st_gdata) == ST_LL_AWAKE) st_gdata 313 drivers/misc/ti-st/st_core.c st_wakeup_ack(st_gdata, LL_WAKE_UP_ACK); st_gdata 314 drivers/misc/ti-st/st_core.c spin_lock_irqsave(&st_gdata->lock, flags); st_gdata 322 drivers/misc/ti-st/st_core.c spin_unlock_irqrestore(&st_gdata->lock, flags); st_gdata 324 drivers/misc/ti-st/st_core.c st_wakeup_ack(st_gdata, *ptr); st_gdata 325 drivers/misc/ti-st/st_core.c spin_lock_irqsave(&st_gdata->lock, flags); st_gdata 346 drivers/misc/ti-st/st_core.c (st_gdata->list[type] == NULL)) { st_gdata 353 drivers/misc/ti-st/st_core.c st_gdata->rx_skb = alloc_skb( st_gdata 354 drivers/misc/ti-st/st_core.c st_gdata->list[type]->max_frame_size, st_gdata 356 drivers/misc/ti-st/st_core.c if (st_gdata->rx_skb == NULL) { st_gdata 361 drivers/misc/ti-st/st_core.c skb_reserve(st_gdata->rx_skb, st_gdata 362 drivers/misc/ti-st/st_core.c st_gdata->list[type]->reserve); st_gdata 364 drivers/misc/ti-st/st_core.c st_gdata->rx_skb->cb[0] = type; /*pkt_type*/ st_gdata 365 drivers/misc/ti-st/st_core.c st_gdata->rx_skb->cb[1] = 0; /*incoming*/ st_gdata 366 drivers/misc/ti-st/st_core.c st_gdata->rx_chnl = *ptr; st_gdata 367 drivers/misc/ti-st/st_core.c st_gdata->rx_state = ST_W4_HEADER; st_gdata 368 drivers/misc/ti-st/st_core.c st_gdata->rx_count = st_gdata->list[type]->hdr_len; st_gdata 369 drivers/misc/ti-st/st_core.c pr_debug("rx_count %ld\n", st_gdata->rx_count); st_gdata 375 drivers/misc/ti-st/st_core.c spin_unlock_irqrestore(&st_gdata->lock, flags); st_gdata 386 drivers/misc/ti-st/st_core.c static struct sk_buff *st_int_dequeue(struct st_data_s *st_gdata) st_gdata 391 drivers/misc/ti-st/st_core.c if (st_gdata->tx_skb != NULL) { st_gdata 392 drivers/misc/ti-st/st_core.c returning_skb = st_gdata->tx_skb; st_gdata 393 drivers/misc/ti-st/st_core.c st_gdata->tx_skb = NULL; st_gdata 396 drivers/misc/ti-st/st_core.c return skb_dequeue(&st_gdata->txq); st_gdata 408 drivers/misc/ti-st/st_core.c static void st_int_enqueue(struct st_data_s *st_gdata, struct sk_buff *skb) st_gdata 413 drivers/misc/ti-st/st_core.c spin_lock_irqsave(&st_gdata->lock, flags); st_gdata 415 drivers/misc/ti-st/st_core.c switch (st_ll_getstate(st_gdata)) { st_gdata 418 drivers/misc/ti-st/st_core.c skb_queue_tail(&st_gdata->txq, skb); st_gdata 421 drivers/misc/ti-st/st_core.c skb_queue_tail(&st_gdata->tx_waitq, skb); st_gdata 425 drivers/misc/ti-st/st_core.c "purging received skb.", st_ll_getstate(st_gdata)); st_gdata 429 drivers/misc/ti-st/st_core.c skb_queue_tail(&st_gdata->tx_waitq, skb); st_gdata 430 drivers/misc/ti-st/st_core.c st_ll_wakeup(st_gdata); st_gdata 434 drivers/misc/ti-st/st_core.c "purging received skb.", st_ll_getstate(st_gdata)); st_gdata 439 drivers/misc/ti-st/st_core.c spin_unlock_irqrestore(&st_gdata->lock, flags); st_gdata 452 drivers/misc/ti-st/st_core.c struct st_data_s *st_gdata = container_of(work, struct st_data_s, st_gdata 455 drivers/misc/ti-st/st_core.c st_tx_wakeup((void *)st_gdata); st_gdata 502 drivers/misc/ti-st/st_core.c void kim_st_list_protocols(struct st_data_s *st_gdata, void *buf) st_gdata 505 drivers/misc/ti-st/st_core.c st_gdata->protos_registered, st_gdata 506 drivers/misc/ti-st/st_core.c st_gdata->is_registered[0x04] == true ? 'R' : 'U', st_gdata 507 drivers/misc/ti-st/st_core.c st_gdata->is_registered[0x08] == true ? 'R' : 'U', st_gdata 508 drivers/misc/ti-st/st_core.c st_gdata->is_registered[0x09] == true ? 'R' : 'U'); st_gdata 518 drivers/misc/ti-st/st_core.c struct st_data_s *st_gdata; st_gdata 522 drivers/misc/ti-st/st_core.c st_kim_ref(&st_gdata, 0); st_gdata 523 drivers/misc/ti-st/st_core.c if (st_gdata == NULL || new_proto == NULL || new_proto->recv == NULL st_gdata 534 drivers/misc/ti-st/st_core.c if (st_gdata->is_registered[new_proto->chnl_id] == true) { st_gdata 540 drivers/misc/ti-st/st_core.c spin_lock_irqsave(&st_gdata->lock, flags); st_gdata 542 drivers/misc/ti-st/st_core.c if (test_bit(ST_REG_IN_PROGRESS, &st_gdata->st_state)) { st_gdata 546 drivers/misc/ti-st/st_core.c add_channel_to_table(st_gdata, new_proto); st_gdata 547 drivers/misc/ti-st/st_core.c st_gdata->protos_registered++; st_gdata 550 drivers/misc/ti-st/st_core.c set_bit(ST_REG_PENDING, &st_gdata->st_state); st_gdata 551 drivers/misc/ti-st/st_core.c spin_unlock_irqrestore(&st_gdata->lock, flags); st_gdata 553 drivers/misc/ti-st/st_core.c } else if (st_gdata->protos_registered == ST_EMPTY) { st_gdata 555 drivers/misc/ti-st/st_core.c set_bit(ST_REG_IN_PROGRESS, &st_gdata->st_state); st_gdata 559 drivers/misc/ti-st/st_core.c st_ll_enable(st_gdata); st_gdata 562 drivers/misc/ti-st/st_core.c spin_unlock_irqrestore(&st_gdata->lock, flags); st_gdata 567 drivers/misc/ti-st/st_core.c err = st_kim_start(st_gdata->kim_data); st_gdata 569 drivers/misc/ti-st/st_core.c clear_bit(ST_REG_IN_PROGRESS, &st_gdata->st_state); st_gdata 570 drivers/misc/ti-st/st_core.c if ((st_gdata->protos_registered != ST_EMPTY) && st_gdata 571 drivers/misc/ti-st/st_core.c (test_bit(ST_REG_PENDING, &st_gdata->st_state))) { st_gdata 573 drivers/misc/ti-st/st_core.c spin_lock_irqsave(&st_gdata->lock, flags); st_gdata 574 drivers/misc/ti-st/st_core.c st_reg_complete(st_gdata, err); st_gdata 575 drivers/misc/ti-st/st_core.c spin_unlock_irqrestore(&st_gdata->lock, flags); st_gdata 576 drivers/misc/ti-st/st_core.c clear_bit(ST_REG_PENDING, &st_gdata->st_state); st_gdata 581 drivers/misc/ti-st/st_core.c spin_lock_irqsave(&st_gdata->lock, flags); st_gdata 583 drivers/misc/ti-st/st_core.c clear_bit(ST_REG_IN_PROGRESS, &st_gdata->st_state); st_gdata 589 drivers/misc/ti-st/st_core.c if ((st_gdata->protos_registered != ST_EMPTY) && st_gdata 590 drivers/misc/ti-st/st_core.c (test_bit(ST_REG_PENDING, &st_gdata->st_state))) { st_gdata 592 drivers/misc/ti-st/st_core.c st_reg_complete(st_gdata, 0); st_gdata 594 drivers/misc/ti-st/st_core.c clear_bit(ST_REG_PENDING, &st_gdata->st_state); st_gdata 599 drivers/misc/ti-st/st_core.c if (st_gdata->is_registered[new_proto->chnl_id] == true) { st_gdata 602 drivers/misc/ti-st/st_core.c spin_unlock_irqrestore(&st_gdata->lock, flags); st_gdata 606 drivers/misc/ti-st/st_core.c add_channel_to_table(st_gdata, new_proto); st_gdata 607 drivers/misc/ti-st/st_core.c st_gdata->protos_registered++; st_gdata 609 drivers/misc/ti-st/st_core.c spin_unlock_irqrestore(&st_gdata->lock, flags); st_gdata 614 drivers/misc/ti-st/st_core.c add_channel_to_table(st_gdata, new_proto); st_gdata 615 drivers/misc/ti-st/st_core.c st_gdata->protos_registered++; st_gdata 619 drivers/misc/ti-st/st_core.c spin_unlock_irqrestore(&st_gdata->lock, flags); st_gdata 632 drivers/misc/ti-st/st_core.c struct st_data_s *st_gdata; st_gdata 636 drivers/misc/ti-st/st_core.c st_kim_ref(&st_gdata, 0); st_gdata 637 drivers/misc/ti-st/st_core.c if (!st_gdata || proto->chnl_id >= ST_MAX_CHANNELS) { st_gdata 642 drivers/misc/ti-st/st_core.c spin_lock_irqsave(&st_gdata->lock, flags); st_gdata 644 drivers/misc/ti-st/st_core.c if (st_gdata->is_registered[proto->chnl_id] == false) { st_gdata 646 drivers/misc/ti-st/st_core.c spin_unlock_irqrestore(&st_gdata->lock, flags); st_gdata 650 drivers/misc/ti-st/st_core.c if (st_gdata->protos_registered) st_gdata 651 drivers/misc/ti-st/st_core.c st_gdata->protos_registered--; st_gdata 653 drivers/misc/ti-st/st_core.c remove_channel_from_table(st_gdata, proto); st_gdata 654 drivers/misc/ti-st/st_core.c spin_unlock_irqrestore(&st_gdata->lock, flags); st_gdata 656 drivers/misc/ti-st/st_core.c if ((st_gdata->protos_registered == ST_EMPTY) && st_gdata 657 drivers/misc/ti-st/st_core.c (!test_bit(ST_REG_PENDING, &st_gdata->st_state))) { st_gdata 661 drivers/misc/ti-st/st_core.c if (st_gdata->tty) { st_gdata 662 drivers/misc/ti-st/st_core.c tty_ldisc_flush(st_gdata->tty); st_gdata 663 drivers/misc/ti-st/st_core.c stop_tty(st_gdata->tty); st_gdata 667 drivers/misc/ti-st/st_core.c st_kim_stop(st_gdata->kim_data); st_gdata 669 drivers/misc/ti-st/st_core.c st_ll_disable(st_gdata); st_gdata 680 drivers/misc/ti-st/st_core.c struct st_data_s *st_gdata; st_gdata 683 drivers/misc/ti-st/st_core.c st_kim_ref(&st_gdata, 0); st_gdata 684 drivers/misc/ti-st/st_core.c if (unlikely(skb == NULL || st_gdata == NULL st_gdata 685 drivers/misc/ti-st/st_core.c || st_gdata->tty == NULL)) { st_gdata 694 drivers/misc/ti-st/st_core.c st_int_enqueue(st_gdata, skb); st_gdata 696 drivers/misc/ti-st/st_core.c st_tx_wakeup(st_gdata); st_gdata 712 drivers/misc/ti-st/st_core.c struct st_data_s *st_gdata; st_gdata 715 drivers/misc/ti-st/st_core.c st_kim_ref(&st_gdata, 0); st_gdata 716 drivers/misc/ti-st/st_core.c st_gdata->tty = tty; st_gdata 717 drivers/misc/ti-st/st_core.c tty->disc_data = st_gdata; st_gdata 732 drivers/misc/ti-st/st_core.c st_kim_complete(st_gdata->kim_data); st_gdata 741 drivers/misc/ti-st/st_core.c struct st_data_s *st_gdata = tty->disc_data; st_gdata 749 drivers/misc/ti-st/st_core.c spin_lock_irqsave(&st_gdata->lock, flags); st_gdata 751 drivers/misc/ti-st/st_core.c if (st_gdata->is_registered[i] == true) st_gdata 753 drivers/misc/ti-st/st_core.c st_gdata->list[i] = NULL; st_gdata 754 drivers/misc/ti-st/st_core.c st_gdata->is_registered[i] = false; st_gdata 756 drivers/misc/ti-st/st_core.c st_gdata->protos_registered = 0; st_gdata 757 drivers/misc/ti-st/st_core.c spin_unlock_irqrestore(&st_gdata->lock, flags); st_gdata 762 drivers/misc/ti-st/st_core.c st_kim_complete(st_gdata->kim_data); st_gdata 763 drivers/misc/ti-st/st_core.c st_gdata->tty = NULL; st_gdata 768 drivers/misc/ti-st/st_core.c spin_lock_irqsave(&st_gdata->lock, flags); st_gdata 770 drivers/misc/ti-st/st_core.c skb_queue_purge(&st_gdata->txq); st_gdata 771 drivers/misc/ti-st/st_core.c skb_queue_purge(&st_gdata->tx_waitq); st_gdata 773 drivers/misc/ti-st/st_core.c st_gdata->rx_count = 0; st_gdata 774 drivers/misc/ti-st/st_core.c st_gdata->rx_state = ST_W4_PACKET_TYPE; st_gdata 775 drivers/misc/ti-st/st_core.c kfree_skb(st_gdata->rx_skb); st_gdata 776 drivers/misc/ti-st/st_core.c st_gdata->rx_skb = NULL; st_gdata 777 drivers/misc/ti-st/st_core.c spin_unlock_irqrestore(&st_gdata->lock, flags); st_gdata 803 drivers/misc/ti-st/st_core.c struct st_data_s *st_gdata = tty->disc_data; st_gdata 813 drivers/misc/ti-st/st_core.c schedule_work(&st_gdata->work_write_wakeup); st_gdata 818 drivers/misc/ti-st/st_core.c struct st_data_s *st_gdata = tty->disc_data; st_gdata 821 drivers/misc/ti-st/st_core.c kfree_skb(st_gdata->tx_skb); st_gdata 822 drivers/misc/ti-st/st_core.c st_gdata->tx_skb = NULL; st_gdata 842 drivers/misc/ti-st/st_core.c struct st_data_s *st_gdata; st_gdata 853 drivers/misc/ti-st/st_core.c st_gdata = kzalloc(sizeof(struct st_data_s), GFP_KERNEL); st_gdata 854 drivers/misc/ti-st/st_core.c if (!st_gdata) { st_gdata 866 drivers/misc/ti-st/st_core.c skb_queue_head_init(&st_gdata->txq); st_gdata 867 drivers/misc/ti-st/st_core.c skb_queue_head_init(&st_gdata->tx_waitq); st_gdata 870 drivers/misc/ti-st/st_core.c spin_lock_init(&st_gdata->lock); st_gdata 872 drivers/misc/ti-st/st_core.c err = st_ll_init(st_gdata); st_gdata 875 drivers/misc/ti-st/st_core.c kfree(st_gdata); st_gdata 882 drivers/misc/ti-st/st_core.c INIT_WORK(&st_gdata->work_write_wakeup, work_fn_write_wakeup); st_gdata 884 drivers/misc/ti-st/st_core.c *core_data = st_gdata; st_gdata 888 drivers/misc/ti-st/st_core.c void st_core_exit(struct st_data_s *st_gdata) st_gdata 892 drivers/misc/ti-st/st_core.c err = st_ll_deinit(st_gdata); st_gdata 896 drivers/misc/ti-st/st_core.c if (st_gdata != NULL) { st_gdata 898 drivers/misc/ti-st/st_core.c skb_queue_purge(&st_gdata->txq); st_gdata 899 drivers/misc/ti-st/st_core.c skb_queue_purge(&st_gdata->tx_waitq); st_gdata 900 drivers/misc/ti-st/st_core.c kfree_skb(st_gdata->rx_skb); st_gdata 901 drivers/misc/ti-st/st_core.c kfree_skb(st_gdata->tx_skb); st_gdata 907 drivers/misc/ti-st/st_core.c kfree(st_gdata); st_gdata 418 drivers/misc/ti-st/st_kim.c struct st_data_s *st_gdata = (struct st_data_s *)disc_data; st_gdata 419 drivers/misc/ti-st/st_kim.c struct kim_data_s *kim_gdata = st_gdata->kim_data; st_gdata 155 include/linux/ti_wilink_st.h int st_get_uart_wr_room(struct st_data_s *st_gdata);