Commit Graph

2375 Commits

Author SHA1 Message Date
Dan Williams
3ec7e89f11 Merge remote branch 'origin/master' into qcdm 2010-03-11 13:43:06 -08:00
Dan Williams
749f9c0eb5 core: stop probing known-unusable ports early
Some ports we know we shouldn't use when we get certain responses
from them.  Reading from these ports triggers kernel bugs (at least
on 2.6.31 and 2.6.32) relating to flow control in some drivers
(*cough* hso *cough*), so lets try not to aggravate the kernel too
much.  This happens on Icera-based Option devices like the GI0322
(AT&T Quicksilver) for example.

(note: AFAICT this doesn't have any relation to the recent XON/XOFF
patch, since I get this problem without the XON/XOFF patch on both
2.6.31 and 2.6.32 as well)

---

BUG: sleeping function called from invalid context at kernel/mutex.c:94
in_atomic(): 1, irqs_disabled(): 1, pid: 9295, name: modem-manager
Pid: 9295, comm: modem-manager Not tainted 2.6.32.9-67.fc12.x86_64 #1
Call Trace:
 <IRQ>  [<ffffffff81045d41>] __might_sleep+0xed/0xef
 [<ffffffff81454dd0>] mutex_lock+0x24/0x50
 [<ffffffff8104811e>] ? enqueue_task_fair+0x2a/0x6d
 [<ffffffff812af79f>] tty_throttle+0x1b/0x49
 [<ffffffff812af0d9>] n_tty_receive_buf+0xdbb/0xe12
 [<ffffffff810459fd>] ? task_rq_unlock+0x11/0x13
 [<ffffffff81050c5c>] ? try_to_wake_up+0x2f3/0x305
 [<ffffffff8110de0c>] ? __kmalloc+0x37/0x15e
 [<ffffffff8110de42>] ? __kmalloc+0x6d/0x15e
 [<ffffffff812b12c9>] flush_to_ldisc+0xf8/0x18d
 [<ffffffff812b13ae>] tty_flip_buffer_push+0x50/0x61
 [<ffffffffa040ccd5>] put_rxbuf_data+0xea/0x124 [hso]
 [<ffffffffa040cd97>] put_rxbuf_data_and_resubmit_bulk_urb+0x21/0x6b [hso]
 [<ffffffffa040d0b1>] hso_std_serial_read_bulk_callback+0x14d/0x15f [hso]
 [<ffffffff8132edf7>] ? dma_unmap_single_attrs.clone.0+0x38/0x3a
 [<ffffffff8132ef74>] usb_hcd_giveback_urb+0x91/0xc5
 [<ffffffff813417c8>] ehci_urb_done+0x7b/0x90
 [<ffffffff81050c5c>] ? try_to_wake_up+0x2f3/0x305
 [<ffffffff81341b45>] qh_completions+0x368/0x4b9
 [<ffffffff8103e7a0>] ? __wake_up_common+0x4e/0x84
 [<ffffffff81343f70>] ehci_work+0x95/0x732
 [<ffffffff81045b53>] ? __wake_up+0x44/0x4d
 [<ffffffff81070490>] ? insert_work+0x8e/0x9b
 [<ffffffff81345f01>] ehci_irq+0x2be/0x420
 [<ffffffff8107071a>] ? __queue_work+0x3a/0x41
 [<ffffffff81049e43>] ? resched_cpu+0x6e/0x77
 [<ffffffff8107075d>] ? delayed_work_timer_fn+0x3c/0x3e
 [<ffffffff810b0e44>] ? __rcu_process_callbacks+0x7d/0x28a
 [<ffffffff8132e846>] usb_hcd_irq+0x3f/0x7b
 [<ffffffff810acd61>] handle_IRQ_event+0x60/0x121
 [<ffffffff810aeb8e>] handle_fasteoi_irq+0x8b/0xc7
 [<ffffffff81014625>] handle_irq+0x8b/0x96
 [<ffffffff81459c14>] do_IRQ+0x5c/0xbc
 [<ffffffff81012693>] ret_from_intr+0x0/0x11
2010-03-11 13:20:43 -08:00
Dan Williams
13bc593a29 gsm: ensure PDP context deactivation happens on disconnect
The port is still connected until disconnect_done() runs, but by
this point we already know it's been disconnected so it's safe to
run the CGACT commands.
2010-03-10 16:30:58 -08:00
Dan Williams
8f50dd3191 gsm: close open ports on Enable errors 2010-03-10 15:56:27 -08:00
Dan Williams
c0c8954828 gsm: fix PUK2 and other PIN unlock code recognition
Longer entries first so we catch them before matching shorter
substrings.  Previously, the strcmp() would have treated
PUK2 and PUK unlocks the same.
2010-03-10 15:45:50 -08:00
Dan Williams
479937cbbb Merge remote branch 'origin/master' into qcdm 2010-03-10 15:04:49 -08:00
Dan Williams
6a32d374cd serial: not all commands have response callbacks
So don't crash if they don't.
2010-03-10 14:57:23 -08:00
Dan Williams
1979512d8d Merge remote branch 'origin/master' into qcdm 2010-03-10 14:50:41 -08:00
Dan Williams
59b75b5194 gsm: clean up disconnect handling
Allow subclasses to override disconnect more cleanly so that
modem state gets handled correctly when the disconnect is complete.
Also fix up PDP Context ID handle (cid) so that subclasses can
get the previously-activated context ID when disconnecting, and let
the cid be an int since '0' is a valid context number.

For the generic devices, this also attempts to actually deactivate
the PDP context to ensure that the data session is terminated.
2010-03-10 14:39:10 -08:00
Dan Williams
05dde9a315 gsm: revert part of d2e69d34f8
Reg status returned here is cached reg status, so it's pointless to
set it here again.
2010-03-10 00:15:53 -08:00
Dan Williams
d2e69d34f8 gsm: make registration status change handling consistent
Ensure we send out signals when anything changes.
2010-03-10 00:02:56 -08:00
Dan Williams
46ec3bdb47 gsm: fix CREG/CGREG parsing with multiple responses
When a modem sends both CREG and CGREG in the same response packet,
the parser was failing to correctly distinguish which response
was being parsed, since the string passed to g_regex_match() is
the whole response including both CREG + CGREG.
2010-03-09 23:34:19 -08:00
Dan Williams
b0598738f1 gsm: only update access technology when enabled 2010-03-09 22:12:21 -08:00
Dan Williams
38514db896 gsm: let generic class handle signal quality caching and updates 2010-03-09 21:31:57 -08:00
Dan Williams
d01a3ae328 cdma: tell the modem we're using XON/XOFF too 2010-03-09 11:47:13 -08:00
Dan Williams
81dc2dde45 serial: default to XON/XOFF flow control
This seems to help with Huawei and ZTE devices which often
appeared to stop responding on either primary or secondary ports
at various times.  We had this problem a long time ago, but it was
fixed then by always picking the right serial port via the USB
interface number (Huawei) or udev rules files (ZTE).  Now that we're
using the second serial port more extensively the problem came
up again, so lets try to fix it for real.
2010-03-09 11:44:25 -08:00
Dan Williams
fbf3efc1e3 gsm: only use CREG responses for authoritative registration state
For now...
2010-03-09 11:43:30 -08:00
Dan Williams
076b5df1bc gsm: fix inifinite in ETSI tech -> MM tech conversion function 2010-03-09 11:29:04 -08:00
Dan Williams
2f925599c0 gsm: fix crash in Simple API's GetStatus handling
Can't schedule the info completion until we're sure all the
requests have completed.  They won't necessarily be completed
in the same order they were issued since some of the data the
requests pull from could be cached and thus we don't have to
wait in the queue to hit up the modem.
2010-03-09 10:20:32 -08:00
Dan Williams
783de3bc10 core: fix SIGTERM before mainloop has started 2010-03-09 09:55:04 -08:00
Dan Williams
8dde6bb8dd core: don't try to remove 0 characters after matching responses 2010-03-08 20:01:42 -08:00
Dan Williams
f3721a5674 Merge remote branch 'origin/master' into qcdm 2010-03-08 20:01:22 -08:00
Dan Williams
cdf9279ee8 api+gsm: split out access technology
As with allowed modes, make things clearer and simpler by giving
access technology it's own values.
2010-03-08 18:02:14 -08:00
Dan Williams
c5a897d0ae api+gsm: clean up AllowedMode values
Instead of trying to stuff everything into the mode bitfield it
turns out it's just easier, clearer, and simpler to use different
values for each of the following:

1) the device's supported access technologies and allowed modes
2) the device's current access technology
3) the device's allowed mode preference

Since none of the AccessTechnology or AllowedMode stuff has hit a
release yet, let's make sure we're doing it the right way early on.
2010-03-08 17:27:56 -08:00
Dan Williams
aeac17a81e gsm: implement allowed mode 2010-03-08 15:13:14 -08:00
Dan Williams
d298885faa gsm: fix GObject property maximums for SupportedModes and SupportedBands
Since the values they carry are bitfields, using the highest value
as the maximum isn't the right thing to do.
2010-03-08 14:50:07 -08:00
Dan Williams
5e2983484e api: make HSPA a standalone network mode again
It's just easier this way.  It makes little sense to allow
selecting mode combinations for anything other than
(HSDPA | HSUPA).  Most radios don't allow fine-grained control
of the different technologies within each 2G or 3G class anyway
thus combinations like (GPRS | UMTS) are pointless since the
device wouldn't be able to use GPRS but not use EDGE.
2010-03-08 14:15:25 -08:00
Dan Williams
343245fc21 gsm: add AccessTechnology property and associated infrastructure
AccessTechnology takes over half of what NetworkMode was supposed to
do, but we'll keep NetworkMode around for a while for compatibility
anyway.  Create async updaters that subclasses can use to update
the access tech when they get unsolicited messages.
2010-03-08 11:40:54 -08:00
Dan Williams
82d7c8342d gsm: fix crash getting initial registration state 2010-03-07 14:46:38 -08:00
Dan Williams
74ed9baefa gsm: add missing 27.007 access technologies 2010-03-07 11:01:08 -08:00
Dan Williams
7701478703 gsm: simplify registration state polling code 2010-03-07 07:13:43 -08:00
Dan Williams
201295b65e gsm: use secondary serial port while connected
For registration updates and signal strength.
2010-03-06 10:43:54 -08:00
Dan Williams
54c1d069eb gsm: rework registration handling
First, generically handle registration polling if the device does
not support unsolicited registration.  Second, using the new
creg/cgreg parsing functions from mm-modem-helpers.c, handle
CREG=2 unsolicited registration replies to capture the GSM LAC/CI
for the location information API.

Because of these changes we can simplify the registration polling
during connection as well by using the common registration parsing
code and the cached registration state.
2010-03-06 10:28:11 -08:00
Dan Williams
31fb97919c gsm: fix simple state machine network registration after 407abc65c6
Got the logic wrong in that commit.  Fix it.  Network registration
should always be run since it handles polling for registration
state if needed before continuing.
2010-03-06 00:26:54 -08:00
Dan Williams
ad7bbb2f16 gsm: indicate CREG vs. CGREG 2010-03-05 14:08:40 -08:00
Dan Williams
e4350152c8 gsm: common CREG/CGREG parsing function and testcases 2010-03-05 11:47:23 -08:00
Dan Williams
c915de5512 gsm: add ability for subclasses to handle power-on response
This lets subclasses handle errors when they know the device supports
the power-up command.  Also will let us simplify a number of plugins.
2010-03-04 20:06:17 -08:00
Dan Williams
407abc65c6 gsm: handle PINs better during modem enable and simple state machine
First, short-circuit the Enable process if the device requires a PIN
or PUK since for many devices the enable is going to fail anyway
until the PIN is sent.

Second, send the PIN first during the simple state machine for the
same reason; we need the device unlocked before we want to try
to enable it.  This also reworks the simple state machine to be a
bit clearer and make each state step correspond to the action it's
actually doing instead of being off-by-one visually (but not logically).
2010-03-04 19:30:54 -08:00
Dan Williams
021ca1244e gsm: postpone PIN/PUK success reply until we know updated unlock status
Don't return until we know what the updated lock status is.  Fixes an
issue where callers that send the PIN before the modem is enabled
(remember, some modems can't be enabled until the PIN is entered, so
sometimes we have to send the PIN before it's enabled) would get
the reply too early and get failures from other operations.
2010-03-04 19:01:13 -08:00
Dan Williams
3457adefef gsm: clarify generic GSM subclass API a bit 2010-03-04 17:28:36 -08:00
Dan Williams
3b9b7920f5 core: register Modem UnlockRequired property for changed signals too 2010-03-04 10:29:42 -08:00
Dan Williams
a9ef8cb175 policy: split Device into Info and Control
It's useful to let distros and admins set policy differently for device
information (for support, inventory, etc) than for actually controlling
the device like PIN/PUK unlocks.
2010-03-01 09:15:01 -08:00
Dan Williams
f6c514897e Merge remote branch 'origin/master' into qcdm 2010-03-01 09:07:05 -08:00
Dan Williams
9d7cb0ddcf gsm: fix direct registration info requests 2010-02-28 22:11:47 -08:00
Dan Williams
27ede83bd3 trivial: rearrange some code 2010-02-28 21:15:22 -08:00
Dan Williams
28d065c1f1 core: implement optional PolicyKit-based authentication 2010-02-27 12:51:13 -08:00
Dan Williams
aed5f3765d core: add missing MMAuthRequest class 2010-02-27 12:51:03 -08:00
Dan Williams
3b6a58145f core: simply authentication request objects 2010-02-27 10:29:34 -08:00
Dan Williams
27ffa6b272 core: authenticate SMS operations 2010-02-27 07:19:37 -08:00
Dan Williams
438a047935 core: add authorization providers and optional PolicyKit support
When the support is complete, use --with-polkit to enable
PolicyKit support.  It's not there yet, but this commit adds an
authorization provider framework which will be extended to allow
hooking into PolicyKit.
2010-02-26 18:01:55 -08:00