nozomi.c (aa1262b3876ec5249ff464618a7dcd46b3ca54e2) | nozomi.c (6aad04f21374633bd8cecf25024553d1e11a9522) |
---|---|
1/* 2 * nozomi.c -- HSDPA driver Broadband Wireless Data Card - Globe Trotter 3 * 4 * Written by: Ulf Jakobsson, 5 * Jan Åkerfeldt, 6 * Stefan Thomasson, 7 * 8 * Maintained by: Paul Hardwick (p.hardwick@option.com) --- 777 unchanged lines hidden (view full) --- 786 */ 787static int send_data(enum port_type index, struct nozomi *dc) 788{ 789 u32 size = 0; 790 struct port *port = &dc->port[index]; 791 const u8 toggle = port->toggle_ul; 792 void __iomem *addr = port->ul_addr[toggle]; 793 const u32 ul_size = port->ul_size[toggle]; | 1/* 2 * nozomi.c -- HSDPA driver Broadband Wireless Data Card - Globe Trotter 3 * 4 * Written by: Ulf Jakobsson, 5 * Jan Åkerfeldt, 6 * Stefan Thomasson, 7 * 8 * Maintained by: Paul Hardwick (p.hardwick@option.com) --- 777 unchanged lines hidden (view full) --- 786 */ 787static int send_data(enum port_type index, struct nozomi *dc) 788{ 789 u32 size = 0; 790 struct port *port = &dc->port[index]; 791 const u8 toggle = port->toggle_ul; 792 void __iomem *addr = port->ul_addr[toggle]; 793 const u32 ul_size = port->ul_size[toggle]; |
794 struct tty_struct *tty = tty_port_tty_get(&port->port); | |
795 796 /* Get data from tty and place in buf for now */ 797 size = kfifo_out(&port->fifo_ul, dc->send_buf, 798 ul_size < SEND_BUF_MAX ? ul_size : SEND_BUF_MAX); 799 800 if (size == 0) { 801 DBG4("No more data to send, disable link:"); | 794 795 /* Get data from tty and place in buf for now */ 796 size = kfifo_out(&port->fifo_ul, dc->send_buf, 797 ul_size < SEND_BUF_MAX ? ul_size : SEND_BUF_MAX); 798 799 if (size == 0) { 800 DBG4("No more data to send, disable link:"); |
802 tty_kref_put(tty); | |
803 return 0; 804 } 805 806 /* DUMP(buf, size); */ 807 808 /* Write length + data */ 809 write_mem32(addr, (u32 *) &size, 4); 810 write_mem32(addr + 4, (u32 *) dc->send_buf, size); 811 | 801 return 0; 802 } 803 804 /* DUMP(buf, size); */ 805 806 /* Write length + data */ 807 write_mem32(addr, (u32 *) &size, 4); 808 write_mem32(addr + 4, (u32 *) dc->send_buf, size); 809 |
812 if (tty) 813 tty_wakeup(tty); | 810 tty_port_tty_wakeup(&port->port); |
814 | 811 |
815 tty_kref_put(tty); | |
816 return 1; 817} 818 819/* If all data has been read, return 1, else 0 */ 820static int receive_data(enum port_type index, struct nozomi *dc) 821{ 822 u8 buf[RECEIVE_BUF_MAX] = { 0 }; 823 int size; --- 1133 unchanged lines hidden --- | 812 return 1; 813} 814 815/* If all data has been read, return 1, else 0 */ 816static int receive_data(enum port_type index, struct nozomi *dc) 817{ 818 u8 buf[RECEIVE_BUF_MAX] = { 0 }; 819 int size; --- 1133 unchanged lines hidden --- |